I am constructing a diagram that consists of a sine curve and its tangent line at a given argument. However, I want to show the coordinates of the point of tangency and the equation of the tangent line dynamically.
My work so far:
f[x_] := Sin@x;
l[x_, a_] := f[a] + f'[a] (x - a);
Manipulate[
Show[
Plot[Sin@x, {x, 0, 2 \[Pi]},
PlotRange -> {-2, 2}, AxesStyle -> Arrowheads[0.03],
AxesLabel -> {"x", "Sin[x]"}, AspectRatio -> Automatic,
PlotLabel -> f[a] <> "+" <> f'[a] ("x-" <> a)],
Plot[l[x, a], {x, a - 2, a + 2}, PlotStyle -> Pink],
Graphics[{PointSize[Medium], Red, Point[{a, Sin@a}]}]],
{a, 0, 2 \[Pi]}]
Unfortunately, what I've done doesn't work.
So my question is: how do I get the information I need to make it work.



Inset/Text? – Kuba Oct 18 '13 at 05:02