3
$\begingroup$

Suppose I want to plot this

Plot[{x^2, Exp[-x]}, {x, 0, 1}] 

what code reaches me to the following image? I mean a plot where cross point has been determined by a vertical line on the x-axe and the corresponding value. enter image description here

$\endgroup$
0

2 Answers 2

5
$\begingroup$
Clear[plot, pt, x0]; plot = Plot[{x^2, Exp[-x]}, {x, 0, 1}]; pt = Graphics`Mesh`FindIntersections[plot] Show[plot, Graphics[ x0 = pt[[1, 1]]; {Point[pt], Dashed, Red, Line[{pt[[1]], {x0, 0}}], Text[DecimalForm[x0, 1], {x0, 0}, {0, 2}]}], PlotRangePadding -> .1] 

{{0.703429, 0.494909}}

enter image description here

$\endgroup$
0
4
$\begingroup$
Clear["Global`*"] 

The exact value of x at the intersection is

sol = Solve[x^2 == Exp[-x], x, Reals] (* {{x -> 2 ProductLog[1/2]}} *) 

or approximately,

sol[[1]] // N (* {x -> 0.703467} *) 

The point of intersection is

pt = {x, x^2} /. sol[[1]]; Plot[{x^2, Exp[-x]}, {x, 0, 1}, Epilog -> { Red, AbsolutePointSize[4], Point[pt], Dashed, Line[{pt, {x, 0} /. sol[[1]]}]}] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.