I get confused on what derivative should be taken for defining relative maxima and absolute maxima because some sources said to use first derivative while the others said to use second derivative.
Also is relative maxima same as local maxima?
I really need detail with prove or example about them.
The first derivative is used to detect critical points. Find where the first derivative is zero or undefined. These critical points can be local maxima, local minima, and inflection points.
Now that you have a list of critical points, you want to know which of them are maxima, which are minima, and which are critical points. For this you need(*) the second derivative. If the second derivative is strictly positive, you have a local minimum. If strictly negative, a local maximum. If zero, you can't tell; the critical point could still be any of the three cases.
"relative maximum" and "local maximum" are synonyms.
(*) You don't really need the second derivative, this is just one way. Another way is to look at the sign pattern of the first derivative. If it goes from negative, to zero, to positive, then you have a local minimum. If from positive, to zero, to negative, then you have a local maximum. If from positive, to zero, to positive, then you have an inflection point.