Method 1: (Techfree)
If it is tangent to the parabola, that means that when you make the equations intersect the discriminant will be 0.
The equation of the line is y=mx+c
hence if you let them equal each other:
y=x^2 - mx - c
Discriminant = m^2 - 4c = 0
Since the line passes through (1, -2)
-2 = m + c
So then you have two equations, m^2 - 4c=0, -2 = m+c, and you just solve for m and c and you get your tangent lines.
Method 2 (cas):
solve((tangentLine(x^2,x,m)|x=1)=-2,m)
Then just plug the values of m you get back into tangentLine.
What the command above does is it solves for the point the tangent line is tangent to on the curve, given that when x=1 the tangent line gives -2. Then when you plug the values of m back into the function it gives you the expression of the tangentLine. (You have to add y= before it.)
You can also use calculus, but I will leave that as an exercise for the reader.