# Is finding the extreme points of a differentiable function by first derivative always correct?

I came across this question where I was asked to find the local minimum and local maximum of the function $$y=\sec x + 2\ln(|\cos x|),$$ domain of $x$ being $(0,2\pi)-\{\pi/2 , 3\pi/2\}$. I found its first derivative to be $$y=\tan x(\sec x-2)$$ and found that it is zero on three points $\pi/3$, $\pi$ and $5\pi/3$. Then I used the second derivative to see which one is local maximum and which one is local minimum. I found that $\pi$ was the point of local maximum and the other two were points of local minimum. But when I actually saw the graph of the function there was no point of local minimum. There were points on which the value of the function was lesser than that at $\pi/3$ and $5\pi/3$ in fact at $\pi/3$ and $5\pi/3$ the tangent was not even parallel to the $x$ axis. I am not getting where I went wrong. Please help .

• Can you show us how you calculated the first derivative? I believe the mistake originates there. Also, remember that $|cos x|$ is not the same as $\cos x$! – 5xum Jun 27 '16 at 9:05
• y=secx + 2log(|cosx|)=secx + log{(cosx)^2} then dy/dx=secxtanx + [{2cosx}/{(cosx)^2}]*(-sinx) = secxtanx - 2tanx=tanx(secx-2) – Varun Chandra Jun 27 '16 at 9:07
• Yes, I see that. But the derivative is only equal to $\tan x(\sec x -2)$ if $\cos x$ is positive! – 5xum Jun 27 '16 at 9:08
• cosx is not always positive regarding the domain of x being (0,2pi)-{pi/2 , 3pi/2} i think and i am agreeing that tanx(secx-2) is the only derivative – Varun Chandra Jun 27 '16 at 9:16
• No, $\tan x (\sec x-2)$ is not the only derivative. It is not the derivative on $(\frac{\pi}{2}, \frac{3\pi}{2})$! – 5xum Jun 27 '16 at 11:05