Question : Given a curve $$\mathcal{S} :\ ax^2+by^2+2hxy+2gx+2fy+c=0$$ and point $P(x_1,y_1)$ which is not on the curve, basically an 'external' point, find a line passing through $P$ such that it is tangent to the curve at a point . Also find the point(s) of tangency.
My Attempt :
Let the line be $$\mathcal{L}:\ \frac{y-y_1}{x-x_1}=m$$ Let the point of tangency by $(x_0,y_0)$, then differentiating the curve $$d\mathcal{S} :\ ax\ dx+by\ dy+hy\ dx+hx\ dy+ g\ dx + f\ dy =0 $$ $$\implies \frac{dy}{dx}=-\frac{ax+hy+g}{by+hx+f}$$ So slope at point of tangency or $m$ will be $$m =-\frac{ax_0+hy_0+g}{by_0+hx_0+f}$$ So we get the line as $$\mathcal{L}:\ \frac{y-y_1}{x-x_1}=-\frac{ax_0+hy_0+g}{by_0+hx_0+f}$$ $$ax_0(x-x_1)+by_0(y-y_1)+g(x-x_1)+f(y-y_1)+h(xy_0+x_0y-x_0y_1-x_1y_0)=0$$ and as $\mathcal{S}(x_0,y_0)=0$, we get $$ax_0^2+by_0^2+2hx_0y_0+2gx_0+2fy_0+c=0$$ Now what to do? How to get the points $(x_0,y_0)$?
Hint.
Calling $p=(x,y)'$ we can represent the conic as
$$ p'\left(\matrix{a& h\\ h& b}\right)p+2\left(g\ \ f\right)p+c=0 $$
or
$$ p'Mp+2Np+c=0 $$
now considering the line passing by $p_0 = (x_0,y_0)'$ and direction $\vec v =(v_x,v_y)'$ as
$$ p = p_0+\lambda \vec v $$
after substitution into the conic we have
$$ p_0'Mp_0+2p_0'M\vec v\lambda+\vec v'M\vec v\lambda^2+2Np_0+2N\vec v\lambda + c=0 $$
now solving for $\lambda$
$$ \lambda = \frac{(p_0'M+Np_0)\vec v\pm\sqrt{((p_0'M+Np_0)\vec v)^2-v'M\vec v(p_0'Mp_0+2Np_0+c)}}{\vec v'M\vec v} $$
As the line should be tangent we need
$$ ((p_0'M+Np_0)\vec v)^2-v'M\vec v(p_0'Mp_0+2Np_0+c)=0 $$
Now solving
$$ \cases{ ((p_0'M+Np_0)\vec v)^2-v'M\vec v(p_0'Mp_0+2Np_0+c)=0\\ \|\vec v\|=1 } $$
two equations and two unknowns, we are done.