Find the equation of the polar Let $K$ be a circle with center $C=(x_0,y_0)$ and radius $r$. For each point $P=(p_1, p_2)$ outside the circle let $g_P$ be the line that passes through the intersection points of the tangent from $P$ at the circle and the circle.
I want to find the equation of the line $g_p$ (polar).

I have done the following:
Let $A=(a_1, a_2)$ and $B=(b_1, b_2)$ be the two intersection points.
Since $g_p$ passes through these two points the line has the equation of the form:
$$g_P : y=\frac{b_2-a_2}{b_1-a_1}(x-a_1)+a_2$$
The points $A,B$ are on the circle, so we have the following two relations:
$$(a_1-x_0)^2+(a_2-y_0)^2=r^2 \\ (b_1-x_0)^2+(b_2-y_0)^2=r^2$$
We also have that the triangle MBP and AMP are both right triangles so we could use the Pythagorian Theorem, or not?
$$$$
EDIT:
The equation that we are looking for is \begin{equation*}y-a_2=\frac{b_2-a_2}{b_1-a_1}(x-a_1) \Rightarrow y=\frac{b_2-a_2}{b_1-a_1}(x-a_1)+a_2\end{equation*}
Since from $A$ and $B$ the tangent passes through we have that \begin{equation*}(x-x_0)(a_1-x_0)+(y-y_0)(a_2-y_0)=r^2 \ \text{ und } \ (x-x_0)(b_1-x_0)+(y-y_0)(b_2-y_0)=r^2\end{equation*}
Since $P$ is on that tangent we have that
\begin{equation*}(p_1-x_0)(a_1-x_0)+(p_2-y_0)(a_2-y_0)=r^2 \ \text{ und } \ (p_1-x_0)(b_1-x_0)+(p_2-y_0)(b_2-y_0)=r^2\end{equation*}
Is everything correct so far?
 A: Hint:
Solve the problem first for a circle centred at origin, and a point $P$ on the $x$-axis, with coordinates $(p,0)$.
Then deduce the general case by a change of coordinates.
Some details :
Consider a line through $P$ with (variable) slope $m$ and seek for the intersection points of this line with the circle. For that, write the equation in standard form:
$$y=m(x-p_1)+p_2. $$
The line will be tangent to the circle if the equation for the abscissae of these intersection points has a double roots. As it is a quadratic equation, this means is discriminant is $0$. AS the discriminant is a quadratic polynomial in $m$, you'll get two roots, i.e. two tangents. Further more, as when an equation $ax^2+bx+c=0$ has a double root, this double root is $-b/2a$, so you obtain the abscissae of $A$ and $B$.
A: Short answer: Here’s a different approach that might be beyond what you’ve studied so far. This problem is quite easy to solve using homogeneous coordinates—projective geometry—and the same method applies to any conic: If the equation of the conic is $\mathbf x^TC\mathbf x=0$, then the polar line of a point $\mathbf p$ is $C\mathbf p$.  
For your circle, $$C=\begin{bmatrix}1&0&-x_0\\0&1&-y_0\\-x_0&-y_0&x_0^2+y_0^2-r^2\end{bmatrix}$$ so the polar line of $P$ is $$C[p_1,p_2,1]^T=[p_1-x_0,p_2-y_0,x_0^2-p_1x_0+y_0^2-p_2y_0-r^2]^T,$$ i.e., $$(p_1-x_0)x+(p_2-y_0)y=r^2-x_0^2-y_0^2+p_1x_0+p_2y_0.$$

Longer answer with derivation: Using homogeneous coordinates for points in $\mathbb R^2$, we can write the equation $ax+by+c=0$ of a line as $\mathbf x^T\mathbf l=0$, where $\mathbf l=(a,b,c)^T$ and $\mathbf x=(wx,wy,w)^T$, $w\ne0$. (Usually, we just set $w=1$ when converting from inhomogeneous (Cartesian) to homogeneous coordinates.) Similarly, the general equation of a conic $Ax^2+Bxy+Cy^2+Dx+Ey+F=0$ can be written in homogeneous coordinates as $\mathbf x^TC\mathbf x=0$, where $$C=\begin{bmatrix}A & \frac B2 & \frac D2 \\ \frac B2 & C & \frac E2 \\ \frac D2 & \frac E2 & F\end{bmatrix}.$$ Notice that $C$ is symmetric.  
Let $\mathbf x$ be a point on the conic $C$. Then the tangent line $\mathbf l$ to the conic at $\mathbf x$ is given by $\mathbf l=C\mathbf x$. The point $\mathbf x$ clearly lies on $\mathbf l$, since $\mathbf x^T\mathbf l=\mathbf x^TC\mathbf x=0$. Now suppose $\mathbf y$ is another point of intersection of $C$ and $\mathbf l$. Then $\mathbf y^TC\mathbf y=0$ and $\mathbf y^T\mathbf l=\mathbf y^TC\mathbf x=0$, from which we have $(\mathbf x+\lambda\mathbf y)^TC(\mathbf x+\lambda\mathbf y)=0$ for all $\lambda$, which means that the entire line joining $\mathbf x$ and $\mathbf y$ lies on $C$, and so the conic is degenerate.  
With the above lemma, we can show that for any point $\mathbf x$, the tangents to $C$ at its intersection with the line $\mathbf l=C\mathbf x$ intersect at $\mathbf x$, i.e., that $\mathbf l$ is the polar line of $\mathbf x$. To see this, let $\mathbf y$ be a point on $C$. Then the tangent to $C$ at $\mathbf y$ passes through $\mathbf x$ if $\mathbf x^TC\mathbf y=0$, but because of $C$’s symmetry this condition is equivalent to $\mathbf y^T(C\mathbf x)=0$, i.e., that $\mathbf y$ lies on the line $C\mathbf x$.  
The equation of your circle is $(x-x_0)^2+(y-y_0)^2=r^2$, which expands into $$x^2+y^2-2x_0x-2y_0y+x_0^2+y_0^2-r^2=0$$ from which $$C=\begin{bmatrix}1&0&-x_0\\0&1&-y_0\\-x_0&-y_0&x_0^2+y_0^2-r^2\end{bmatrix}.$$ The rest is just a matter of expanding the equation $(x,y,1)\,C\,(p_1,p_2,1)^T=0$.
A: To continue from where you’ve left off, you’re going to have to eliminate the $a$’s and $b$’s from your equations somehow. One (tedious) way to go might be to explicitly compute the two points of tangency and substitute the answer into the equations you have so far, and then see where that takes you. However, your observation in a comment that $\overline{CP}\perp\overline{AB}$ leads to a fairly straightforward solution that doesn’t involve explicitly computing the tangent points.  
We know from your observation that the vector $P-C$ is normal to $\overline{AB}$, so an equation for the polar line is $$(P-C)\cdot(x,y)+c=0 \tag1$$ with $c$ some as-yet-to-be-determined constant. Using the formula for the distance from a line to a point, we have $$PM = {|(P-C)\cdot P+c|\over\|P-C\|}.\tag2$$ Now, $\triangle{PAC}\sim\triangle{PMA}$, so $PM:PA::PA:PC$, and thus (using the Pythagorean theorem) $$PM={PA^2\over PC}={\|P-C\|^2-r^2\over\|P-C\|}.\tag3$$ Combining equations (2) and (3) we have $${|(P-C)\cdot P+c|\over\|P-C\|}={\|P-C\|^2-r^2\over\|P-C\|}.\tag4$$ When the normal to the line points toward the point to which we’re measuring the distance, as we have here, the quantity inside the absolute value bars in (2) is nonnegative, so taking the absolute value on the left-hand side of (4) is superfluous. All that’s left is to solve for $c$ and plug that back into (1), which I’ll leave to you.
