Compute the length of a common tangent of two circles of radii r and 2r which intersect at the right angle. 

Question: Compute the length of a common tangent of two circles of radii r and 2r which intersect at the right angle.


Let's say our first circle has the form $(x-a)^2+(y-b)^2=r^2$ and the second circle has the form $(x-c)^2+(y-d)^2=4r^2$ then since they intersect at a right angle the product of their derivatives must equal $-1$ which means our condition is $\frac{a-x}{y-b} \cdot \frac{c-x}{y-d} =-1$ but after this I can't continue.
Please help :(
 A: Since all that matters is that one circle has twice the radius of the other and they intersect at right angles, the problem will scale with respect to the radius and the position and orientation in the plane will be irrelevant.
So we may let one circle have center $(0,1)$ and radius $1$ and the other have center $(2,0)$ and radius $2$ as in the diagram below, where the length of the common tangent is clearly $2$.
So the answer to the general question is $2r$.

A: Here's a solution to the general case:


$$a^2 + b^2 = |\overline{AB}|^2 = (a-b)^2 + d^2$$ 
  $$\implies \quad d^2 = 2 a b$$

Thus, if $a = 2 b$, then $d = 2 b = a$ (which is clear, since $a-b=b$, so that $\triangle BCA \cong \triangle AB^\prime B$).
A: I think the less algebra one does here, the easier the result is to understand. Here's an entirely geometric method.
Suppose we have circles of radii $a$ and $b$, centres $A$ and $B$ with tangents at the points $P$, $Q$ on circle $a$ and $R$, $S$ on $b$ intersecting at $C$ at angle $2\theta$. Two tangents from a circle to the same point are the same length, so we have $PC=QC$ and $RC=SC$, and the two isoceles triangles $PCQ$ and $RCS$ with the same angle at the apex (so they are similar, by SAS). Also, the tangent makes a right angle with the radius, so the triangles $PCA$, $QCA$, $RCB$ and $SCB$ formed by each centre, each tangent point and the intersection point are all similar. The length $PC$ can then be expressed in terms of the radius and angle as
$$ a\cot{\theta}. $$
Exactly the same thing holds for the circle of radius $b$, so the other side of the tangent, $RC$, is of length $b\cot{\theta}$. The total length is then
$$ (a+b)\cot{\theta}. $$
In this case $a=r$, $b=2r$ and $2\theta=\pi/2$, so the total length is
$$ (r+2r)\cot{(\pi/4)} = 3r. $$
