Determine angular coordinate of contact point between a rotated ellipse and its tangent $\newcommand{\eps}{\epsilon}$I tried to illustrate the problem in the picture below. An ellipse is rotated by the angle $\alpha$. Since the distance $L$ is given, the tangent to the ellipse can be determined. The angular coordinate $\beta$ is used to describe the tangent point. $\beta$ is measured from the the body-fixed $x$-axis of the ellipse. 

For further calculations I want to determine $\frac{d\beta}{d\alpha}$. Therefore I tried to calculate $\beta = f(\alpha)$ or at least $\cos(\beta) = f(\alpha)$ and $\sin(\beta) = f(\alpha)$.
My approach is to solve the following equation $-y \frac{dx}{d \beta}+x \frac{dy}{d \beta}=0$, where $x = L + r\cos(\beta+\alpha)$ and $y = r \sin(\beta+\alpha)$. $(x,y)$ is the tangent point. The equation follows from the scalar product of $(\frac{dx}{d \beta},\frac{dy}{d \beta})$ and the vector between $0$ and $(x,y)$ rotated by $90°$. I simplified the equation using Mathematica to:
$$
(-1 + \eps^2) L \cos(\alpha)\cos(\beta) - b \sqrt{1 - \eps^2 \cos(\beta)^2} + L \sin(\alpha)\sin(\beta) = 0,
$$
where $\eps$ is the numerical eccentricity of the ellipse. 
However, the solution Mathematica provides to this equation is not practical, since I have to do a case distinction. I feel like that my approach uses too much calculus and a different approach would simplify the solution.
Summarizing: What is $\beta = f(\alpha)$, when the parameters $a$ and $b$ of the ellipse are given?
 A: Say you have an ellipse $Ax^2+Bxy+Cy^2+Dx+Ey+F=0$ and you want to find points of tangent to the origin.  The tangent line is generally $y=mx$.  Eliminating $y$ between these two equations resulrs in the following quadratic equation for $x$:
$(Cm^2+Bm+A)x^2+(Em+D)x+F=0$
The condition for tangent is that this should have a double root for $x$ meaning the discriminant of the quadratic equation should be zero.  This leads to a quadratic equation for $m$:
$(E^2-4CF)m^2+(2DE-4BF)m+(D^2-4AF)=0$
Note that if $E^2=4CF$ one root for $m$ goes to infinity meaning one tangent line is the $y$ axis.  Otherwise, in general there are two roots for $m$ from which the tangent lines can be determined, provided that $A, C, F$ all have the same sign.
A: I think you made an error somewhere, because I used exactly the same method but came up with a different result:
$$
\cos\beta={ac(\alpha)\over\sqrt{a^2c^2(\alpha)+b^2s^2(\alpha)}},
\quad
\sin\beta={bs(\alpha)\over\sqrt{a^2c^2(\alpha)+b^2s^2(\alpha)}}.
$$
where:
$$
c(\alpha)=\frac{a \sin\alpha 
\sqrt{a^2 \sin ^2\alpha+b^2 \cos ^2\alpha -{a^2 b^2/L^2}}
-{a b^2 \cos\alpha}/{L}}{a^2 \sin ^2\alpha +b^2 \cos ^2\alpha}
$$
and
$$
s(\alpha)=\frac{b \cos\alpha 
\sqrt{a^2 \sin ^2\alpha+b^2 \cos ^2\alpha -{a^2 b^2/L^2}}
+{a^2 b \sin\alpha}/{L}}{a^2 \sin ^2\alpha+b^2\cos^2\alpha}.
$$
To get there, I started with parametric equations for a point on the ellipse:
$$
\tag{1}
r\cos\beta=a\cos t,\quad r\sin\beta=b\sin t,
$$
and the corresponding cartesian equations:
$$
x=r\cos(\alpha+\beta)=a\cos\alpha\cos t-b\sin\alpha\sin t,\\
y=r\sin(\alpha+\beta)=a\sin\alpha\cos t+b\cos\alpha\sin t.
$$
Imposing the scalar product between $(L+x, y)$ and $(\dot y,-\dot x)$ to vanish (dot indicates derivative with respect to $t$) one gets the simple equation
$$
b\cos\alpha\cos t-a\sin\alpha\sin t =-{ab\over L},
$$
which can be solved for $\cos t$ and $\sin t$. Then we can express $\cos\beta$ and $\sin\beta$ in terms of $t$, using $(1)$, and substitute there the solutions thus found:
$$
\cos\beta={a\cos t\over\sqrt{a^2\cos^2t+b^2\sin^2t}},
\quad
\sin\beta={b\sin t\over\sqrt{a^2\cos^2t+b^2\sin^2t}}.
$$
As a check, I plotted $\beta$, taken from the formula for $\cos\beta$, as a function of $\alpha$ (for $a=2$, $b=1$, $L=5$), and then with GeoGebra made the same plot as computed by the software itself (see picture). The two graphs turn out to be identical.

EDIT.
Notice that in GeoGebra (and in my formula, due to the presence of $\arccos$) I forced $0\le\beta\le\pi$. If $\alpha_0$ is the point where $\beta=0$, for $\alpha>\alpha_0$ point $H$ in the diagram is to the right of $B$, so it could be advisable to allow $\beta<0$ there. 
If you want to do that, you simply have to replace $\beta$ as given by formula above with $-\beta$ for all $\alpha_0<\alpha<\alpha_\pi$, where $\alpha_\pi$ is the point where $\beta=\pi$. To ensure continuity you should also substitute $\beta$ with $\beta-2\pi$ for $\alpha>\alpha_\pi$. In doing so, kinks at $\alpha_0$ and $\alpha_\pi$ do disappear and the curve turns out to be smooth.
A: It seemed to me that it might be easier to rotate the point instead of the ellipse. Let the ellipse be in standard position with half-axis lengths $a$ and $b$, and let $P=(L\cos\theta,L\sin\theta)$ be the point from which the tangents are drawn. (I’m using $\theta$ instead of $\alpha$ to avoid confusion in the formulas below.) Using the result from here or via the method described here for finding the intersection of the ellipse and the polar line to $P$ we have the following points at which the tangents through $P$ intersect the ellipse $$\left({a^2\left(b^2\cos\theta\mp\sin\theta\sqrt{L^2b^2\cos^2\theta+L^2a^2\sin^2\theta-a^2b^2}\right) \over L(b^2\cos^2\theta+a^2\sin^2\theta)},{b^2\left(a^2\sin^2\theta\pm\cos\theta\sqrt{L^2b^2\cos^2\theta+L^2a^2\sin^2\theta-a^2b^2}\right) \over L(b^2\cos^2\theta+a^2\sin^2\theta)}\right)$$ The first of these points in the one in the upper half-plane when $\theta=0$, as per your diagram. Using that tangent point, we have $$\tan\beta=-{b^2\left(a^2\sin^2\theta+\cos\theta\sqrt{L^2b^2\cos^2\theta+L^2a^2\sin^2\theta-a^2b^2}\right) \over a^2\left(b^2\cos\theta-\sin\theta\sqrt{L^2b^2\cos^2\theta+L^2a^2\sin^2\theta-a^2b^2}\right)}.$$  
