3
$\begingroup$

You want to use Manipulate to draw the intersection of dynamic functions, but there are two problems 1.More than two unrelated points

    Clear[f]
Manipulate[f[x_] := Sqrt[Exp[x] + x - a]; 
Plot[{f[f[Sin[x]]], Sin[x]}, {x, 0, 4}, PlotRange -> {0, 4}, 
AxesOrigin -> {0, 0}, 
MeshFunctions -> {(f[f[Sin[x]]] - Sin[x]) /. {x -> #, 
a -> Dynamic@a} &}, Mesh -> {{0}}, 
MeshStyle -> PointSize[Large]], {a, E^(-1) - 1, E + 1}, 
TrackedSymbols :> {a}]

enter image description here

2.The problem is that the initial intersection does not display and runs slowly.

  Clear[f, g]
f[x_, a_] := Sqrt[Exp[x] + x - a]
Manipulate[
Plot[{f[f[Sin[x], a], a], Sin[x]}, {x, 0, 4}, PlotRange -> {0, 4}, 
AxesOrigin -> {0, 0}, 
Epilog -> {PointSize[Large], 
If[NSolve[f[f[Sin[x], a], a] == Sin[x] && 0 < x < 4, x] == {}, 
Null, (Point[{#, f[f[Sin[x], a], a] /. x -> #}] &) /@ (x /. 
NSolve[f[f[Sin[x], a], a] == Sin[x] && 0 < x < 4, x])]}], {a, 
E^(-1) - 1, E + 1}, TrackedSymbols :> {a}]

enter image description here enter image description here

$\endgroup$
  • 1
    $\begingroup$ for (1), perhaps changing the MeshFunctions -> .. to MeshFunctions -> {(f[Re@f[Sin[#]]] - Sin[#]) &}? $\endgroup$ – kglr Jan 6 '18 at 11:09
  • $\begingroup$ The effect meets the requirement, thank you. $\endgroup$ – Go with the wind Jan 6 '18 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.