Calcular $$\int \frac{\sin ^3(x)+1}{\cos (x)+1} \, dx$$
Deje $$u = \tan(x/2)$$ $\int \frac{\sin ^3(x)+1}{\cos (x)+1} \, dx = \int \frac{2\left(\frac{8u^3}{(u^2+1)^3}+1 \right)}{(u^2+1)\left( \frac{1-u^2}{u^2+1} + 1 \right)} \, du = \int \frac{8u^3}{(u^2+1)^3 } + 1 \, du$ $$ s := u^2 \wedge ds = 2u \, du $$ $ u + \int \frac{8su}{(s+1)^3 } (2u)^{-1} \, ds = u + 4\int \frac{s}{(s+1)^3 } \, ds = $ $ u + 4\int \frac{1}{(s+1)^2 } - \frac{1}{(s+1)^3 } \, ds = u + 4\left(\frac{-1}{s+1} +\frac{1}{2(s+1)^2} \right) + C =$ $ u + 4\left(\frac{-1}{u^2+1} +\frac{1}{2(u^2+1)^2} \right) + C = $ $ \tan(x/2) + 4\left(\frac{-1}{(\tan(x/2))^2+1} +\frac{1}{2((\tan(x/2))^2+1)^2} \right) + C := F(x)$
$$F(\pi/2) - F(-\pi/2) = 2 $$ Wolfram dice que el resultado ($=2$) está bien, pero mis integral es diferente a la de wolfram resultado: $$ \frac{1}{8} \sec \left(\frac{x}{2}\right) \left(8 \sin \left(\frac{x}{2}\right)-4 \cos \left(\frac{x}{2}\right)-3 \cos \left(\frac{3 x}{2}\right)+\cos \left(\frac{5 x}{2}\right)\right) $$ Donde he fallado?