Solve $\cos^{n}x-\sin^{n}x=1$ with $n\in \mathbb{N}$.

We consider the $2\pi$-periodic function $$f(x):=\cos^n x-\sin^n x$$ and determine its stationary points in $[0,2\pi[\ $. One gets $$f'(x)=-n\cos x\sin x\bigl(\cos^{n-2}x+\sin^{n-2}x\bigr)\ ;$$ therefore the stationary points are the multiples of ${\pi\over2}$, and for odd $n>2$ the points where $\cos x=-\sin x$, i.e., the points ${3\pi\over4}$ and ${7\pi\over4}$. In these points one has the values $$f(0)=1, \quad f({\pi\over2})=-1,\quad f(\pi)=(-1)^n,\quad f({3\pi\over2})=(-1)^{n-1}\ ,$$ furthermore for $n=2m+1$ the values $$f({3\pi\over4})=-{\sqrt{2}\over 2^m}, \quad f({7\pi\over4})={\sqrt{2}\over 2^m}<1\ .$$ It follows that the global maximal value of $f$ is $1$. This value is taken at $0$ and $\pi$ if $n$ is even, and at $0$ and ${3\pi\over2}$ if $n$ is odd.


Hint:

For all $n$, when $\cos(x)=1$, $\sin(x)=0$.

For even $n$, when $\cos(x)=-1$, $\sin(x)=0$.

For odd $n$, when $\sin(x)=-1$, $\cos(x)=0$.