MinimalBy
is an easy way.
yy[x_] = Sin[10 x^2] + 5 Cos[20 x];
d = Table[{x, yy[x]}, {x, 1, 5, 0.0001}];
{X, Y} = First@MinimalBy[d, Last]
{1.7278, -5.99996}
Edit
For a better overview one can do the same with a plot.
plot = Plot[yPlot[y[x], {x, 0, 5}, PlotPoints -> 500];
Determine the plot points.
p1 = Join @@ Cases[Normal@plot, Line[x1__] :> x1, Infinity];
{X, Y} = First@MinimalBy[p1, Last]
{1.72783, -5.99996}
Plot[yLength@p1
**8635**
Edit 2
plt = Plot[y[x], {x, 0, 5}, Mesh -> {{0}}, MeshFunctions -> {y'[#] &}, PlotPoints -> 500];
p2 = Cases[Normal[plt], Point[pt_] :> pt, Infinity];
{X, Y} = First@MinimalBy[p2, Last]
{1.72776, -5.99996}
Length@p2
**61**
To compare the number of points p1
and p2
, I chose the same number of plot points. @J.M. 's hint to add Mesh->{{0}},MeshFunctions->{y'[#]&}
in the plot greatly reduces the number of points in p2
.
Plot[y[x], {x, 0, 5}, Mesh -> {{0}}, MeshFunctions -> {y'[#] &},
MeshStyle -> PointSize[Medium], Epilog -> {Red, PointSize@Large, Point@{X, Y}}]
Thanks to @J.M. for pointing this out!