Hey CoffeeBird.

If we take the derivative of ln(cos(theta))*-sin(theta) then we should get 1/cos(theta) by the fundamental theorem of calculus (which relates anti-derivatives to derivatives).

So d/d(theta) (ln(cos(theta))*-sin(theta) =

= vu' + uv' = -sin(theta)*sin(theta)/cos(theta) + ln(cos(theta))*-cos(theta)

= -sin(theta)tan(theta) - cos(theta)*ln(cos(theta)).

Now google says that the derivative is ln|sec(theta) + tan(theta)|. Lets differentiate this and see what we get:

d/d(theta) ln|sec(theta) + tan(theta)| = d/d(theta)sec(theta) + d/d(theta)tan(theta) / [sec(theta) + tan(theta)]

= [tan(theta)sec(theta) + sec^2(theta)]/[sec(theta) + tan[theta])

= sec(theta)[tan(theta) + sec(theta)]/[tan(theta) + sec(theta)]

= sec(theta) * 1

= sec(theta).