Trigonometry tangent line question How would I figure this out.
Find all x values between $0$ and $2\pi$ where the line tangent to the graph of
$y=\frac{\cos x}{2+ \sin(x)}$ is horizontal. 
I did the deriavative 
$\frac{(2+\sin(x)-\sin(x)+\cos(x)\cos(x)}{(2+\sin x)^2}$ but I think I need to find $x$
 A: The derivative seems to be incorrect:
$$\left(\frac{\cos x}{2+\sin x}\right)'=\frac{-\sin x(2+\sin x)-\cos^2x}{(2+\sin x)^2}=0\Longleftrightarrow -2\sin x-1=0\Longleftrightarrow$$
$$\sin x=-\frac{1}{2}\Longleftrightarrow x=\begin{cases}\frac{7\pi}{6}\\{}\\\frac{11\pi}{6}\end{cases}\;\;+2k\pi\;\;,\;\;k\in\Bbb Z\;\;\ldots$$
A: The denominator is nice and safe. The numerator is $(2+\sin x)(-\sin x)-\cos^2 x$. (There was a sign error here, and missing parentheses.) 
But $\cos^2 x=1-\sin^2 x$, so the numerator simplifies very nicely to $-2\sin x-1$. There are a couple of places (third quadrant, fourth quadrant) where this is $0$.
A: For a horizontal tangent line you need the derivative to be zero. After all, $\operatorname{d}\!y/\!\operatorname{d}\!x$ gives you the gradient of the tangent line to the graph $y=f(x)$. We are told that
$$y = \frac{\cos x}{2+\sin x}$$
Using the quotient rules, and the standard trig identity $\sin^2x+\cos^2x \equiv 1$ we see that
$$\frac{\operatorname{d}\!y}{\operatorname{d}\!x} = \frac{1+2\sin x}{\cos^2x-4\sin x-5} \equiv \frac{1+2\sin x}{(2+\sin x)^2}$$
Since $-1 \le \sin x \le 1$ for all real $x$ it follows that the horizontal tangent lines are gives by $1+2\sin x = 0$. In other words $\sin x = -\frac{1}{2}$. The principal value of which is $x=-\frac{\pi}{6}$. Plotting the graph of $y=\sin x$ and the line $y=-\frac{1}{2}$ can help to find the other solutions. We have:
$$x \in \left\{2\pi n - \frac{\pi}{6} : n \in \mathbb{Z} \right\} \cup \left\{(2n+1)\pi + \frac{\pi}{6} : n \in \mathbb{Z} \right\}$$
Restricting this to the interval $[0,2\pi]$ we have $x=\frac{7}{6}\pi$ and $x=\frac{11}{6}\pi$.
