# Show intersection points between a curve and a line [duplicate]

I'm pretty new to Mathematica. I'd like to show the intersection points in my graphic. These are my inputs:

f[y_] := -10 x^2 + 4000 x;
NSolve[f[y] == 144000, x];
Plot[{f[y], 144000}, {x, 0, 400}, PlotRange -> {0, 400000}]

• Does anyone know how to show on the plot (permanently and/or as tooltips) both the Letters and Values of the intersection points? Thanks again for your kind and qualified answers! puckie Dec 12, 2015 at 23:46

Or, hitting this tiny nail with a sledge-hammer,

f[x_] := -10 x^2 + 4000 x;
Plot[{f[x], 144000}, {x, 0, 400}, PlotRange -> {0, 400000},
MeshFunctions -> {f[#] - 144000 &}, Mesh -> {{0.}}, MeshStyle -> {Red, PointSize[0.02]}] See the documentation page for MeshFunctions. It's the third example.

• I don't consider this a sledgehammer at all. Everything's in the Plot[], without the need for an explicit equation-solving detour. Dec 12, 2015 at 9:33
• Very simple and effective solution! Exactly what I needed as a beginner ;-) Many Thanks! Dec 12, 2015 at 23:36
• @Narasimham. What is your "simply perfect" in reference to? What is that code about? Dec 14, 2015 at 7:00
• It was a comment in a reply to my question in Mathematica." Surface MeshFunction with independently spaced parameters". It was commented here wrongly. Thanks for pointing out the misplaced comment. Apologies caused due to my error, shall be deleting it. Dec 15, 2015 at 8:56
f[y_] := -10 y^2 + 4000 y;
sol = NSolve[f[x] == 144000, x];
Plot[{f[x], 144000}, {x, 0, 400}, PlotRange -> {0, 400000},
Epilog -> {PointSize[Large], (Point[{x, f[x]}] /. sol)}] With an adjustable threshold level using Manipulate. The Tooltip shows the exact values.

f[y_] := -10 y^2 + 4000 y;

Manipulate[
Column[{
(pts = Simplify[{x, f[x]} /. Solve[f[x] == t, x]]) // N,
Plot[{f[x], t}, {x, 0, 400},
Epilog -> {Red, PointSize[Large],
Tooltip[Point[#], #] & /@ pts},
ImageSize -> 360]}],
{{t, 144000, "Threshold"}, 0, 400000, 2000,
Appearance -> "Labeled"}] • Excellent solution! Best solution! I'll definitely use it in my plots. Thanks! Dec 12, 2015 at 23:40
R1 = ParametricRegion[{x, -10 x^2 + 4000 x}, {{x, 0, 400}}];
R2 = ParametricRegion[{x, 144000}, {{x, 0, 400}}];

sol = Point[x /. Solve[x \[Element] R1 && x \[Element] R2, x]]


Point[{{40, 144000}, {360, 144000}}]

RegionPlot[{R1, R2},
PlotRange -> {{0, 400}, {0, 400000}},
Epilog -> {Red, PointSize[0.02], sol},
AspectRatio -> 1/GoldenRatio] • This is a conceptually a good solution since it involves parametrization. I'll use it when I'll be able to understand it fully (such as the meaning of [Elements] and more...). Many thanks! Dec 12, 2015 at 23:44