Find the equation of a circle tangent to two lines Find the equation of the circle tangent to the $x$-axis at the origin and tangent to the line $4x-3y+24=0$.
My Approach:
Let the equation of the required circle be:
$$x^2+y^2+2gx+2fy+c=0$$
Let the equation to the tangent at origin $(0,0)$ to the above circle be $gx+fy+c=0$.
Then, what should I do? please help me to continue.
Thanks in Advance.
 A: As the circle touches the x-axis at (0,0) then the centre of the circle must be on the y-axis and the y coordinate of the centre must be equal to the radius. So the centre is $(0,r)$. So the equation is:
$$x^2+(y-r)^2=r^2$$
Then you want to find the point of intersection of the circle and the straight line. Lets rearrange the straight line:
$$x=\frac{3y-24}{4}$$
Sub in:
$$\left(\frac{3y-24}{4}\right)^2+(y-r)^2=r^2$$
Multiple by $4^2$ to get rid of the fractions:
$$(3y-24)^2+16(y-r)^2=16r^2$$
Expand:
$$9y^2-144y+576+16y^2-32yr+16r^2=16r^2$$
Collect and sort by powers of $y$:
$$25y^2-16(2r+9)y +576=0$$
Now we expect there to be only one point of intersection so this quadratic should have only one solution. This occurs when the discriminant is zero.
$$(16(2r+9))^2-4\cdot25\cdot576=0$$
Pull out the $16^2$ term and factorise $576$ in preparation to divide out common factor.
$$256(2r+9)^2-4\cdot25\cdot64\cdot9=0$$
Divide by common factor of $256$.
$$(2r+9)^2-25\cdot9=0$$
Expand and multiply:
$$4r^2+36r+81-225=0$$
Collect:
$$4r^2+36r-144=0$$
Divide by 4:
$$r^2+9r-36=0$$
Factorise:
$$(r-3)(r+12)=0$$
Solve:
So $r=3$ or $r=-12$
Note that $r=-12$ is a valid solution. It means that the circle is below the axis where earlier we assumed it was above the axis (when we set the centre to $(0,r)$).
So the two solutions are: $x^2+(y-3)^2=3^2$ and $x^2+(y+12)^2=12^2$
Or in expanded form: $x^2+y^2-6y=0$ and $x^2+y^2+24y=0$

A: A circle tangent to $x$-axis in $(0,0)$ has its center in $C_0(0,y_0)$ and its radius is $|y_0|$. Thus its equation has the form: 
$$\tag{1}x^2+(y-y_0)^2=y_0^2$$
The distance from the center $C_0(x_0,y_0)=(0,y_0)$ of the circle to the straight line is (see (http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html)):
$$\frac{|4x_0-3y_0+24|}{\sqrt{4^2+(-3)^2}}=\frac{|-3y_0+24|}{5}$$
This distance must be equal to the radius $|y_0|$ giving the following equation:
$$\frac{|-3y_0+24|}{5}=|y_0| \ \ \Leftrightarrow \ \ -3y_0+24=\pm 5 y_0$$
which has 2 solutions: $y_0=3$ or $y_0=-12$ giving, (see (1)):


*

*either the equation $x^2+(y-3)^2=3^2$ i.e., $x^2+y^2-6y=0$ (center $(0,3)$, radius 3),

*or the equation $x^2+(y+12)^2=12^2$ i.e., $x^2+y^2+24y=0$ (center $(0,-12)$, radius = 12).

