0
$\begingroup$
Clear[a]
Manipulate[
  Plot[ a*x^2 + 2*x + a, {x, -40, 40}, PlotRange -> {-15, 15}], 
  {a, -10, 10}]

I want to mark the minimum value in this range with a blue coloured dot, how can I do this? I tried using MeshStyle, but it doesn't work.

$\endgroup$
3
  • $\begingroup$ Minimum value or extrema (max or min)? Depending on $a$ your function can have either. $\endgroup$ – Vitaliy Kaurov Oct 19 '20 at 21:13
  • $\begingroup$ Minimum or maximum depending on which one goes the farthest $\endgroup$ – Aran Oct 19 '20 at 21:41
  • 5
    $\begingroup$ Does this answer your question? adding a point in a manipulate command $\endgroup$ – N0va Oct 19 '20 at 22:04
3
$\begingroup$

You can simply plot the extremum point with Epilog inside Plot as you know it exactly. For more complicated functions you might need to use FindMinimum etc. to give you the value.

Manipulate[
Plot[a x^2+2x+a,{x,-40,40}, 
Epilog->{Blue,PointSize[.015],Point[{-1/a,(-1 + a^2)/a}]},
PlotRange -> {-15, 15}], 
{{a,.1}, -10, 10,.003}]
$\endgroup$
2
  • $\begingroup$ i wanted to ask, why do we add -1/a,(-1 + a^2)/a? what does it give and how? thanks $\endgroup$ – Aran Oct 19 '20 at 22:19
  • $\begingroup$ @Aran as I said in the post it is the coordinate of extremum (max or min). $\endgroup$ – Vitaliy Kaurov Oct 19 '20 at 22:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.