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$.

${d\over dx}z$ =
$nx^{n-1}$ - $nx(a^2-x^2)^{n-2\over 2}$
Equating with $0$ gives
$x= {a\over \sqrt {2}}$ so, $y =  {a\over \sqrt {2}}$
and $x= 0$ so, $y = a$
Now on double differentiating z
${d^2\over dx^2}z$ = $n(n-1)x^{n-2} - n(a^2 - x^2)^{n-2\over 2} + n(n-2)x^2(a^2 - x^2)^{n-4\over 2}$
At $x= {a\over \sqrt {2}}$,
${d^2\over dx^2}z$ simplifies to be $2n(n-2)({a^2\over 2})^{n-2\over 2}$
So, if $n<2$,
${d^2\over dx^2}z$ At $x= {a\over \sqrt {2}}$ is < $0$
So, at $x= {a\over \sqrt {2}}$, Z = maximum when $n<2$ and minimum when $n>2$
When $ n < 2$
At $x =0$ ${d^2\over dx^2}z$ is undefined due to the term $n(n-1)x^{n - 2}$ = $n(n-1)$$({1\over 0})^{2 - n}$
When n>2
At $x = 0$
${d^2\over dx^2}z$ simplifies to be $-n(a^2)^{n-2\over 2}$ which is $< 0$ as $n > 0$
So $z$ is maximum at $x = 0$
This shows that when $n<2$ maximum value of $z$ occurs when $x = y = {a\over \sqrt {2}}$ thus a square
When $n= 2$, $z$ simply equates to $a^2$
When n > 2 $z$ is maximum when $x = 0$ , $y = a$ and since $x$ and $y$ are symmetric so they are interchangeable this means z is also maximum when $x = a$ , $y = 0$
and thus it is a degenerate rectangle which gives maximum value of $z$ when $n>2$
