Find the equations of the two circles which pass through the point $(2,0)$ and have both the $y$-axis and the line $y-1=0$ as tangents I have this question:


  Find the equations of the two circles which pass through the point $(2,0)$ and have both the $y$-axis and the line $y-1=0$ as tangents. 


By plotting $y=1$ and $(2,0)$, it's obvious that the smaller circle has a radius of 1 and therefore an equation of $(x-1)^2 + y^2 = 1$. When you look at the larger one, it seems to touch these 3 co-ordinates: $(r,1)$, $(2,0)$, $(0, 1-r)$ where $r$ is its radius.

The larger circle's equation is apparently $(x-5)^2+(y+4)^2=25$. How do I go about finding this algebraically?
Let the equation of the circle be $(x-a)^2+(y-b)^2=r^2$  where $r\ge0$

Now the distance of any tangent from the centre of the circle = radius

For $y$ axis $x=0,r=\dfrac{|a|}{\sqrt{1^2+0^2}}=|a|\implies a=\pm r$

For $y-1=0, r=\dfrac{|b-1|}{\sqrt{1^2+0^2}}=|b-1|\implies r^2=(b-1)^2$

Case $\#1:$ If $b-1\ge0, r=b-1\iff b=r+1$

So, we have $(x\pm r)^2+\{y-(r+1)\}^2=r^2$

Now find $r(\ge0)$ using the fact : the circle passes through $(2,0)$

Case $\#2:$

If $b-1&lt;0, r=-(b-1)=1-b\iff b=1-r$

Like $\#1$
Consider center (a,b)

Step 1) The circle touches y axis, giving the radius r= ± a . So the equation 
         will be :    ......(X-a)² +(Y-b)²=a².......

Step 2) The circle touches line y=1, so the resultant equation after 
         substituting y=1 will have one solution. (Think in a way that we want 
         to find the intersection points between the circle and the line y=1).
          (x-a)²+ (1-b)²=a² will have one solution if and only if......
          (1-b)²=a².....

Step 3) Substitute point (2,0):  (2-a)²+(0-b)²=a²

Step 4) Rearrange:  (1-b)²=a² and (2-a)²+b²=a² . Solve the system. (a,b,r)=(1,0,1) or (5,-4, 5)