Maximise a rectangle inside a semi-circle.

Where the semicircle has radius of 3 and the rectangle with height x and width y touches the edges of the semicircle.

My thoughts are

Area (rectangle) = [semicircle] - [2 segments]

where the area a segment is $\displaystyle \frac{1}{2}(\theta-\sin\theta)r^2$

$\displaystyle A = \frac{1}{2} \pi \times 3^2 - f(x,y,\theta)$

I need to find where $\displaystyle A' = 0$

and I also think $\displaystyle \tan\frac{\theta}{2} = \frac{y}{2x}$

I have all these relationships yet I can't reduce it to one variable.