Difference in my and wolfram's integration. Calculate 
$$\int \frac{\sin ^3(x)+1}{\cos (x)+1} \, dx$$
Let $$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 tells that result ($=2$) is okay, but my integral is different from wolfram result: 
$$ \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) $$
Where I failed?

There's no error in your solution. Both results (yours and Wolfram's) are equal up to a constant (which for an indefinite integral is arbitrary). You can check that using the equalities
$$ \cos (5\alpha) = \cos^5 \alpha - 10\cos^3\alpha \sin\alpha + 5\cos\alpha \sin^4\alpha = 16\cos^5\alpha -20\cos^3\alpha + 5\cos\alpha$$
$$ \cos (3\alpha) = \cos^3\alpha - 3\cos\alpha\sin^2\alpha = 4\cos^3\alpha -3\cos\alpha$$
$$ \frac{1}{\tan^2\alpha +1} = \cos^2\alpha$$
$$ \sec\alpha = \frac{1}{\cos\alpha}$$
Just write both results using only $\cos(\frac{x}{2})$ and compare.
