Derivative of $\ln|-\cos(x)|$
I had a Calculus 1 test on inverse functions today and one of the questions asked "What is the antiderivative of $\tan$?".
I know now that the right answer is $\ln(\sec x) + C$, but the answer I put was $\ln|-\cos x| + C$ and I was wondering if that answer would also work. My logic is that the derivative of my answer would be $\dfrac 1 {\cos x} {\sin x}$ which would simplify to $\tan x$.
Can someone just tell me if my answer was right, and if it was wrong what would the derivative of my answer actually be.
$\endgroup$ 23 Answers
$\begingroup$The derivative of $f(x)=\ln|x|$ is $f'(x)=\frac{1}{x}$. So the derivative of $\ln|-\cos x|$ is $\frac{\sin x}{-\cos x}$. This is because the derivative of $-\cos x$ is $\sin x$.
So the derivative of your expression is $-\tan x$.
$\endgroup$ $\begingroup$$$y=\ln|-\cos x|=\ln\sqrt{(-\cos x)^2}=\frac{1}{2}\ln(-\cos x)^2=\frac{1}{2}\ln(\cos^2 x)$$ $$y'=\frac{1}{2}(\frac{-2\cos x \sin x}{\cos^2 x})=-\tan x$$
$\endgroup$ 2 $\begingroup$We have $$ \frac{d}{dx} \log{(k\cos{x})} = \frac{-k\sin{x}}{k\cos{x}} $$ by applying the chain rule. Whatever the value of $k$, the derivative is $-\tan{x}$.
$\endgroup$ 2