<s>[INST] Find the area of largest rectangle that can be inscribed in an ellipse The actual problem reads: 

Find the area of the largest rectangle that can be inscribed in the ellipse 
  $$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1.$$

I got as far as coming up with the equation for the area to be $A=4xy$ but then when trying to find the derivative I don't think I'm doing it right. 
 [/INST] let L and H be the length and breadth of the required rectangle respectively
$$\frac{(L/2)^2}{a^2}+\frac{(H/2)^2}{b^2}=1$$
$$\frac{(L)^2}{4a^2}+\frac{(H)^2}{4b^2}=1$$
$$H=\frac{b}{a}\sqrt{4a^2-L^2}$$
Area=L*H
$$A= L*\frac{b}{a}\sqrt{4a^2-L^2}$$
$$\frac{dA}{dL} =\frac{b}{a}\sqrt{4a^2-L^2}-\frac{L^2b}{a\sqrt{4a^2-L^2}}=0$$
$$\frac{b*(4a^2-2L^2)}{a\sqrt{4a^2-L^2}}$$
$$=> 4a^2-2L^2=0$$
$$=2a^2=L^2$$
$$L=a\sqrt{2}$$
$$H=b\sqrt{2}$$
$$Area=L*H=2ab$$
$$\frac{d^2A}{dL^2}=\frac{\sqrt{4a^2-L^2}*(-4L)-\frac{4a^2-2L^2}{2\sqrt{4a^2-L^2}}}{4a^2-L^2}$$
Putting L=$a\sqrt{2}$
$$\frac{d^2A}{dL^2}=\frac{-a\sqrt{2}(4a\sqrt{2})-\frac{0}{2\sqrt{4a^2-2a^2}}}{4a^2-2a^2}$$
$$=\frac{-8a^2}{2a^2}$$
-4<0.
Therefore the area is max
</s>