Common tangent to two circles 
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.

The parametric equation of $(x-a)^2+(y-b)^2=r^2$ is $(x=a+r\cos C,y=b+r\sin C)$
Let $$\frac{y-(b+r\sin C)}{x-(a+r\cos C)}=m$$ be a tangent at $(a+r\cos C,b+r\sin C)$, then the distance of line from the center is equal to the radius.
$$r=\frac{\mid m(a-a-r\cos C)-b+b+r\sin C\mid}{\sqrt{m^2+1}}=\frac{r\mid\sin C-m\cos C\mid}{\sqrt{m^2+1}}$$
$m^2+1=(\sin C-m\cos C)^2$
$\implies (m\sin C+\cos C)^2=0\implies m=-\frac{\cos C}{\sin C}$
So, the equation of the tangent becomes 
$$\frac{y-(b+r\sin C)}{x-(a+r\cos C)}=-\frac{\cos C}{\sin C}$$
$x\cos C+y\sin C-a\cos C-b\sin C -r=0$ (this can also be reached using calculus)
For $(x-2)^2+y^2=9,a=2,b=0,r=3$
So, equation of the tangent will be    $x\cos A+y\sin A-2\cos A -3=0$
For $(x-5)^2+(y-4)^2=4,a=5,b=4,r=2$
So, equation of the tangent will be   $x\cos B+y\sin B-5\cos B-4\sin B -2=0$
For common tangent, these two lines must be same,
So, $$\frac{\cos A}{\cos  B}=\frac{\sin A}{\sin  B}=\frac{2\cos A+3}{5\cos B+4\sin B+2}$$ 
$\frac{\cos A}{\cos  B}=\frac{\sin A}{\sin  B}\implies \sin(A-B)=0$
$\implies A=B$ or $A=\pi+B$
(1)If $A=B,1=\frac{2\cos B+3}{5\cos B+4\sin B+2}\implies 4\sin B+3\cos B=1$
(2)If $A=\pi+B,\cos A=\cos(\pi+B)=-\cos B, -1=\frac{-2\cos B+3}{5\cos B+4\sin B+2}$
For (1), $4\sin B+3\cos B=1$
Putting $4=R\sin D,3=R\cos D\implies R=5,D=cos^{-1}\frac 3 5,$
$\cos(B-D)=\frac 1 5, B-\cos^{-1}\frac 3 5 =2n\pi \pm \cos^{-1}\frac 1 5$ where $n$ is any integer.
$\cos B=\frac{3 \pm 8\sqrt{6}}{25},\sin B$ can be calculated uniquely using (1). 
So, there will be two tangent in this case.
For(2)  $ 3\cos B+4\sin B=-5$
Applying the same approach like in (1), 
$\cos(B-\cos^{-1}\frac 3 5)=-1=\cos \pi, B=\cos^{-1}\frac 3 5+\pi$
$\cos B=\cos(\cos^{-1}\frac 3 5+\pi)=-\cos(\cos^{-1}\frac 3 5)=-\frac 3 5$
$\sin B$ becomes $-\frac 4 5$
So, the tangent becomes,  $(x-5)(-\frac 3 5)+(y-4)(-\frac 4 5) -2=0$
