$\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?
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.