In book it is written that sin(x) has both local max and global max at $\pi/2$ but the highest value sin can have is $1$ and that is at $\pi/2$. Should not it be only global maximum?
[Math] Local max and global max of sin
maxima-minima
Related Solutions
Great question.
First note that to some degree this is about conventions and not mathematical correctness, so there is not necessarily one right answer to the query.
That said, I think some points should be clarified. (I will use your example throughout)
With respect to the interval $[0,3]$ both endpoints must be local extrema. With respect to the entire domain the of the function ($\mathbb{R}$ in this case) both endpoints are not necessarily extrema, because they may or may not be the largest/smallest values of the function over the interval $[0,3]$. So it depends on what you are taking to be the "domain" of the function. In this sense the first and fourth books basically agree.
I'm not entirely sure what books 2 and 3 are getting at by "now allowing endpoint extrema". Whether or not you say the function is differentiable at the endpoints, as mentioned above, depends on whether you are restricting the domain of the function to the interval or not. But either way, the endpoints can certainly have the highest or lowest values of the function over the interval.
So in general: differentiate and set equal to $0$ to find "critical points". Then determine what local extrema lie inside the interval. Then check boundary points (in this case the two endpoints of the interval, in multi-variable calculus you will have to use Lagrange multipliers or a similar technique). Compare internal critical points and boundary points to find the absolute extrema (max and min) over the interval.
I think in general it is most consistent with mathematical convention to refer to the points of extrema as "extrema", whether or not they are at the endpoints.
Step 1 is just part of the whole story. And you are right that Step 1 would give points that are not absolute min/max. That's exactly why you need Step 2 and Step 3.
In the case of $f(x)=x^3$ (say in $[-1,1]$), it is true that you will get $x=0$ as a critical number. However, Step 2 and Step 3 will rule it out.
[Added to answer the question in the comment:] Because global min/max must also be local min/max. If a critical point is not a local min/max, then it cannot be global min/max.
Best Answer
A global maximum is always a local maximum but the inverse doesn't always happen to be true.