<s>[INST] Straight line is tangent to the curve. The straight line $y=mx+1$ is tangent to the curve $x^2+y^2-2x+4y=0$. Find the possible values of $m$.
My attempt

Substitute the $y=mx+1$ into the equation $x^2+y^2-2x+4y=0$. $$x^2+(mx+1)^2-2x+4(mx+1)=0$$ $$x^2+m^2x^2+2mx+1-2x+4mx+4=0$$ $$(1+m^2)x^2+6mx-2x+5=0$$ $$(1+m^2)x^2+(6m-2)x+5=0$$
I think what I did is wrong as I don't know how to continue from my steps. Can anyone explains it? Thanks
 [/INST] The general equation of a tangent to a circle $X^2 + Y^2 = a^2$ is given by $Y = mX \pm a\sqrt{1 + m^2}$.
For the purpose of your question, $X = x - 1$, $Y = y + 2$, $a = \sqrt{5}$. Also,
$$
y = mx + 1 \\
\implies y + 2 = m(x - 1) + (m + 3) \\
\implies Y = mX + (m + 3).
$$
Hence,
$$
(m + 3) = \sqrt{5} \sqrt{1 + m^2}.
$$
The rest is simple.
</s>