Finding the range of $a$ for which line $y=2x+a$ lies between circles $(x-1)^2+(y-1)^2=1$ and $(x-8)^2+(y-1)^2=4$ without intersecting either 
Find the range of parameter $a$ for which the variable line $y = 2x + a$ lies between the circles $(x-1)^2+(y-1)^2=1$ and $(x-8)^2+(y-1)^2=4$ without intersecting or touching either circle.

Now, how I solved it was realising the line has a positive slope of $+2$, and thus if it's a tangent to circle #1 then its intercept should be negative. And so, using the condition of tangency,
$$a^2= m^2(r_1)^2+(r_1)^2= 4+1 $$
And thus, as $a$ can only be negative (otherwise a positive value of $a$ will make the line intersect the circle). Thus, making the lower bound of $a> - \sqrt 5$.
Similarly for the bigger circle $a<-\sqrt{20}=-\sqrt{(2^2)(2^2)+(2^2)}$
Hence I find that the solution should be $(-\sqrt5,-\sqrt{20})$, but the actual solution is $\left(2\sqrt 5-15,-\sqrt 5-1\right)$.
 A: I would draw perpendicular to the line $2x - y + a = 0$ from centers of both circles.
From circle $C_1$ centered at $(1, 1)$,
$d_1 = \dfrac{|2 -1 + a|}{\sqrt5} \gt 1$
(where $1$ is the radius of the circle $C_1$).
Similarly from $(8, 1)$, $d_2 = \dfrac{|16 - 1 + a|}{\sqrt5} \gt 2$
(where $2$ is the radius of the circle $C_2$).
Simplifying we have,
$|a + 1| \gt \sqrt5$
$|a + 15| \gt 2 \sqrt5$
If the line is in between both circles, the algebraic perpendicular distances from centers will have opposite signs. In other words, $(a+1)$ and $(a+15)$ will have opposite signs.
i) From the first (considering both negative and positive value of $a+1$),
$a \gt \sqrt5 - 1 \ $ or $ \ a \lt - \sqrt5 - 1$
ii) From the second (again considering both negative and positive values of $a+15$),
$a \gt 2 \sqrt5 - 15 \ $ or $ \ a \lt - 2 \sqrt5 - 15$.
a) When $a \gt \sqrt5 - 1$, both $(a+1)$ and $(a+15)$ have positive signs.
b) When $a \lt - 2 \sqrt5 - 15$, both $(a+1)$ and $(a+15)$ have negative signs.
c) When $2 \sqrt5 - 15 \lt a \lt - \sqrt5 - 1$,  $(a+1)$ and $(a+15)$ have opposite signs.
That leads us to the answer $2 \sqrt5 - 15 \lt a \lt - \sqrt5 - 1$.
A: Your condition of tangency is assuming your circles are centered at the origin.
It derives for setting $y = mx + a$ and $x^2 +y^2 = r^2$ and substituting $x^2 + (mx+a)^2 = r^2$.  Solving for $x$ and getting two values based an the discriminate $4a^2m^2 -4(a^2 - r^2)(1+m^2)$ and knowing if this is a tangent line the two points of intersection coincide so the discriminate is $0$.  Solving we get $a^2 = (m^2 + 1)r^2$ as you did.
But our circles are not centered at the origin.
So our work is $y = 2x + a$ and $(x-1)^2 + (y-1)^2 = 1$
$(x-1)^2 + (2x+(a-1))^2 = 1$ so $
$(4+1)x^2 +(4(a-1)-2)x +(1 + (a-1)^2 -1) = 0$ so
$5x^2 + (4(a-1)-2)x + (a-1)^2 = 0$
So $x = \frac {-4(a-1)-2 \pm \sqrt {[4(a-1)-2]^2 - 20(a-1)^2}}{10}$
and we must have $[4(a-1)-2]^2 - 20(a-1)^2=0$
So $-4(a-1)^2 - 16(a-1) + 4 =0$
$(a-1)^2 + 4(a-1) - 1 = 0$ so $a-1 = \frac {-4\pm \sqrt{20}}2 = -2 \pm \sqrt 5$.
And $a = -1\pm \sqrt 5$.  As we are passing between the circles and the other circle is centered to the right of this circle  we wan $a < -1 -\sqrt 5$.
You can do the same for the other circle.
A: The line passing through the center of the first circle is $y=2x-1$. Its perpendicular line passing through its center is $y=-\frac12x+\frac12$. It crosses the first circle at $(x,y)=\left(1+\frac2{\sqrt5},1-\frac1{\sqrt5}\right)$. Hence, $y=2x-\sqrt5-1$ touches the first circle from the right side.
Similarly, the line passing through the center of the second circle is $y=2x-15$. Its perpendicular line passing through its center is $y=-\frac12x+5$. It crosses the first circle at $(x,y)=\left(8-\frac4{\sqrt5},1+\frac2{\sqrt5}\right)$. Hence, $y=2x+2\sqrt5-15$ touches the second circle from the left side.
Hence, the value of $a$ ranges between $2\sqrt5-15$ and $-\sqrt5-1$.
See the Desmos graph for reference.
