# Drawing function intersection by using Manipulate

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}] 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}]

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