# Given r = 2+sinθ, find the points on the given curve where tangent line is vert or horizontal

My actual question doesn't have to do with what's said in the title, I'm having trouble with the derivative portion.

This is from the solution:

Source: cramster.com

I am fine from the point I have to take the derivative of "r" and all the plugging in that goes on, but the step right after that is what I'm confused about. I can't figure out how they came up with the final step you see above in the picture. What simplifying was done to obtain that part?

-
Small typo - in the last denominator there's a $\sin^2$ that should be $\sin^2\theta$. –  Gerry Myerson Jul 17 '11 at 5:38
It doesn't seem complicated to me : $$\cos \theta \sin \theta + (2+\sin \theta) \cos \theta = \cos \theta ( \sin \theta + 2 + \sin \theta) = \cos \theta (2 + 2 \sin \theta) = 2 \cos \theta (1 + \sin \theta)$$ for the numerator, and \begin{align} \cos \theta \cos \theta - (2+ \sin \theta) \sin \theta & = \cos^2 \theta - 2 \sin \theta - \sin^2 \theta \\ & = 1 - \sin^2 \theta - 2 \sin \theta - \sin^2 \theta = 1 - 2 \sin \theta - 2 \sin^2 \theta. \end{align}