Equation of the line that lies tangent to both circles Consider the two circles determined by $(x-1)^2 + y^2 = 1$ and $(x-2.5)^2 + y^2 = (1/2)^2$. Find the (explicit) equation of the line that lies tangent to both circles.

I have never seen a clean or clever solution to this problem. This problem came up once at a staff meeting for a tutoring center I worked at during undergrad. I recall my roommate and I - after a good amount of time symbol pushing - were able to visibly see a solution by inspection, then verify it by plugging in. I have never seen a solid derivation of a solution to this though, so I would like to see what MSE can come up with for this!

I took a short stab at it today before posting, and got that it would be determined by the solution to the equation $$\left( \frac{\cos(\theta)}{\sin(\theta)} + 2\cos(\theta) + 3 \right)^2 -4\left( \frac{\cos(\theta)^2}{\sin(\theta)^2}+1 \right)\left(\frac{-\cos(\theta)^3}{\sin(\theta)^2}+\frac{\cos(\theta)^4}{\sin(\theta)^2}+3 \right).$$
The solution $\theta$ would then determine the line $$y(x) = \frac{-\cos(\theta)}{\sin(\theta)}(x) + \frac{\cos(\theta)^2}{\sin(\theta)} + \sin(\theta).$$
Not only do I not want to try and solve that, I don't even want to try expanding it out :/
 A: As peterwhy points out in the comments, there are three tangent lines.  By inspection, one is $x = 2$, as pointed out by J.W. Tanner in the comments.
The other two can be identified by similar triangles.  Suppose that we have a line tangent to both circles, and let the points of tangency be $T_1$ and $T_2$.  Let the circle centers be $O_1$ and $O_2$.  Finally, let the point where this line intersects the $x$-axis be called $P$.  Then $\triangle PO_1T_1$ and $\triangle PO_2T_2$ are similar (do you see why?).  Since $O_1T_1 = 2O_2T_2$, we must have $PO_1 = 2PO_2$, and therefore $P$ must be at $(4, 0)$.  Note that $PT_1 = \sqrt{3^2-1^2} = \sqrt{8}$, and therefore our tangent line must have slope $\pm \frac{1}{\sqrt{8}}$.

(For simplicity, I only show one of the tangent lines; the other is its mirror image across the $x$-axis.)  From this, we get the equation of the two remaining tangent lines
$$
y = \pm \frac{x-4}{\sqrt{8}}
$$
A: Use dual conics: If we represent a circle (in fact, any nondegenerate conic) with the homogeneous matrix $C$ so that its equation is $(x,y,1)C(x,y,1)^T=0$, lines $\lambda x+\mu y+\tau=0$ tangent to the circle satisfy the dual conic equation $(\lambda,\mu,\tau)\,C^{-1}(\lambda,\mu,\tau)^T=0$. (This equation captures the fact that the pole of a tangent line lies on the line.)
The matrix that corresponds to the circle $(x-h)^2+(y-k)^2=r^2$ is $$C=\begin{bmatrix}1&0&-h\\0&1&-k\\-h&-k&h^2+k^2-r^2\end{bmatrix}$$ with inverse $$C^{-1}=\frac1{r^2}\begin{bmatrix}r^2-h^2&-hk&-h\\-hk&r^2-k^2&-k\\-h&-k&-1\end{bmatrix}.$$ For the circles in this problem, the resulting dual equations are $$\mu^2-\tau^2-2\lambda\tau = 0 \\ -24\lambda^2+\mu^2-4\tau^2-20\lambda\tau = 0.$$ Both circles’ centers lie on the $x$-axis but their radii differ, so no common tangent is horizontal. Thus, we can set $\lambda=1$ and solve the slightly simpler system to obtain the solutions $\mu=0$, $\tau=-2$ and $\mu=\pm2\sqrt2$, $\tau=-4$, i.e., the three common tangent lines are $$x=2 \\ x\pm2\sqrt2 y=4.$$ 
This general method works for any pair of nondegenerate conics: it finds their common tangents by solving a dual problem of the intersection of two (possibly imaginary) conics. For a pair of circles, however, there’s a simple way to find common tangents via similar triangles, as demonstrated in Brian Tung’s answer.
A: The equation of the second circle can be written as $x^2+y^2-5x+6=0$.
Let $P(h,k)$ be a point on the second circle.
Then the equation of the tangent to the second circle at $P$ is $hx+ky-\dfrac52(x+h)+6=0$.
If it is also a tangent to the first circle, the distance from $(1,0)$ to this line is $1$.
\begin{align*}
\frac{|h-\frac52(1+h)+6|}{\sqrt{(h-\frac52)^2+k^2}}&=1\\
\frac{|-\frac32h+\frac72|}{\sqrt{(\frac12)^2}}&=1\\
-3h+7&=\pm1
\end{align*}
So, we have $h=2$ or $h=\frac83$.
If $h=2$, $k=\pm\sqrt{(\frac12)^2-(2-\frac52)^2}=0$ and the common tangent is $x-2=0$.
If $h=\frac83$, $k=\pm\sqrt{(\frac12)^2-(\frac83-\frac52)^2}=\pm\frac{\sqrt{2}}{3}$ and the common tangents are $x\pm2\sqrt{2}y-4=0$.
A: To find a common tangent to two arbitrary circles, you can use the following trick: "deflate" the smaller circle (let $1$) so that it shrinks to a point, while the second shrinks to the radius $r_2-r_1$. Doing this, the direction of the tangent doesn't change and the tangency point forms a right triangle with the two centers.
By elementary trigonometry, the angle $\phi$ between the axis through the centers and the tangent is drawn from
$$d\sin\phi=r_2-r_1,$$ where $d$ is the distance between the centers. The direction of the axis is such that
$$\tan\theta=\frac{y_2-y_1}{x_2-x_1}.$$
So the equation of the tangent is given by
$$(x-x_1)\sin(\theta+\phi)-(y-y_1)\cos(\theta+\phi)=0.$$
The original tangent is a parallel at distance $r_1$, hence
$$(x-x_1)\sin(\theta+\phi)-(y-y_1)\cos(\theta+\phi)=r_1.$$

A: As already stated, there are three lines that can be drawn that are tangent to both circles.  One is the trivial line $$x = 2,$$ which is tangent at the point $(2,0)$, which is also the common point of tangency of the two circles.
The other two lines are reflections of each other in the $x$-axis; these can be found by noting that a homothety that takes the point $(0,0)$ to $(2,0)$ and $(2,0)$ to $(3,0)$ will map the first circle to the second, and the center of this homothety will be a fixed point of this map.
To this end, let $(x',y') = (a x + b, a y + d)$, so we now solve the system $$(b, d) = (2,0) \\ (2a + b, d) = (3,0).$$  That is to say, $b = 2$, $d = 0$, $a = 1/2$, and the desired homothety is $$(x',y') = (x/2 + 2, y/2).$$  The unique fixed point is found by setting $(x',y') = (x,y)$ from which we obtain $(x,y) = (4,0)$.  Thus the tangent lines pass through this point and have the form $y = m(x - 4)$ where $m$ is the slope.  Such a line will be tangent if the system of equations $$(x-1)^2 + y^2 = 1, \\ y = m(x-4)$$ has exactly one solution.  Eliminating $y$ gives the quadratic $$(m^2+1)x^2 - 2(4m^2+1)x + 16m^2 = 0,$$ for which the solution has a unique root if the discriminant is zero; i.e., $$0 = 4(4m^2+1)^2 - 4(m^2+1)(16m^2) = 4 - 32m^2.$$  Therefore, $m = \pm 1/\sqrt{2}$ and the desired lines are $$y = \pm \frac{x-4}{2 \sqrt{2}},$$ in addition to the previous line $x = 2$ described.
A: Beside the obvious solution of $x=2$ you also have two more common tangent lines, namely $$y= \pm \frac {\sqrt {2}}{4} (x-4)$$ 
The two non-obvious tangent lines pass through $(4,0)$ and their y-intercepts are respectively $(0,\pm \sqrt {2})$ 
A: I know I'm several years late, but I wanted to chime in. I'm a programmer by trade, not a mathematician, and I needed to find a general solution to the problem for a program I was writing. I was able to find it using some analytic geometry.
Given two circles $P$ and $Q$ with centers $(P_x, P_y)$ and $(Q_x, Q_y)$, and radii $P_r$ and $Q_r$, we want to find find the equations for the lines that are tangent to both circles.
The vector $\vec{PQ}$ from the center of point $P$ to point $Q$ has angle $\alpha$ with the x-axis given by $atan(\frac{Q_y - P_y}{Q_x - P_x})$.
Consider a unit vector $\vec{V}$ with angle $\theta$ from the X-axis. It makes angle $\beta$ with $\vec{PQ}$ given by $\theta-\alpha$.
The family of lines with normal $\vec{V}$ is given by $x \times cos(\theta) + y \times sin(\theta) + c = 0$. If there are two points on the same line, $x_1 \times cos(\theta) + y_1 \times sin(\theta) = x_2 \times cos(\theta) + y_2 \times sin(\theta)$.
The points on point cicle $P$ that lie on tangent lines on each family are given by $(P_x + P_r \times sin(\theta), P_y + P_r \times sin(\theta))$ and $(P_x + P_r \times sin(\theta), P_y + P_r \times sin(theta))$, and similarly for circle $Q$, $(Q_x + Q_r \times sin(\theta), Q_y + Q_r \times sin(\theta))$ and $(Q_x + Q_r \times sin(\theta), Q_y + Q_r \times sin(\theta))$.
Each of the four tangent lines can thus be found by substitution by picking one tangent point on each circle. For the 'outer' tangents:
$$(P_x + P_r \times sin(\theta)) \times cos(\theta) + (P_y + P_r \times sin(\theta)) \times sin(\theta) = (Q_x + Q_r \times sin(\theta)) \times cos(\theta) + (Q_y + Q_r \times sin(\theta)) \times sin(\theta)$$
$$P_x \times cos(\theta) + P_y \times sin(\theta) + P_r = Q_x \times cos(\theta) + Q_y \times sin(\theta) + Q_r$$
$$-(Q_r - P_r) = (Q_x - P_x) \times cos(\theta) + (Q_y - P_y) \times sin(\theta)$$
and:
$$(P_x - P_r \times sin(\theta)) \times cos(\theta) + (P_y - P_r \times sin(\theta)) \times sin(\theta) = (Q_x - Q_r \times sin(\theta)) \times cos(\theta) - (Q_y + Q_r \times sin(\theta)) \times sin(\theta)$$
$$P_x \times cos(\theta) + P_y \times sin(\theta) - P_r = Q_x \times cos(\theta) + Q_y \times sin(\theta) - Q_r$$
$$(Q_r - P_r) = (Q_x - P_x) \times cos(\theta) + (Q_y - P_y) \times sin(\theta)$$
And for the inner tangents:
$$(P_x + P_r \times sin(\theta)) \times cos(\theta) + (P_y + P_r \times sin(\theta)) \times sin(\theta) = (Q_x - Q_r \times sin(\theta)) \times cos(\theta) + (Q_y - Q_r \times sin(\theta)) \times sin(\theta)$$
$$P_x \times cos(\theta) + P_y \times sin(\theta) + P_r = Q_x \times cos(\theta) + Q_y \times sin(\theta) - Q_r$$
$$(Q_r + P_r) = (Q_x - P_x) \times cos(\theta) + (Q_y - P_y) \times sin(\theta)$$
and
$$(P_x - P_r \times sin(\theta)) \times cos(\theta) - (P_y + P_r \times sin(\theta)) \times sin(\theta) = (Q_x + Q_r \times sin(\theta)) \times cos(\theta) + (Q_y + Q_r \times sin(\theta)) \times sin(\theta)$$
$$P_x \times cos(\theta) + P_y \times sin(\theta) - P_r = Q_x \times cos(\theta) + Q_y \times sin(\theta) + Q_r$$
$$-(Q_r + P_r) = (Q_x - P_x) \times cos(\theta) + (Q_y - P_y) \times sin(\theta)$$
The right side of these four equations defines a dot product between the $\vec{PQ}$ and the normal vector $\vec{V}$, which can be written as
$$|\vec{PQ}|cos(\beta) = ±(Q_r ± P_r)$$
$$\beta = acos(±(Q_r ± P_r) / |\vec{PQ}|)$$
There are some observations we can now make:

*

*The equation is based on the sum and difference of the radii, the distance between the circles, and the line between them

*The four values for $cos(\theta)$ are mirrored about zero, which results in two pairs of angles, lining up with the mirror symmetry of the geometry

*If the circles are tangent, then $|PQ| = P_r + Q_r$, so the inner tanget lines have $β = ± /2$, which ends up being the same line, as expected.

*If the circles overlap, then $|PQ| < P_r + Q_r$, so the inner tangent lines do not exist as it is outside the domain of $acos()$, as expected.

*If one circle lies entirel within another, then $|PQ| < P_r - Q_r$, so the outer tangent lines do not exist either, and there are no shared tangent lines, as expected.

*If one of the circles is actually a point (so radius is zero), there are only two solutions for $\beta$ if the point is outside of the circle, one, if the point is on the circle, and no solutions, if the point is inside the circle.

*If both cicles are shrunk to points, then there is only one solution to $\beta$ being sero, and the tangent is the line between the two points.

*If the circles have the same center point, then $|PQ|$ is zero and there are no solutions, unless they also have the same radius, but then they are the same circle!

Let's check the equation by working your example: $P_x = 1, P_y = 0, P_r = 1, Q_x = 2.5, Q_y = 0, Q_r = 0.5$
The angle α beween the vector $\vec{PQ}$ and the X-axis is conveniently zero, so that means $\beta$ equals $\theta$.
This gives $cos(\theta)$ in $\{ 1, -1, \frac{1}{3}, -\frac{1}{3} \}$.
The case where $cos(\theta) = 1$ results in $x + c = 0$ and substituting in $x = P_x + P_r \times cos(\theta)$ gives $c = -2$, so $x = 2$.
The case where $cos(\theta) = -1$ results in $c - x = 0$ and substituting in $x = P_x - P_r \times cos(\theta)$ gives $c = 2$, so $x = 2$, again.
For the other two cases, we can use the identity $sin(acos(x)) = \sqrt{1 - x^2}$ to find that for $cos(\theta) = ±\frac{1}{3}$,  $sin(\theta) = \sqrt{\frac{8}{9}}$.
The case where $cos(\theta) = \frac{1}{3}$, the tangent point on $P$ is given by $(1 + cos(\theta), sin(\theta))$, put into the line equations gives $cos(\theta) + cos^2(\theta) + sin^2(\theta) + c = 0$, so $c = -1 - cos(\theta)$.
Thus,
$$ x \times cos(\theta) + y \times sin(\theta) - 1 - cos(\theta) = 0 $$
$$ (x - 1) / 3 + y \times \sqrt{\frac{8}{9}} - 1 = 0 $$
$$ (x - 1) + y \times \sqrt{8} - 3 = 0 $$
$$ y = \frac{4 - x}{\sqrt{8}} $$
The case where $cos(\theta) = -\frac{1}{3}$, the tangent point on $P$ is given by $(1 - cos(\theta), -sin(\theta))$, put into the line equations gives $cos(\theta) - cos^2(\theta) - sin^2(\theta) + c = 0$, so $c = 1 - cos(\theta)$.
Thus,
$$ x \times cos(\theta) + y \times sin(\theta) + 1 - cos(\theta) = 0 $$
$$ (x - 1) / -3 + y \times \sqrt{\frac{8}{9}} + 1 = 0 $$
$$ (1 - x) + y \times \sqrt{8} + 3 = 0 $$
$$ y = \frac{x - 4}{\sqrt{8}} $$
