I'm trying to find the equation of a line that passes through some point $(x_1,y_1)$ and lies tangent to an ellipse. There are two solutions in most cases. My work starts with the equation of a line $y-y_1 = m(x-x_1)$. The slope of the line, $m$, will be $$\frac{y_1 - f(x)}{x_1-x} = f'(x)$$Normally I could substitute the equation of the curve in for $f(x)$ and $f'(x)$ and after some sweat, tears and algebra, solve for $x$, which can then easily be used to solve for all other information I need.
However, ellipses are a pain to work with, especially in $f(x)=$ form, which I would need to use for this method. Even using wolfram alpha, the general solution for x is so extremely long and complicated that it's basically useless to me.
Ellipses can be much more simply expressed in parametric form, so I tried the same approach using parametric equations $y(t)$ and $x(t)$, but I ended up with $t \sin t = \cdots$ which isn't solvable conventionally and ended up being equally as useless.
My final idea was set the equation of the line equal to the ellipse. $$m(x-x_1) + y_1 = \sqrt{b^2 \left( 1-\frac{(x-h)^2}{a^2} \right)}+k$$The tangent line touches the ellipse, not intersects it, in other words it only has one point of equality with the ellipse. So I would somehow need to find the two values of $m$ that gives one point of equality instead of two, also a potentially painful and time-consuming process which I don't know how to do. Is there a better way to solve this? If this last method is the most viable solution, how would I go about this?


The equation of your ellipse appears to be $$ \frac{(x-h)^2}{a^2} + \frac{(y-k)^2}{k^2} = 1. $$ For now I will assume the center $(h,k)$ is $(0,0)$ and then later we can adjust the answer for other centers. Thus we have $$ \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1. \tag 1 $$
Your point $(x_1,y_1)$ must lie outside the ellipse in order to be on a tangent line.
One way of solving this problem involves no derivatives: You need a straight line that passes through $(x_1,y_1)$ and touches the ellipse at just one point. Suppose the equation of the line is $$ y-y_1 = m(x-x_1). \tag 2 $$ You want a point $(x,y)$ that satisfies both $(1)$ and $(2),$ and you need to choose $m$ so that there is only one such point. Solving $(2)$ for $y$ gives $y=m(x-x_1)+y_1.$ Substituting this for $y$ in $(1),$ you get $$ \frac{x^2}{a^2} + \frac{(m(x-x_1)+y_1)^2}{b^2} = 1 $$ $$ \frac{x^2}{a^2} + \frac{m^2x^2 + m^2 x_1^2 + y_1^2 - 2m^2 x_1 x + 2my_1 x - 2mx_1 y_1}{b^2} = 1 $$ $$ \left( \frac 1 {a^2} + \frac{m^2}{b^2} \right) x^2 + \left( \frac{2m(y_1-mx_1)}{b^2} \right) x + \frac{m^2 x_1^2 + y_1^2 - 2mx_1 y_1}{b^2} = 1 $$ $$ A x^2 + Bx + C = 0 $$ (Capital $A$ and $B$ should not be confused with lower-case $a$ and $b$.)
Now the problem is to choose the value of $m$ so as to make $B^2-4AC=0$ so that this quadratic equation will have only one solution.
(You should of course get two such values of $m$, as you can see if you draw the picture. Unless the point $(x_1,y_1)$ is actually on the curve, in which case there will be just one.)