∫tan3xdx
=∫tanxtan2xdx
=∫tanx(sec2x−1)dx
=∫tanxsec2xdx+∫tanxdx
Let I1=∫tanxsec2xdx and I2=∫tanxdx
Consider I1=∫tanxsec2xdx
Let t=tanx⇒dt=sec2xdx
⇒∫tdt=t22+c=tan2x2+c
∴I1=tan2x2+c
Consider I2=∫tanxdx
=∫sinxcosxdx
Let t=cosx⇒dt=−sinxdx
⇒I2=−∫dtt=−logt=log1t=log1cosx=logsecx+c
∴∫tan3xdx=I1+I2
=tan2x2+logsecx+c