# List of critical points

In TI-Nspire CX CAS, writing:

exp▶list(fMax(sin(x),x,0,10),x)

I get:

{((π)/(2)),((5*π)/(2))}

while in Wolfram Mathematica, writing:

Maximize[{Sin[x], 0 <= x <= 10}, x]

I get:

{1, {x -> π/2}}

Is there a way to get the result above?

Reduce[{Sin'[x] == 0, Sin''[x] <= 0, 0 <= x <= 10}, x, Reals]

x == π/2 || x == (5 π)/2

List @@ %

{x == π/2, x == (5 π)/2}

Alternatively,

Solve[{Sin'[x] == 0, Sin''[x] <= 0, 0 <= x <= 10}, x, Reals]

{{x -> π/2}, {x -> (5 π)/2}}

x /. %

{π/2, (5 π)/2}

or

x /. {ToRules[Reduce[{Sin'[x] == 0, Sin''[x] <= 0, 0 <= x <= 10}, x, Reals]]}

{π/2, (5 π)/2}

I would use MaxValue in combination with Solve:

maxima[{expr_, cond_}, v_] := With[{m = MaxValue[{expr, cond}, v]},
DeleteDuplicates @ Solve[expr == m && cond, v]
]

maxima[{Sin[x], 0<=x<=10}, x]

{{x -> π/2}, {x -> (5 π)/2}}

Contrast this with the approach in kglr's answer that only looks at critical points:

maxima[{Sin[x], -1 <= x <= 1}, x]

Reduce[{Sin'[x]==0,Sin''[x]<=0,-1<=x<=1},x,Reals]

{{x -> 1}}

False