Maximizing Area of two squares in a circle I'm trying to come up with the following geometry (potentially calculus) question:
Q: Let $A(P)$ denote the area of a polygon. Two squares $S_1$ and $S_2$ are drawn inside the unit circle $C_1$ in such a way that that $A(S_1+S_2)$ is maximized. Find the value of $A(S_1+S_2)$.
My attempt:
Consider the problem with one square, the maximum area of one square would simply be the area of an inscribed square. meaning a square with a side length $l=\sqrt{2}r$. Since the circle has $r=1$, the square has a value of 2. 
So I thought in order to find max($A(S_1+S_2)$), we can first consider the unit circle with an inscribed square, then "add in" the second square like such: 

However, I'm struggling to first find the area of $S_2$, then proving that this configuration is indeed the best configuration to maximize $A(S_1+S_2)$. I've tried tackling this with calculus as well, but to no avail. 
 A: 
We consider the general case shown in $\bf{Fig. 1}$. Use the triangle $OQC$ to obtain $OC$ and $OA$.
$$OC=\frac{\sqrt{4 r^2-h^2}}{2},\space\space\space\space\therefore\space\space OA=AC-OC=s+h-\frac{\sqrt{4 r^2-h^2}}{2}.$$
Apply Pythagorean theorem to the triangle $OPA$ to express $s$ in terms of $r$ and $h$.
$$r^2=\left(\frac{s}{2}\right)^2+\left(s+h-\frac{\sqrt{4r^2-h^2}}{2}\right)\space\to\space s=\frac{4\sqrt{4 r^2-h^2}-3 h}{5} $$
The required area is given by,
$$A(S_1+S_2)=h^2+s^2=\frac{2}{25}\left(32 r^2+9 h^2-12 h\sqrt{4 r^2-h^2}\right)\tag{1}$$.
Now, we go on to find the minima ans maxima of (1) by equating its first derivative to zero.
$$\frac{d}{dh}\left(A\left(S_1+S_2\right)\right)=3 h\sqrt{4 r^2-h^2}-2\left(4 r^2-h^2 \right)+2 h^2=0$$
To make thing easy, we let $y=\sqrt{4 r^2-h^2}$ and obtain,
$$3 h y-2 y^2+2 h^2=\left(2 h-y\right)\left(h+2 y\right)=0.$$
From this, it is obvious that $y$ has only one acceptable value, i.e.
 $$h=\frac{y}{2}=\frac{\sqrt{4 r^2-h^2}}{2}.$$
This can be solved to find the $y$ value, for which the $A\left(S_1+S_2\right)$ has an extremum.
$$h=\frac{2}{\sqrt{5}}r$$
Now we need the second derivative of (1) to determine what kind of extremum this is. The 2nd derivative is,
$$8h\sqrt{4 r^2-h^2}+12 r^2-6h^2.\tag{2}$$
When we substitute $\frac{2}{\sqrt{5}}r$ for $h$ in (2), we get,
$$\frac{64}{5}r^2+12 r^2-\frac{24}{5}r^2=20 r^2\ge 0.$$
Therefore, the value of $h$ we obtained above corresponds to a minimum of  $A\left(S_1+S_2\right)$ and not to a maximum. This is most unfortunate, but then that is how life works. Now we have to show that (1) is monotonic. We do this by more arguing than calculating. But first, we need to know the minimum and maximum possible values of $h$. According to $\bf{Fig. 3}$ and $\bf{Fig. 2}$, maximum and minimum possible values of $h$ are $\sqrt{2}r$ and $\frac{2}{\sqrt{5}}r$ respectively.  
We have seen that the minimum value of $A\left(S_1+S_2\right)$ corresponds to the minimum value of $h$. As per this and in the absence of any other local extrema, the value of $A\left(S_1+S_2\right)$, as a function, increases monotonically without an upper bound as the value of $h$ increases. However, $h$ has an upper bound equal to $\sqrt{2}r$. This also means that the maximum value of $A\left(S_1+S_2\right)$, as an area, occurs when $h$ has its maximum possible value.
$$\therefore\space\space\space A\left(S_1+S_2\right)_{\rm max}=\frac{52}{25}r^2\approx 2.08 r^2.$$ 
