5

Let $f(x)=\sin(x)x^2$. If you were to do integration by parts you would get:

$$\int \sin(x)x^2dx=\int\sin(x)dx\times x^2-\iint\sin(x)dx\times\frac{d}{dx}x^2dx$$

$$\int \sin(x)x^2dx=-\cos(x)x^2-\int-2\cos(x)xdx$$

$$\int\sin(x)x^2dx=-\cos(x)x^2+2(\int\cos(x)dx\times x-\iint\cos(x)dx\times\frac{d}{dx}xdx)$$

$$\int\sin(x)x^2dx=-\cos(x)x^2+2(\sin(x)x+\cos(x))+C$$

The part that I don't understand is why do we add the constant only at the end? For example, in row #$1$ you need to find the $\int \sin(x)dx$. We take it to be $-\cos(x)$ but in reality, it is $-\cos(x)+C_1$. If you were to compute this with $\int \sin(x)dx=-\cos(x)+C_1$, you would get the wrong result because $\int \sin(x)dx$ needs to be integrated again, and $C_1$ would turn in $x$, therefore you would get the wrong result. How do we know that $C_1=0$? I get that the solution will be correct that way, but why?

  • 2
    When you look for antiderivatives, you just need ti find ONE of them. each of The others is obtained by adding some constant. – hamam_Abdallah Jun 10 '20 at 21:27
  • 1
    i know but why do we use the one where $C_1$ is specifically $0$? –  Jun 10 '20 at 21:28
  • 1
    To make things easier. If you want you can take $C_1=\ln(\pi+\sqrt{3})$. – hamam_Abdallah Jun 10 '20 at 21:29
  • but then you get an additional $x^2$ in the answer. If you were to take the derivative of that, you would get a completely separate function. –  Jun 10 '20 at 21:34
  • 2
    If you take the integral of sin(x) to be -cos(x)+C1, you must do that in both parts of the integration by parts. The two terms involving C1 will then cancel. – Michael Cohen Jun 10 '20 at 21:36
  • 1
    See https://math.stackexchange.com/questions/26869/constants-of-integration-in-integration-by-parts – Math2718 Jun 12 '20 at 00:38

3 Answers3

4

The familiar formula for integration by parts is $$\int udv= uv-\int vdu $$

Now if you like to add a constant to your $v$ you get $$\int udv= u(v+c)-\int (v+c)du = uv+uc-\int vdu -c\int du = $$

$$uv+uc-\int vdu -cu = uv- \int vdu $$

Which is exactly the same result due to cancelation of $cu$ and -$cu$

2

Let's keep those $C_{i}$'s in those steps and show you that things still cancel out:

$$\int{x^{2}sinxdx}=-x^{2}cosx+C_{1}x^{2}-2C_{1}\int{xdx}+2\int{xcosxdx}$$

We get $$\int{x^{2}sinxdx}=-x^{2}cosx+C_{1}x^{2}-2C_{1}\int{xdx}+2xsinx+2C_{2}x-2\int{sinxdx}-2C_{2}\int{dx}$$

Then $$\int{x^{2}sinxdx}=-x^{2}cosx+C_{1}x^{2}-C_{1}(2)\frac{x^{2}}{2}+C_{3}+2xsinx+2xC_{2}+2cosx+C_{4}-2C_{2}x+C_{5}$$

Collection of like terms and letting $C=C_{3}+C_{4}+C_{5}$, we get $$\int{x^{2}sinxdx}=-x^{2}cosx+2xsinx+2cosx+C$$

Percy
  • 214
2

For $f $ and $ g$ $ C^1$ at some intervalle,

The integration by parts is based on the identity $$(fg)'=f'g + fg'$$

which yields to

$$\int f'g = fg - \int fg'$$

If you write

$$\int f'g = (f+C_1)g - \int fg'$$ the result will be false.

You should write

$$\int f'g = (f+C_1)g - \int (f+C_1)g'$$ To satisfy the first identity.