3 Answers
3

To find where $f\,'(x)=0$, you need to solve $x\cos x-\sin x=0$. There are clearly no solutions with $\cos x=0$, since $\sin x$ and $\cos x$ are never zero simultaneously, so you can divide through by $\cos x$ to get $x-\tan x=0$.

Consider the case in which $n\ge 0$. (The case $n<0$ is similar in principle.) The only solution to $x=\tan x$ must come in the half interval in which $\tan x>0$, which is $\left[n\pi,\left(n+\frac12\right)\pi\right)$. It’s not hard to check that $y=x$ intersects $y=\tan x$ exactly once on each of these half-intervals. It’s also not hard to check that $x-\tan x$ is positive just to the left of each point of intersection and negative just to the right, so that the critical points really are local extrema. Which kind of extremum depends on whether $n$ is even or odd, since $$f\,'(x)=\frac{\cos x}{x^2}(x-\tan x)\;,$$ and its algebraic sign is also affected by the factor of $\cos x$.

The cases of $n=0$ is treated separately. The point $x=0$ is an extremum and we need to show that $g_0(z) < 0$ for $0<z \leqslant \pi$. This follows similarly by noticing that $g_0^\prime(z) < 0$ for $0<z<\pi$, and by $g_0(\pi) < 0$.

Since $f$ is even,we can suppose $n \geq 0$. The case $n=0$ may be treated separately. We suppose therfore that $n > 0$. $f'(x)$ has the same sign as $u(x)=x\cos x - \sin x$.
Since $u'(x)=-x \sin x $ and $\sin(x) $ keeps the same sign on the interval $[n\pi,(n+1) \pi]$, $u$ is strictly monotonic on $[n\pi,(n+1) \pi]$.
We have $u(n\pi) u((n+1)\pi)=-n(n+1)\pi^2 < 0$, so the foncton $u(x)$ (so $f(x)$) vanishes only once by changing the sign on the interval $[n\pi,(n+1)\pi]$. This corresponds to a single extremum for $f$ on $[n \pi,(n+1)\pi]$.
Case $n=0$: Since : $\forall x \in [0,+\infty[ \quad \sin x \leq x $, we have $f(x) \leq 1 =f(0)$ where $x \in[0,\pi]$, and $f(0)$ is the maximum on this interval.