Rectangle in a circle of radius a that maximizes x^n+ y^n 
Consider a rectangle with sides $2x$ and $2y$ inscribed in a given fixed circle $$x^2 + y^2 = a^2,$$ and let $n$ be a positive number. We wish to find the rectangle that maximizes the quantity $$z = x^n + y^n.$$ If $n = 2$, it is clear that $z$ has the constant value $a^2$ for all rectangles.

*

*If $n < 2$, show that the square maximizes $z$; and

*if $n > 2$, show that $z$ is maximized by a degenerate rectangle in which $x$ or $y$ is $0$.


My approach.
$$x^2 + y^2 = a^2$$
$$\therefore\, y = (a^2 - x^2)^{1\over 2}$$
\begin{align}
z &= x^n + y^n \\
{d\over dx}z & = nx^{n-1} - nx(a^2-x^2)^{n-2\over 2}
\end{align}
Equating with $0$ gives:
$$nx^{n-1} = nx(a^2-x^2)^{n-2\over 2}$$
$$x^{n-2} = (a^2 - x^2)^{n-2\over 2}$$
Squaring on both sides gives:
$$(x^2)^{n-2} = (a^2 - x^2)^{n-2}$$
Taking $\ln$ on both sides gives
$$(n-2) \ln(x^2) = (n-2)\ln(a^2 - x^2)$$33
Equating $x^2 = a^2 - x^2$ , we get $x = {a\over \sqrt{2}}$ and $y = {a\over\sqrt{2}}$. In particular $x=y$ implies that the optimal rectange is a square.
My computation appears to be independent of $n$, so I am puzzled about the statement in the question for $n>2$ and $n<2$.

Alternative way, without calculus.

*

*If $\,n \le 2\,$ then by the generalized means inequality $\,\left(\frac{x^n+y^n}{2}\right)^{1/n} \le \left(\frac{x^2+y^2}{2}\right)^{1/2}=\frac{a}{\sqrt{2}}\,$. The maximum is attained when the equality is achieved, for $\,x=y\,$ i.e. the square.


*If $\,n \gt 2\,$ then $\,x^n+y^n=(x^2)^{n/2}+(y^2)^{n/2} \le (x^2+y^2)^{n/2} = a^n\,$ with equality for $\,x=0\,$ or $\,y=0\,$, since $\,x^2/a^2, \,y^2/a^2 \le 1\,$ so $\,(x^2/a^2)^{n/2}+(y^2/a^2)^{n/2} \le x^2/a^2+y^2/a^2 = 1\,$.
