# Add a button to show properties inside a graph

I would like to draw the graph of $$f(x)=x^{3}-x+2$$ next to two buttons named: "Property1" and "Property2" in which when I press "Property1" it shows "f'(1) is positive", while for "Property2" it shows "f'(1)=2".

I am only able to draw my idea as follows:

f[x_] = x^3 - x + 2;
f'[x_] = 3*x^2 - 1;
pt1 = Plot[x^3 - 3*x + 1, {x, -1, 3}, PlotRange -> {-2, 6}];
pt2 = Manipulate[p, {p, {f, f'}}];
GraphicsRow[{pt1, pt2}] Could someone give me a help? Thanks.

ClearAll[st, sign, f, g]
f[x_] := x^3 - x + 2;
g[x_] := x^3 - 3*x + 1;
sign[x_] := Sign[x] /. {-1 -> Negative, _ :> Positive}
st = {StringTemplate["f() = <* f[#]*>."],
StringTemplate["f'() is <* sign[f'[#]]*>."]};

pt1 = Plot[g[x], {x, -1, 3}, PlotRange -> {-2, 6}, ImageSize -> 200];
pt2 = Manipulate[st[[p]][x],
{x, 0, 1},
{{p, 1}, {1 -> "Property 1", 2 -> "Property 2"}}];

Panel @ Row[{pt1, pt2}, Spacer] • Thanks. You must be a dreamy teacher in any classroom. – Binjiu Feb 23 '20 at 9:27
• Hi, is it possible to make an animation in the same picture with "Property 3" button, for e.g. making the point M running along the graph of g[x] from (0,1) to (1,-1) once "Property 3" taken action? Thanks. – Binjiu Feb 23 '20 at 9:42
• @Binjiu, if you want the animation in the manipulate panel, you can define st = {StringTemplate["f() = <* f[#]*>."], StringTemplate["f'() is <* sign[f'[#]]*>."], Animate[Show[pt1, Epilog -> {PointSize[Large], Point[{x, g[x]}]}], {x, 0, 1}, Paneled -> False]} and pt2 = Manipulate[p /. {3 -> st[], i_ :> st[[i]][x]}, {x, 0, 1}, {{p, 1}, {1 -> "Property 1", 2 -> "Property 2", 3 -> "Property 3"}}]; If you want the animation on the left panel, I cannot think of a simple modification of the current answer (maybe you can post it as a separate question). – kglr Feb 23 '20 at 9:59