<s>[INST] 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)$.
 [/INST] 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.
</s>