Hard integral to find
Solution 1:
$$\int\left(\frac{1}{2}\left((\cos(2x)+1)\left(\frac{2\tanh^{-1}(x^2)}{\cos(2x)+1}+\cos(x)+\sin^2(x)\right)\right)\right)dx=$$ $$\frac{1}{2}\int\left((\cos(2x)+1)\left(\frac{2\tanh^{-1}(x^2)}{\cos(2x)+1}+\cos(x)+\sin^2(x)\right)\right)dx=$$ $$\frac{1}{2}\int\left((\cos(2x)+1)\left(\tanh^{-1}(x^2)\sec^2(x)+\cos(x)+\sin^2(x)\right)\right)dx=$$ $$\frac{1}{2}\int\left(2\cos^2(x)\left(\tanh^{-1}(x^2)\sec^2(x)+\cos(x)+\sin^2(x)\right)\right)dx=$$ $$\frac{1}{2}\cdot 2\int\left(\cos^2(x)\left(\tanh^{-1}(x^2)\sec^2(x)+\cos(x)+\sin^2(x)\right)\right)dx=$$ $$\int\left(\cos^2(x)\left(\tanh^{-1}(x^2)\sec^2(x)+\cos(x)+\sin^2(x)\right)\right)dx=$$ $$\int\left(\tanh^{-1}(x^2)+\cos^3(x)+\frac{1}{4}\sin^2(x)\right)dx=$$ $$\int\left(\tanh^{-1}(x^2)\right)dx+\int\left(\cos^3(x)\right)dx+\int\left(\frac{1}{4}\sin^2(x)\right)dx=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\int\sin^2(x)dx=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\int\left(\frac{1}{2}-\frac{1}{2}\cos(2x)\right)dx=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\left(\frac{1}{2}\int\left(1\right)dx-\frac{1}{2}\int\left(\cos(2x)\right)dx\right)=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\left(\frac{x}{2}-\frac{1}{2}\int\left(\cos(2x)\right)dx\right)=$$
Substitute $u=2x$ and $du=2dx$:
$$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\left(\frac{x}{2}-\frac{1}{4}\int\left(\cos(u)\right)du\right)=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\left(\frac{x}{2}-\frac{\sin(u)}{4}\right)=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{1}{4}\left(\frac{x}{2}-\frac{\sin(2x)}{4}\right)=$$ $$\int\tanh^{-1}(x^2)dx+\int\cos^3(x)dx+\frac{2x-\sin(2x)}{16}=$$ $$\int\tanh^{-1}(x^2)dx+\frac{\sin(x)\cos^2(x)}{3}+\frac{2}{3}\int\cos(x)dx+\frac{2x-\sin(2x)}{16}=$$ $$\int\tanh^{-1}(x^2)dx+\frac{\sin(x)\cos^2(x)}{3}+\frac{2\sin(x)}{3}+\frac{2x-\sin(2x)}{16}=$$ $$\int\tanh^{-1}(x^2)dx+\frac{9\sin(x)+\sin(3x)}{12}+\frac{2x-\sin(2x)}{16}=$$ $$x\tanh^{-1}(x^2)-\int\frac{2x^2}{1-x^4}dx+\frac{9\sin(x)+\sin(3x)}{12}+\frac{2x-\sin(2x)}{16}=$$ $$x\tanh^{-1}(x^2)-2\int\frac{x^2}{1-x^4}dx+\frac{9\sin(x)+\sin(3x)}{12}+\frac{2x-\sin(2x)}{16}=$$ $$x\tanh^{-1}(x^2)+2\int\frac{x^2}{x^4-1}dx+\frac{9\sin(x)+\sin(3x)}{12}+\frac{2x-\sin(2x)}{16}=$$ $$x\tanh^{-1}(x^2)+2\left(\int\left(\frac{1}{2(x^2+1)}-\frac{1}{4(x+1)}+\frac{1}{4(x-1)}\right)dx\right)+\frac{9\sin(x)+\sin(3x)}{12}+\frac{2x-\sin(2x)}{16}=$$ $$x\tanh^{-1}(x^2)+\frac{\ln|1-x|-\ln|x+1|+2\tan^{-1}(x)}{2}+\frac{9\sin(x)+\sin(3x)}{12}+\frac{2x-\sin(2x)}{16}+C$$