<s>[INST] 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.
 [/INST] 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.
</s>