Find the equations of the common tangents to the 2 circles:
$$(x - 2)^2 + y^2 = 9$$ and
$$(x - 5)^2 + (y - 4)^2 = 4.$$
I've tried to set the equation to be $y = ax+b$, substitute this into the 2 equations and set the discriminant to zero, we then get a simultaneous quadratic equations. But they are really difficult to solve. So is there any simpler way to do this? Thank you.
You can approach this with homogeneous coordinates. A circle with equation $(x-x_c)^2+(y-y_c)^2 - r^2 = 0$ is represented by a 3x3 matrix as
$$ {\rm Circle}(x_c,y_c,r) = \begin{bmatrix} 1 & 0 & -x_c \\ 0 & 1 & -y_c \\ -x_c & -y_c & x_c^2+y_x^2-r^2 \end{bmatrix} $$
This means that the equation for a circle $C_1 = \begin{bmatrix} 1 & 0 & -2 \\ 0 & 1 & 0 \\ -2 & 0 & -5 \end{bmatrix}$ is given by the quadratic form
$$ P^\top C_1 P = 0 $$ $$ x^2-4 x+y^2-5 = 0 $$
which is the equation for the first circle when expanded out, and $P=\begin{pmatrix} x&y&1 \end{pmatrix} ^\top $ is an arbitrary point.
The second circle is $ C_2 = \begin{bmatrix} 1 & 0 & -5 \\ 0 & 1 & -4 \\ -5 & -4 & 37 \end{bmatrix} $.
Now here is the fun stuff. A line in this notation in general is defined as $L=\begin{vmatrix}a&b&c\end{vmatrix}^\top$ such that the equation of the line is
$$ P^\top L =0 $$ $$ a x+b y+c = 0 $$
Actually $a$, $b$ above designate the direction of the line such that if the line makes an angle $\theta$ with the horizontal then the line is $L=\begin{vmatrix}-\sin\theta&\cos\theta&-d\end{vmatrix}^\top$ and $d$ is the distance of the line to the origin.
We are using the above information to find the lines that are tangent to both circles. A tangent line to the first circle has satisfies the equation
$$ L^\top C_1^{-1} L =0 $$ $$ d = \pm 3 -2 \sin \theta $$
with the two possible line equations
$$ L_A = \begin{vmatrix}-\sin\theta_A&\cos\theta_A &2\sin\theta_A-3\end{vmatrix}^\top $$ $$ L_B = \begin{vmatrix}-\sin\theta_B&\cos\theta_B &2\sin\theta_B+3\end{vmatrix}^\top $$
to find the orientations of these lines $\theta_A$ and $\theta_B$ we have to find the lines that are tangent to the second circle, and match the coefficients
$$ L^\top C_2^{-1} L =0 $$ $$ d = \pm 2 + 4 \cos \theta -5 \sin \theta $$
with also two possible line equations
$$ L_A = \begin{vmatrix}-\sin\theta_A&\cos\theta_A &-4\cos\theta_A+5\sin\theta_A-2\end{vmatrix}^\top $$ $$ L_B = \begin{vmatrix}-\sin\theta_B&\cos\theta_B &-4\cos\theta_B+5\sin\theta_B+2\end{vmatrix}^\top $$
Setting $L_A=L_A$ and solving for $\theta_A$ yields the following
$$ 2\sin\theta_A-3 = -4\cos\theta_A+5\sin\theta_A-2 $$ $$ 4\cos\theta_A-3\sin\theta_A =1 $$ $$ \sin\theta_A = \frac{8\sqrt{6}-3}{25} $$
with the solution
$$ L_A = \begin{vmatrix} \frac{3-8\sqrt{6}}{25} & \frac{4+6\sqrt{6}}{25} & \frac{16 \sqrt{6}-81}{25} \end{vmatrix} $$ $$ \left( \frac{3-8\sqrt{6}}{25}\right) x + \left(\frac{4+6\sqrt{6}}{25}\right) y + \left(\frac{16 \sqrt{6}-81}{25}\right) = 0 $$ $$ -0.664 x + 0.7479 y - 1.6723 = 0 $$
Similarly with $L_B=L_B$ yielding $4\cos\theta_B-3\sin\theta_B=-1$ or
$$ L_B = \begin{vmatrix} -\frac{3+8\sqrt{6}}{25} & \frac{6\sqrt{6}-4}{25} & \frac{16 \sqrt{6}+81}{25} \end{vmatrix} $$ $$ -\left(\frac{3+8\sqrt{6}}{25}\right) x + \left(\frac{6\sqrt{6}-4}{25}\right) y + \left(\frac{16 \sqrt{6}+81}{25}\right) = 0 $$ $$ -0.904 x + 0.4278 y + 4.808 = 0 $$
Here are the results plotted in GeoGebra for validation.