How to find the smallest enclosing ellipse around two circles? Given two circles (defined by center and radius), how do I find the smallest ellipse that encloses both of them? I.e. I search the green ellipse in the picture below.

The ellipses can be considered axes aligned if this simplifies things. The end goal is to classify points on whether they are in the ellipse or not. So a final representation suitable to the form used in this question will be preferred.
 A: Join the two centers and extend the line. wherever it cuts the two circles at their outer extremes are the points which are crucial say $A$ and $B$. take the mid point of these two points. for simplicity consider this point as the origin.
now consider an ellipse with the major axis as the line segment $AB$ and call this as $x$-axis. you need to find the minor axis and you are done. the equation of an ellipse is 
$$\frac{x^2}{a^2}+\frac{y^2}{b^2} = 1$$
here $a$ is known and $b$ is to be found. find the radius of the osculating circle of this ellipse at the points $A$ and $B$, which is of course the same numerical value (why?) 
then equate this numerical value to the maximum of the two radii. this will give you an equation in $b$ which you can solve.
A: try and place this on the center of cartesian plane. you will see that equation for the ellipse enclosing is
$$\frac{x^2}{(10+45)^2} + \frac{y^2}{b^2} = 1$$
and the one of the two smaller ellipses that are being enclosed is
$$\frac{(x-10)^2}{45^2} + \frac{(y-0)^2}{40^2} = 1$$
and the other one is 
$$\frac{(x+10)^2}{45^2} + \frac{(y-0)^2}{40^2} = 1$$
Ignore one the second equation (since if it encloses the first one, it will enclose the second)
and now find the intersection between the enclosing ellipse and the enclosed ellipse.
How to find this intersection? just rearrange both equations 1 and 2 till it looks like this $$y^2=...$$
Equate both the equations and try and rearrange till it looks like a quadratic equation with your unknown $b$ as coefficients essentially like this
$$0=()x^2+()x+()$$
with all your $b$'s inside those brackets
now why did we try to find the intersection initially? The reason was to ensure that we only have 1 intersection between the ellipses, located on the x-axis, tangential to each other at the edge.
This condition is set so that if we have more intersections, we know that its not going to enclose, rather cut through the ellipses midway.
How do we express mathematically, through the discriminant and  set =0 so only 1 solution, or intersection.
$$B^2-4AC=0$$
A stands for the stuff within the bracket of$()x^2$
B stands for the stuff within the bracket of$()x$
C stnads for the stuff within the bracket of$()$ at the end
input values and solve for b, now all that's left is putting this into the original equation, and congrats! you have found the solution!
