Q. Find the area of the greatest rectangle that can be inscribed in the ellipse.
$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1\tag1$$
Before anyone says, I have already seen the previously posted queries. Link: Find the area of largest rectangle that can be inscribed in an ellipse
During my initial attempts, I tried to calculate the area for the rectangle in the first quadrant and multiplied it by 4.
Thus $$\text{Area} = 4(a-x)(b-y).\tag2$$
where a and b are the major and minor axes(interchangeable) which are subtracted from variables x and y, respectively.
I then substituted y from (1) in (2)
$$\text{Area}(A) = (4)(b - \frac{b}{a}\sqrt{a^2-x^2})(x-a)$$
I then took the derivative of $A$ and equated it to $0$ giving $x = a/\sqrt2$ and $y = b/\sqrt2$.
I then took the second order derivative of $A$ which gives a negative value. Thus, A is maximum at $x =a/\sqrt2$.
The issue occurs when I substituted the previously found $x$ and $y$ values in (2). I get $A = 2ab(\sqrt2 - 1)$.
I just need clarification whether this approach is viable or not. If yes, where did I go wrong.