f(x) = If[x  <  1, x^(2), If[x > 1, (-sqrt(x)) + 2, 1]]
a = 0.41 (slider from 0 to 2, step 0.01)
P: (a, f(a))
g = Tangent(P, f)