What is the radius of a circle in a corner of a rectangle which is touching the two sides of the rectangle and an inscribed elipse? Find the radius of the circle in terms of dimension of rectangle ? 
I tried to solve using co-ordinate geometry, slope of tangent, slope of normal. But could not get a solution. If the problem is square and circle it is easy to solve. But for an ellipse and rectangle, the solution becomes complicated. But I am looking for an elegant formula for the radius of circle in-terms of semi major and minor axis of the ellipse.Please help solve the problem 
 A: 
Suppose that the sides of rectangle are $2a$ and $2b$. Radius of the circle is denoted with $r$. Touch point $T$ has coordinates $(p,q)$ and they must satisfy the equation of the ellipse:
$$\frac{p^2}{a^2}+\frac{q^2}{b^2}=1\tag{1}$$
Also, $CT=r$, which translates to:
$$(a-r-p)^2+(b-r-q)^2=r^2\tag{2}$$
The equaiton of the ellipse is:
$$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$$ 
which means that:
$$\frac{x}{a^2}+\frac{yy'}{b^2}=0$$
So the slope of the tangent to the ellipse at any given point is:
$$y'=-\frac{b^2x}{a^2y}$$
...or, at point $T$:
$$y_T'=-\frac{b^2p}{a^2q}$$
Line $CT$ is perpendicular to tangent so the slope of line CT must be $-1/y_T'$. It means that:
$$\frac{b-r-q}{a-r-p}=\frac{a^2q}{b^2p}$$
$$b^2p(b-r-q)=a^2q(a-r-p)\tag{3}$$
Equations (1), (2) and (3) have three unknowns: $p,q,r$.
From this point on you have two choices: 


*

*Try to solve these equations by hand and die along the way.

*Use Mathematica and save a big part of your life for something more entertaining.


There are two trivial solutions, circles with center at $(0,0)$ and radii $a$ and $b$. There are four more solutions, because you can put your small circle in four different corners of the rectangle. Here is the solution for the top-right one:
$$p=\frac{a^{3/2}}{\sqrt{a+b}}$$
$$q=\frac{b^{3/2}}{\sqrt{a+b}}$$
$$r=(a+b+\sqrt{ab})-\frac{a \sqrt{b}+\sqrt{a} b+a^{3/2}+b^{3/2}}{\sqrt{a+b}}$$
If $a=b$ the solution is:
$$p=q=\frac{a\sqrt2}2$$
$$r=a(3-2\sqrt2)$$
