[Math] Integration by parts : $\int 2x \cos(x^2 + 1) dx$

integration

What is $\int 2x \cos(x^2 + 1) dx$? ok, so this is driving me crazy. I use integration by parts so:
$$\int f(x)g'(x)dx = f(x)g(x)-\int f'(x)g(x)dx$$
$$f(x)= 2x \qquad g(x)=\cos(x^2+1)$$
$$f'(x)=2 \qquad g'(x)=-2x\sin(x^2+1)$$
Now I apply the formula( as only one side of the equation is enough I will do that on the right hand site of it i.e: $f(x)g(x)-\int f'(x)g(x)dx$ so:
$$2x * \cos(x^2+1) – \int 2 * \cos(x^2+1)dx$$
now I find myself pretty much on the same spot I was before. What am I doing wrong? I am just following step by step the formula…

Then, not sure if related or not, but watching videos on youtube about that I found the following $\int e^{2x} * \sin(x) dx$,

the guy uses the formula $uv-\int vdu$

So, he takes $u=e^{2x}$ and $u'=2e^{2x}$

I agree with him so far but then he goes and $v = -\cos x$ and $du = \sin x dx$

why is he doing that?? I would put $v=\sin(x)$ and $v'= \cos(x)$

I see he is differentiating my $v$ for some reason , or trying top, as the derivative of

$\sin(x)$ is $\cos(x)$ not $-\cos(x)$….why is all that about? why isnt he following the formula?

people seem to be happy in their comments with what he does, so it must make sense

somehow.. he ends up writing: $-e^{2x}*\cos(x) + 2 \int e^x \cos (x) dx$

I would have writtn instead, $e^{2x}*\sin(x)-\int\sin(x)*2e^{2x}$…so totally different… again

why?? I am just sticking to the formula….

Best Answer

You don't need to use integration by parts. Consider $$z=x^2+1,$$ then, $$dz=2xdx.$$ Thus, $$\int 2x\cos(x^2+1)dx=\int \cos(z)dz=\sin(z)=\sin(x^2+1).$$