# Thread: integration by parts

1. ## integration by parts

I need to prove:

I(subscript 2k)=integral[-1,1](x^2k)*(cos(pi*x))dx

is equal to

I(subscript 2k)=-(4k/pi^2)-((2k)(2k-1)/(pi^2))*I(subscript 2k-2)

but i keep getting

I(subscript 2k)=-(4k/pi^2)+((2k)(2k-1)/(pi^2))*I(subscript 2k-2)

can anyone help?

2. $\displaystyle\int_{-1}^1x^{2k}\cos\pi xdx=\int_{-1}^1x^{2k}\left(\frac{\sin\pi x}{\pi}\right)'dx=$
$\displaystyle =\left.\frac{1}{\pi}x^{2k}\sin\pi x\right|_{-1}^1-\frac{2k}{\pi}\int_{-1}^1x^{2k-1}\sin\pi xdx=$
$\displaystyle =\frac{2k}{\pi}\int_{-1}^1x^{2k-1}\left(\frac{\cos\pi x}{\pi}\right)'dx=$
$\displaystyle =\left. \frac{2k}{\pi^2}x^{2k-1}\cos\pi x\right|_{-1}^1-\frac{2k(2k-1)}{\pi^2}I_{2k-2}=-\frac{4k}{\pi^2}-\frac{2k(2k-1)}{\pi^2}I_{2k-2}$

Edited.

3. Thanks,

but this is not the solution that I need to prove,

I need to prove the first version of the proof,

but I keep getting the second???

4. Originally Posted by ubhik
I need to prove:

I(subscript 2k)=integral[-1,1](x^2k)*(cos(pi*x))dx

is equal to

I(subscript 2k)=-(4k/pi^2)-((2k)(2k-1)/(pi^2))*I(subscript 2k-2)

but i keep getting

I(subscript 2k)=-(4k/pi^2)+((2k)(2k-1)/(pi^2))*I(subscript 2k-2)

can anyone help?
Here, if you have any questions please say so. I think you just mixed up the signs somewhere when you had to multiply the second integral by $- \frac {2k}{\pi}$

$I_{2k} = \int_{-1}^{1} x^{2k} \cos ( \pi x)~dx$

Using integration by parts with $u = x^{2k}$ and $dv = \cos ( \pi x)$, we get:

$I_{2k} = \left. \frac {x^{2k}}{\pi} \sin ( \pi x) \right|_{-1}^{1} - \frac {2k}{\pi} \int_{-1}^{1} x^{2k - 1} \sin ( \pi x )~dx$

$= - \frac {2k}{\pi} \int_{-1}^{1} x^{2k - 1} \sin ( \pi x )~dx$

Again, using by parts with $u = x^{2k - 1}$ and $dv = \sin( \pi x)$, we get:

$I_{2k} = - \frac {2k}{\pi} \left[ \left. - \frac {x^{2k - 1}}{\pi} \cos (\pi x) \right|_{-1}^{1} + \frac {2k - 1}{\pi} { \color {red} \int_{-1}^{1} x^{2k - 2} \cos (\pi x )~dx} \right]$ .........Note, the red is $I_{2k - 2}$

$= \left. \frac {2kx^{2k - 1}}{\pi^2} \cos (\pi x) \right|_{-1}^{1} - \frac {2k(2k - 1)}{\pi^2} I_{2k - 2}$

$= \frac {-4k}{\pi^2} - \frac {2k(2k - 1)}{\pi^2} I_{2k - 2}$

as desired

5. I was also wrong!
I edited. See again my previous post.

6. Thank you, thats brilliant!