Find a mistake in the following bogus proof

Theorem: The function $f:\mathbb{R} \rightarrow [-10,10]$ defined by $f(x) = \cos(x)+\sin(x)$ for all $x \in \mathbb{R}$ has no maximum or minimum on ($-\infty,+\infty$)

Proof: The function is differentiable on $\mathbb{R}$ so one should be able to find its extrema by setting the derivative to 0. In particular, $$(\sin(x)+\cos(x))' = 0$$ $$\cos(x)-\sin(x) = 0$$ $$\sin(x) = \cos(x)$$ $$\sin(x+\pi/2) = \sin(x)$$ $$x+\pi/2 = x.$$

And the final equation is never true. Yet WolframAlpha disagrees with my conclusions...

• Since $\sin$ isn't injective, you can't conclude $x = y$ from $\sin x = \sin y$. – Daniel Fischer Nov 10 '16 at 13:56
• Note that $\sin \pi=\sin 0=0$ and $\pi\ne 0.$ – mfl Nov 10 '16 at 13:56
• In particular, $\sin(\frac \pi 4+\frac \pi 2)=\sin(\frac \pi 4)$. – Cave Johnson Nov 10 '16 at 13:57
• I don't understand what you mean by "Yet WolframAlpha disagrees." Are you saying WolframAlpha says $x + \pi/2 = x$? – tilper Nov 10 '16 at 14:02
• @JeelShah That's more or less the definition of injectivity. $f \colon A \to B$ is injective if (and only if) $\bigl(f(x) = f(y)\bigr) \implies (x = y)$ for all $x,y\in A$. – Daniel Fischer Nov 10 '16 at 16:32

The problem is that $$\sin(\pi/2 +x) = \sin(x)$$ does not imply that $$x+\pi/2 = x.$$ This would only be true if $\sin$ was one-to-one on the interval considered.

Theorem. Any continuous and periodic function $f:\mathbb{R}\to \mathbb{R}$ achieve their maximum and minimun values infinitely many times.

Proof. Assume that the period is $T>0.$ Now we consider $f:[0,T]\to \mathbb{R}$ the restriction of $f$ to $[0,T].$ Because of Weirstrass theorem (see https://en.wikipedia.org/wiki/Extreme_value_theorem) there exist $c,d\in [0,T]$ such that $f(c)\le f(x)\le f(d),\forall x\in [0,T].$

Now, since $f$ is periodic we have that $f(c)\le f(x)\le f(d),\forall x\in \mathbb{R}.$ Moreover, note that $f(c+kT)=f(c),\forall k\in\mathbb{Z}$ and $f(d+kT)=f(d),\forall k\in\mathbb{Z}.$ QED.

Note $f(x) = \cos(x)+\sin(x)$ satisfies the hypothesis of the above theorem. So it satisfies the thesis.

The problem in your proof is that $\sin$ is not injective. So, from $\sin x=\sin y$ you can't conclude $x=y.$ Note that $\sin 0=\sin\pi=0$ and $0\ne \pi.$

The equation $\sin(x+\pi/2)=\sin(x)$ has solutions $\pi/4$ and $5\pi/4$ in the interval $[0,2\pi]$. More generally, it has solutions $\pi(n-7/4)$, $n\in\mathbb Z$.

From that equality you want to conclude that $x+\pi/2=x$, which has no solution.

Cos (x)=sin (phi/2-x). So compare both. You get 2x=phi/2. x=phi/4. It has maximum value at phi/4. Similarly at x=5phi/4 you get minimum.

• $phi$ (the greek letter "phi") is different from the greek letter $\pi$ ("pi", in english speaking countries often pronounced "pie"). – Henrik Nov 10 '16 at 14:43

Apart from the one outlined in Thomas's answer, there's another mistake in the proof. Consider a function $f(x) = x$ on $[-10; 10]$. It has $$f^\prime(x) = 1 \neq 0$$ everywhere, but it definitely has its maximum at $x=10$ endpoint and its minimum at $x=-10$ endpoint.

• This is not an issue in the presented 'proof' above because the function is defined on the whole of $\mathbb{R}$ – S. Catterall Nov 11 '16 at 14:38

The function is continuous and periodic, so by Bolzano Weierstrass it must have a maximum and a minimum.

• -1 This is not an answer to the question. – JiK Nov 10 '16 at 15:32
• Indeed. I just wanted to point out that the above approach of setting the derivative equal to zero is not always the one you want to use – b00n heT Nov 10 '16 at 15:47
• But the question isn't "how can I prove that this must have extreme points?" The question is "What's wrong with this proof that there are no extreme points?" – Teepeemm Nov 10 '16 at 22:22