I'm having trouble with tangent problems, as I often get one tangent right, but the other completely off, or both.

Here are some examples:

1) Find the equation of both lines that pass through the origin and are tangent to the parabola y=1+x^2

y'=2x

Let a be point of tangency

m of tangent=(1+a^2-0)/(a-0)

2a=(1+a^2)/a

2a^2=1+a^2

0=a^2-1

=(a-1)(a+1)

y=x or y=-x

Neither of them are tangents, but y=2x and y=-2x are. What did I do wrong?

2) Find the x-coordinates to the points on the hyperbola xy=1 where the tangents from the point (1,-1) intersect the curve.

y'=-1/x^2

Let a be point of tangency

m of tangent=(1/a+1)/(a-1)

-1/a^2=a-1/a^2-1

2/a^2=1

a^2=2

a=2^(1/2), -(2^(1/2))

These are wrong as well.