$$\int\frac{\sin(2x)}{2+\cos x} dx $$
Attempt: let $u = 2 + \cos x$. Then $du = -\sin x$. As we can see, $u - 2 = \cos x$, and $\sin(2x) = 2\sin x\cos x$. Using the change of variables method, we see that
$$\int\frac{\sin(2x)}{2+\cos x} dx = -2 \int(u-2)\frac{1}{u}du = -2 \int 1 - 2\frac{1}{u} du = -2 (u - 2\ln u) + C$$
After substituting for $u$, I get $4 \ln(2+ \cos x) - 2\cos x - 4 + C$. According to Wolfram Alpha, the solution is $4 \ln(2+ \cos x) - 2\cos x + C$. Not sure where my mistake is, but any help is greatly appreciated.
Nothing's wrong ! Put $u=\cos x +2$
$$-2 (u - 2\ln u) + C=4\ln u -2u +\mathrm C =4 \ln(2+ \cos x) - 2\cos x - 4 + \mathrm C.$$
So $$-4+\textrm C = \rm constant $$