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

</s>