Finding the equation of a line that is tangent to a circle, given the equation of the circle and a point on the line

analytic geometrycircles

I was wondering how would you find the equation of a tangent line of a circle if you are given the equation of the circle and a point on the line. In general:

Given an equation of a circle, $(x-h)^2 + (y-k)^2 = r^2$, and a line $l$ that contains the point $P(a,b)$ and is tangent to the circle, find the equation of $l$.

From my work on the problem, I knew that there are three cases:

  1. $P(a,b)$ is in the interior of the circle.
  2. $P(a,b)$ is on the circle.
  3. $P(a,b)$ is in the exterior of the circle.

Obviously, the first one can be discarded since the line $l$ can't be a tangent if $P$ is in the interior the circle.

For the second case, this implies that the point of tangency is $P$. Therefore, in order to find the equation for $l$, I need to find its slope by finding the negative reciprocal of the slope $m$ of the line that contains the center of the circle, $(h,k)$, and the point $P$, since they and line $l$ are perpendicular to each other (in other words, find $\dfrac{-1}{m}$). After that, simply substitute $\dfrac{-1}{m}$ and $(a,b)$ in the point-slope form of the equation of a line.

I was particularly interested in the third case, where the point $P$ is outside the circle.

An example problem that I made was this:

Find the equation of a line tangent to a circle, whose equation is $(x-4)^2 + (y-4)^2 = 9$, if the point $P(1,-1)$ is on the tangent line.

From a rough sketch I made, it seems that there are two lines that I need to find the equation of. Using the sketch, the first tangent line was just the line $x=1$. My problem lies in finding the second one.

I let point $T(a,b)$ be the point of tangency of line $l$ and the circle.
Then, I tried finding the distance $d$ between $(1,-1)$ and $(a,b)$ by employing the Pythagorean Theorem on the right triangle that is formed by the points $P(1,-1), T(a,b)$, and the center of the circle, $C(4,4)$, since the tangent is perpendicular to the radius.

After solving, what I got was $$d = 5$$
From then on, I was stuck. I tried doing the same method I used in solving the second case, but it seemed that I looped back to where I started.

I tried another method by letting $y_1 = m(x-1)-1$ be the equation for the second tangent line and letting $y_2 = \dfrac{-1}{m}(x-4)+4$ be the line that is perpendicular to it at the point of tangency, and setting them equal to each other. But, I got overwhelmed and thought that there may be a better method.

I still don't know the answer to it now, or if it's even solvable (it seems that it is, though). But if you managed to figure it out, I would gladly appreciate it if you showed me how!

Best Answer

For the example problem

Find the equation of a line tangent to a circle, whose equation is $(x-4)^2 + (y-4)^2 = 9$, if the point $P(1,-1)$ is on the tangent line.

I would use a different point whose tangent does not have infinite slope. For example, $P(0,4).$ Thus, the two equations to solve are

$$ y= ax+4, \qquad (x-4)^2 + (y-4)^2 = 9. $$

Substitute the first equation into the second to get

$$ (x-4)^2 + (ax+4-4)^2 = x^2-8x+16 +a^2 x^2 = 9. $$

Simplify this to get

$$ (1+a^2)x^2 - 8x + 7 = 0. $$

Solve the quadratic to get

$$ x = \frac{ 4 \pm \sqrt{9-7a^2}}{1+a^2}. $$

This gives two values for $\,x\,$ for the point of intersection in general. However, for $\, 9-7a^2=0\,$ there is only a single point of intersection, hence a tangent line. Thus, the two tangent lines must be $\, y=\frac3{\pm\sqrt{7}}x+4. \,$ Check that the point $P(0,4)$ is on both tangent lines. Check that the point $\,P(\frac74,4+\frac34\sqrt{7})\,$ is both on the line $\, y = \frac{3}{\sqrt{7}}x+4\,$ and the circle. Same with the other tangent line but with $\,-\sqrt{7}.$

The general case for any circle and a point outside the circle is very similar.