Finding the global maxima and minima on closed interval Given a function $f(\theta) = (4\theta-\pi)\sin(\theta)+4\cos(\theta)-2.$ I want to find a value  for $\theta$ in interval $\theta \in [0,\frac{\pi}{2}]$ such that for that value of $\theta$ my function has global maximum and minimum.
I took the derivative of the function which is equal $f'(\theta) = \cos(\theta)(4\theta-\pi)$.
Here i got two critical points which are $\frac{\pi}{4},\frac{\pi}{2}$.
I picked $\frac{\pi}{6}$ at the left of the crictical point $\frac{\pi}{4}$ and $\frac{\pi}{3}$ at the right of the critical point $\frac{\pi}{4}$ to see the behaviour of the function.
It seems that the function is decreasing on the interval $(0,\frac{\pi}{4})$ and increasing on the interval $(\frac{\pi}{4},\frac{\pi}{2})$ but $\frac{\pi}{2}$ is not included because it is also a critical point. I don't know how to deal with this kind of situation?
I tried to find the co-ordinates also and they are 
$f(0) = 2$
$f(\frac{\pi}{2}) = 1.141$
$f(\frac{\pi}{4}) = 0.82$
Is my global max at $(\theta = 0)$ and global min at $(\theta = \frac{\pi}{4})$?

Since you already found the critical points, why not apply the second derivative test ?
$$f'(\theta) = \cos(\theta)(4\theta-\pi)\implies f''(\theta) =4 \cos (\theta)-(4 \theta-\pi ) \sin (\theta)$$ from which
$$f''\left(\frac{\pi }{4}\right)=2 \sqrt{2}\color{red} {>0} \qquad \text{and} \qquad f''\left(\frac{\pi }{2}\right)=- \pi \color{red} {<0}$$ revealing that $\theta=\frac{\pi }{4}$ corresponds to a minimum and  $\theta=\frac{\pi }{2}$ corresponds to a maximum.
No need to plot the function or to compute anything.
