#sec^2x=1+tan^2x#
#tan^2x=sec^2x-1#
#tanx=sinx/cosx#
#secx=1/cosx#
Let #u=3x#, #=>#, #du=3xdx#
#inttan^3(3x)dx=1/3inttan^3udu#
#=1/3int(sec^2u-1)tanudu#
#=1/3int(1/cos^2u-1)*sinu/cosudu#
#=1/3int(1-cos^2u)/(cos^3u)sinudu#
Let #v=cosu#, #=>#, #dv=-sinudu#
Therefore,
#=1/3int(1-cos^2u)/(cos^3u)sinudu=1/3int-(1-v^2)/v^3dv#
#=1/3int(v^2-1)/v^3dv#
#=1/3int(1/v-1/v^3)dv#
#=1/3(lnv+1/(2v^2))#
#=1/3(ln(cosu)+1/(2cos^2u))#
#=1/3(ln(∣cos(3x)∣)+1/(2cos^2(3x)))+C#
#=1/3ln(∣cos(3x)∣)+1/6sec^2(3x)+C#