Qurak

Find a local minimum

Example 4 steps, run in order in one session. Every step was executed against the engine and the output below is what it produced.

Step 1
Plot[x Cos[x], {x, 0, 20}]
Output
-Graphics-
Step 2
min = FindMinimum[x Cos[x], {x, 2}]
Output
{-3.2883713955908966, {x -> 3.4256184594817283}}
Step 3
pt = Reverse[Cases[min, _ ? NumberQ, Infinity]]
Output
{3.4256184594817283, -3.2883713955908966}
Step 4
Plot[x Cos[x], {x, 0, 20}, Epilog -> {PointSize[Medium], Point[pt]}]
Output
-Graphics-

Functions used

Related recipes

All recipes · Function reference · Use this from an MCP client