<s>[INST] Urgent - Find the equation of the lines tangent to a circle Question: 'Find the equation of the lines from point $P(0,6)$ tangent to the circle $x^2+y^2=4x+4$.
So what I did firstly is rewrite it to the form $(x-2)^2 + y^2 = 8$, and I saw that point $P$ is not on the circle. I learned that the equation of the line tangent to the circle $x^2+y^2=r^2$ from the point $P(a,b)$ is $xa+yb=r^2$
$ xa+yb=4x+4$
$x.o+y.6=2x+2.0 +4$ (This is the step I don't understand)
$6y=2x+4$
$y=\dfrac{1}{3}x + \dfrac{2}{3}$
So basically, my question is: Why did the $4x+4$ change into the $2x+4$?
 [/INST] The equation of any line passing through $(0,6)$ can be written as $\frac{y-6}{x-0}=m$ where $m$ is the gradient, So, $y=mx+6$
If the $(h,k)$ be the point of contact, then $k=mh+6$ and $h^2+k^2-4h-4=0$
Replacing $k$ in the 2nd equation, $h^2+(mh+6)^2-4h-4=0$ 
or $(1+m^2)h^2+2h(6m-2)+32=0$, it is a quadratic equation in $h,$
For tangency, both the root should be same, so, $4(6m-2)^2=4\cdot(1+m^2)32$
$(6m-2)^2=(1+m^2)32, (3m-1)^2=8(1+m^2) \implies m^2-6m-7=0$
So, $m=7,-1$
If $m=7,\frac{y-6}{x-0}=7, 7x-y+6=0$
If $m=-1,\frac{y-6}{x-0}=-1, x+y-6=0$
</s>