How to get to the correct result for this integral?
Wolfram|Alpha is, as far as I know, the only website that gives the correct solution to this integral, $$ f(x) = \frac{\sqrt{\sqrt{\sqrt{2 \cos \left(5 \sqrt{x}+4\right)+2}+2}+2}}{\sqrt{x}} $$ $$ F(x) = \int f(x)\, dx$$ because deriving the function given as result we get to the original function.
This is the solution: $$ F(x) = \frac{1}{5} (-8) \sqrt{2} \sqrt{\cos \left(5 \sqrt{x}+4\right)+1} \sqrt{\sqrt{2} \sqrt{\cos \left(5 \sqrt{x}+4\right)+1}+2} \left(\sqrt{\sqrt{2} \sqrt{\cos \left(5 \sqrt{x}+4\right)+1}+2}-2\right) \sqrt{\sqrt{\sqrt{2} \sqrt{\cos \left(5 \sqrt{x}+4\right)+1}+2}+2} \csc \left(5 \sqrt{x}+4\right) + C $$
However, in this video, an incorrect result is given although the integration process seems correct. As above, you know that the result is incorrect since deriving the resulting function doesn't result in the original function we wanted to integrate.
I need to get to the correct result, but I don't know how.
Edit: Wolfram|Alpha developers have hidden the solution from the original link, so now to see it you have to ask the question in form of a differential equation.
This is a partial solution, equivalent to the process used in the video, which is only valid if $$\cos\frac t2$$ is non-negative.
Start with this identity:
$$\sqrt{2+2\cos t} = \sqrt{4\cos^2\frac t2} = 2\cos\frac t2$$ For applying this to the integrand, first make the substitution $t = \sqrt x$, then successively apply this property. $$\begin{gather} I = \int\sqrt{2 + \sqrt{2 + \sqrt{2 + 2\cos(5t+4)}}}\cdot 2dt\\ = \int\sqrt{2 + \sqrt{2+2\cos\left(\frac{5t+4}{2}\right)}} \cdot 2 dt\\ = \int\sqrt{2 + 2\cos\left( \frac{5t+4}{4}\right)} \cdot 2dt \\ = \int 4\cos\left(\frac{5t+4}{8}\right) dt \\ = \frac{32}{5}\sin\left( \frac{5\sqrt x + 4}{8} \right) + C \end{gather}$$