Extrema of ellipse from parametric form I'm trying to derive a formula to determine a tight bounding box for an ellipse. This is trivial for non-rotated ellipses, but I'm having trouble figuring out how to compute bounds for ellipses that have been rotated about their center.
Consider an ellipse $E$ centered at the origin with $x$ and $y$ radii $r_x$ and $r_y$ respectively. Then a point on $E$ is given by the parametric coordinate pair $\left[\begin{matrix}r_x \cos t \\ r_y \sin t\end{matrix}\right]$ for $t \in [0, 2\pi]$.
Suppose we rotate $E$ about the origin by $\theta$ radians. Then a point on $E$ has the coordinates $$\left[ \begin{matrix} x(t) \\ y(t) \end{matrix} \right] = \left[\begin{matrix}r_x \cos \theta \cos t - r_y \sin \theta \sin t \\ r_x \sin \theta \cos t + r_y \cos \theta \sin t \end{matrix}\right]$$
My approach to determine extrema was to consider each coordinate separately, take the derivative and set it equal to zero. For instance, we have $$x'(t) = -r_x \cos \theta \sin t - r_y \sin \theta \cos t$$
and setting $x'(t) = 0$ yields:
$$
\begin{align}
-r_x \cos \theta \sin t - r_y \sin \theta \cos t &= 0 \\
-r_x \cos \theta \sin t &= r_y \sin \theta \cos t \\
\tan t &= -\frac{r_y \sin \theta}{r_x \cos \theta}
\end{align}
$$
I don't know how to go from this equation to the actual extreme values of $x$ for the rotated ellipse. I'm assuming it's something easy that I've just forgotten how to do.
Edit: I'm looking for tight axis-aligned bounds. Rotating the bounds of a non-rotated ellipse and then computing axis-aligned bounds of the rotated bounding box doesn't result in tight bounds. Here is a diagram to illustrate:

 A: You're basically done: all you need to do is solve for your values of $t$, and substitute them into your $x(t)$ to obtain your extreme $x$ values:
$$t = \tan^{-1} \left(-\frac{r_y \sin \theta}{r_x \cos \theta}\right)$$
However, $\tan^{-1}$ has an infinite number of solutions of the form $t + \pi n$, for $n \in \mathbb{Z}$. This set of solutions can be divided into two sets: $A$, which contains values of the form $t + 2 \pi n$ and $B$, which contains values of the form $t + \pi + 2 \pi n$.
The only part you need to be careful of is to take one value of each of $A$ and $B$. One of these two sets of solutions will correspond to the lower extreme, and the other will correspond to the upper extreme.
If you want to know which set of values of $t$ corresponds to the minimum or maximum, you could use the second derivative test to find out.
A: 
By $$A\cos t+B\sin t= \sqrt{A^2+B^2} \sin (t+\phi)$$

The dimensions of the rectangle are
$$2\sqrt{r_x^2\cos^2 \theta+r_y^2\sin^2 \theta} \times
  2\sqrt{r_x^2\sin^2 \theta+r_y^2\cos^2 \theta}$$
See the animation below:

A: An alternative approach would be to consider the ellipse as fixed, and rotate the rectangle clockwise by angle $\theta$ so that the sides are tangential to the ellipse.
Let $m=\tan\theta$ so that the equation of one of the sides of the rectangle is $$y=-mx+c_1$$
Let the equation of a neighbouring side be $$y=\frac xm+c_2$$
Using the standard formula for the distance of a point to a line, considering the distances from the origin, the area of the bounding rectangle is $$4\times\frac{c_1}{\sqrt{1+m^2}}\times\frac{c_2}{\sqrt{1+\frac{1}{m^2}}}=\frac{4mc_1c_2}{1+m^2}$$
Now considering the standard ellipse $$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$$
The first line is tangent to the ellipse provided that, when solved simultaneously with the ellipse, the resulting quadratic has double roots.
After a couple of lines of algebra, we arrive at the condition $$a^2m^2=c_1^2-b^2\Rightarrow c_1=\sqrt{a^2m^2+b^2}$$
By similar argument we likewise obtain $$c_2=\sqrt{\frac{a^2}{m^2}+b^2}$$
Substituting these into the above expression for the area of the bounding rectangle, we end up with the formula$$\frac{4\sqrt{a^2m^2+b^2}\sqrt{a^2+m^2b^2}}{
1+m^2}$$
