Finding all the minima and maxima within a range I'm not sure how to find all the maximas and minimas where the range is $1≤x≤18$ and the function is: $$20\sin \left(\fracπ6x-\frac {2\pi}3\right)+22$$ I already found the first derivative which is: $$\frac{10\pi}3\cos\left(\frac{\pi}{6}x-\frac{2\pi}{3}\right)=0$$ where $x$ is $7$ and using $f''(x)$ and subbing in my $x$, I get $-5.48$ which is a maximum.
 A: One approach might be to note that the maxima of $20\sin(\frac{\pi}{6}x-\frac{2\pi}{3})+22$ correspond to the maximum values of the sine function. The maxima of $sin(x)$ occur when $x=\frac{\pi}{2}+2n\pi$ with $n\in\mathbb{Z}$.
This means $\frac{\pi}{6}x-\frac{2\pi}{3}=\frac{\pi}{2}+2n\pi\implies\frac{1}{6}x-\frac{2}{3}=\frac{1}{2}+2n\implies x=7+12n$.  Which yields $x$ of $7$ giving a value of $42$.
By a similar method, the minima are at $x=1$ and $x=13$ with values of 2.
A: To simplify the problem, put $u = \dfrac{\pi}{6}x-\dfrac{2\pi}{3}$, then you have a much better function to deal with: $f(u) = 20\sin u + 22, -\dfrac{\pi}{2} \le u \le \dfrac{7\pi}{3}$. Since $-1 \le \sin u \le 1$, so $2 \le f(u) \le 42$, and the min and max are $2, 42$ respectively. The min occurs when $u = -\dfrac{\pi}{2} \implies \dfrac{\pi}{6}x - \dfrac{2\pi}{3} = -\dfrac{\pi}{2} \implies x = 1$, and the max occurs when $ u = \dfrac{\pi}{2} \implies \dfrac{\pi}{6}x - \dfrac{2\pi}{3} = \dfrac{\pi}{2} \implies x = 7$.
