well the first pattern to note is this
d/dx (ln cos x) = 1/ cos x * - sin x = - tan xddx(lncosx)=1cosx⋅−sinx=−tanx
And so
d/dx (ln^2 cos x) = 2 ln (cos x) *d/dx (ln cos x) ddx(ln2cosx)=2ln(cosx)⋅ddx(lncosx)
= - 2 ln (cos x) tan x=−2ln(cosx)tanx
So final tweak: d/dx( -1/2 ln^2 cos x ) = ln (cos x) tan xddx(−12ln2cosx)=ln(cosx)tanx
And thus
int \ ln (cos x) tan x \ dx = int \ d/dx( -1/2 ln^2 cos x ) \ dx
= -1/2 ln^2 cos x + C
Or you can try find a sub
This one works well:
u = ln (cos x), du = - tan x \ dx
...because the integral becomes
int \tan x * u * -1/tan x \ du
=- int \ u \ du
=- u^2/2 + C
=- 1/2 ln^2 (cos x) + C