Find the area of the largest rectangle that can be inscribed in a semi-circle
    circle of radius $r$.
        \begin{scope}[ultra thick]
          \draw[cgreen] plot[smooth,domain=-3:3,samples=100] function{sqrt(9-x**2)};
          \draw[cred] (-2,0) rectangle (2,{pow(9-2*2,.5)});
          \node[include=cred] (a) at (2,{pow(9-2*2,.5)}) {};
          \node[anchor=south west] at (a) {$(x,y)$};
      Introducing notation:
        \item let $(x,y)$ be the upper right corner of the rectangle
        \item let $A$ be the area
    The area is \quad
      A(x) = \mpause[1]{2xy} \mpause[2]{= 2x\sqrt{r^2-x^2}} \mpause[3]{\quad\quad\text{for $x$ in $[\mpause[4]{0},\mpause[4]{r}]$}}
    $A$ is continuous on $[0,r]$, we use the Closed Interval Method:\vspace{-.7ex}
      A'(x) &= \mpause[1]{ 2\sqrt{r^2-x^2} + \frac{2x}{2\sqrt{r^2-x^2}}(-2x) }
       \mpause{= \frac{2(r^2-2x^2)}{\sqrt{r^2-x^2}} } \\[-.5ex]
     \mpause{A'(x) &= 0 \;\iff\; }\mpause{x^2 = r^2/2} \mpause{\stackrel{x\ge 0}{\iff} x = r/\sqrt{2}}
    Note that $A(0) = \mpause[1]{0}$ and $A(r) = \mpause[1]{0}$. \pause\pause Thus the \alert{maximum area} is:\vspace{-.7ex}
      \alert{A(r/\sqrt{2}) =} \mpause[1]{ 2\frac{r}{\sqrt{2}}\sqrt{r^2 - \frac{r^2}{\sqrt{2}^2}} } 
      \mpause[2]{ = \sqrt{2}r\sqrt{\frac{r^2}{2}} } 
      \mpause[3]{ = \alert{r^2} }