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}} $$