Find the equation of tangents of circle using differentiation Given that equation of a circle $C$ is $x^2 +y^2 -10x -8y +18=0$
Find the equations of the tangents to the circle $C$ which are parallel to line $y-x+5=0$ 
(Originally this was not a differentiation question,but I found out that if I restricted myself to pre-calculus,I would have to use discriminant and then the quadratic formula.)
$x^2 +y^2 -10x -8y +18=0$
By differentiating with respect to $x$,
$2x +2y y' -10 -8y'=0$
Hence,
$y'=\frac{-2x+10}{2y-8}$
As the gradient is 1,
$2y-8=-2x+10$
$y=-x+9$
That's where I got stuck.As the gradient is $1$,why does last equation has a gradient of $-1$?Where did I go wrong?Lastly,is there any other easier way ?
Edit:
Subst. $y=-x+9$ into $C$
$x^2 + (9-x)^2 -10x-8(9-x)+18=0$
$2x^2 +81-18x -10x -72+8x+18=0$
$2x^2 -20x -27=0$
This would give me 
$x=\frac {10+\sqrt(154)}{2} $or $x=\frac {10-\sqrt(154)}{2}$
Hence,$y=\frac {8+-\sqrt(154)}{2}$
So,the equation is $y=x-1+-\sqrt(154)$
However when I did it the pre-calculus way,the answer is $ y=x-1+- \sqrt(46) $
 A: You have to complete your work.
Take $y=-x+9$ in the equation of the circle that becomes:
$$
2x^2-20x+27=0
$$
solve for $x$ and find the two roots $x_1$ and $x_2$. Find $y_1=-x_1+9$ and $y_2=-x_2+9$ . The points $(x_1,y_1)$ and $8x_2,y_2)$ are the points of tangency. Now write the equations of the two lines of slope $m=1$  through these two points.
Note that your solution is wrong because you have a $-27$ in the equation. The correct solution for $x$ is:
$$
x=\frac{10\pm \sqrt{46}}{2}
$$
The other method, without derivative, is to search a line of equation $y=x+q$ that is tangent to the circle. This means that the system
$$
\begin{cases}
y=x+q\\
x^2+y^2-10x-8y+18=0
\end{cases}
$$
has only one solution. So, substitute $y$ in the second equation so  that you have a second degree equation in $x$ with a parameter $q$ and find the value of the parameter $q$ such that the discriminat of this equation is null $\Delta(q)=0$. Since $\Delta(q)$ is a second degree polynomial in $q$ you find two values for $q$  that are the intercepts of the the two tangent lines.
Another method is to intersect the line orthogonal to the $y-x+5=0$ and passing through the center of the circle with the circle. The common points are the points of tangency.
A: You have used differentiation alright, however by an invalid next step you got the straight line that joins two points of tangentcy.
Apart from what others correctly indicated, another way is to solve for two $C$s from a quadratic equation of intersection with the variable intercept straight line.
$$ y = x + C,$$ 
setting discriminant to zero to capture tangency.
Edit1:
Your shortcut  procedure gives rise to a join of two points of same slope known as a conjugate diameter.
Try to sketch the ellipse and conjugate diameter for example
$$ x^2 + 2 y^2 -10 x -8 y +18 = 0 $$
By the above procedure 
$$ \frac{dy}{dx}= \frac{5-x}{2y-4}$$
when the slope is set to $1$ and simplified it gives the conjugate diameter 
$$ x + 2y =9 $$
which cuts all segments of lines of same slope$ =1$  included between the ellipse segments ( or circle). 
Please check some more cases  or google images of conjugate diameter.
A: I think you dont have to use differentiation in this case. You just have to solve for the inverse tangent of the line in order to get the perpendicular line that passes through the given line as well as the center of the circle. After that, find the point of intersection of that circle and the perpendicular line. Use system of equations to solve that. After that you found the point of tangency at the circle, use the slope of the given line then use point slope form in order to get the equation of the line parallel to the given line that is tangent to the circle.
