Find all extrema of a complicated trigonometric function Problem
Find all local extrema for
$$f(x) = \frac{\sin{3x}}{1+\frac{1}{2}\cos{3x}}$$
Attempted solution
My basic approach is to take the derivative, set the derivative equal to zero and solve for x.
Taking the derivative with the quotient rule and a few cases of the chain rule for the trigonometric functions with a final application of the Pythagorean identity:
$$f'(x) = \frac{(1+\frac{1}{2}\cos{3x})(3\cos{3x})+1.5\sin{3x}\sin {3x}}{(1+\frac{1}{2}\cos{3x})^2} = \frac{3\cos 3x+1.5\cos^2 3x + 1.5\sin^2 3x}{(1+\frac{1}{2}\cos 3x)^2} = \frac{3 \cos 3x + 1}{(1+\frac{1}{2}\cos 3x)^2}$$
Putting it equal to zero and solving for x:
$$3\cos 3x + 1 = 0 \Rightarrow x = \frac{\arccos{\Big(-\frac{1}{3}\Big)}}{3} = \frac{\pi}{6} + \frac{2\pi n}{3}$$
...however the expected answer is $\pm\frac{2\pi}{9} + \frac{2\pi n}{3}$
So I must have gone wrong somewhere.
 A: Looks like you have a problem with the differentiation.  You should have.
You dropped a factor of 3 in the right-hand term.  It should be $(\frac 32 \sin 3x)(\sin 3x)$ in the first line.
You have brought it back by the time you get to.
$3\cos 3x + 1.5\cos^2 3x + \frac 12 \sin^2 3x = 0$
But then $1.5$ becomes $1$ in the next line.
$3\cos 3x  + 1.5 = 0$
Solving for x:
$\cos3x = -\frac 12$

$3x = \pm\frac {2\pi}{3} + 2n\pi\\
x = \pm \frac {2\pi}{9} + \frac {2n\pi}{3}$
$x = \frac {2\pi}{9} + \frac {2n\pi}{3}$ are the maxima
and $x = -\frac {2\pi}{9} + \frac {2n\pi}{3}$ are the minima
A: It suffices to cancel the numerator of the derivative,
$$\cos(3x)(2+\cos(3x))+\sin(3x)\sin(3x)=2\cos(3x)+1=0$$
and
$$3x=2k\pi\pm\frac{2\pi}3.$$
A: It should be $$f'(x) = \frac{(1+\frac{1}{2}\cos{3x})(3\cos{3x})-\frac{3}{2}\sin{3x}\sin {3x}}{(1+\frac{1}{2}\cos{3x})^2}.$$ 
I like the following way.
Let $x=\frac{2\pi}{9}.$
Thus, we get a value $\frac{2}{\sqrt3}.$
We'll prove that it's a maximal value.
Indeed, we need to prove that
$$\frac{\sin3x}{2+\cos3x}\leq\frac{1}{\sqrt3}$$ or
$$\sqrt3\sin3x-\cos3x\leq2,$$ which is true by C-S:
$$\sqrt3\sin3x-\cos3x\leq\sqrt{((\sqrt3)^2+(-1)^2)(\sin^23x+\cos^23x)}=2.$$
By the same way we can get a minimal value.
I got $-\frac{2}{\sqrt3},$ which  occurs for $x=-\frac{2\pi}{9}.$
A: This function has period $\frac{2\pi}3$ and it is an odd function, so we need to determine its variations only on $\bigl[0,\frac\pi 3\bigr]$.
Now simplifying the derivative, you get
$$f'(x)=\frac{3\bigl(\frac12+\cos 3x\bigr)}{\bigl(1+\frac{1}{2}\cos{3x}\bigr)^2},$$
which has the sign of $\;\frac12+\cos 3x$, so we have to solve the inequation
$$\cos 3x>-\tfrac 12\quad\text{on}\quad \bigl[0,\tfrac\pi 3\bigr].$$
Can you continue?
