Integration by parts with polynomial formula proof

Calculate $$\int(x^3+x^2)(\sin x)\cdot\mathrm{d}{x}$$

There's an easy way to solve that kind of integrals:

$$\int (p\left(x\right))(f\left(x\right))\cdot\mathrm{d}{x}$$

Where $$p\left(x\right)$$ is a polynomial and $$f\left(x\right)$$ is a function.

The formula is $$\int (p\left(x\right))(f\left(x\right))\cdot\mathrm{d}{x}=\sum_{i=1} ^\infty ((-1)^{i+1}(p^{(i-1)})(f_{(i)}))+constant$$

where $$a^{(n)}$$ is $$n$$th derivative of $$a$$, $$a_{(n)}$$ is $$n$$th integral of $$a$$.

When we use the formula, we can see that the inegral $$\int(x^3+x^2)(\sin x)\cdot\mathrm{d}{x}$$ is equal to $$(x^3+x^2)(-\cos x)-(3x^2+2x)(-\sin x) + (6x+2)(\cos x)-(6)(\sin x)$$

I'm trying to prove that formula, but I don't know where to start from. I know that if this formula didn't exist, I should break it into parts, $$x^3 \sin x$$ and $$x^2 \sin x$$ then do $$u = x^2$$ or $$u = x^3$$ for both parts and $$\sin x = \mathrm{d}{v}$$ but I don't know how to use them to derive this formula.

• If you solve $\int p(x) f(x)dx$ where $p$ is a polynomial and $f$ is any function then for any function $g$ you solve $\int g(x)dx=\int p(x)\dfrac{g(x)}{p(x)}dx.$
– mfl
Sep 2, 2017 at 17:14

We prove it using induction over the degree of $p$. In all steps the constant of integration will be skipped.
When $p$ has degree $0$ it is just a constant, so $$\int p(x) f(x) \, dx = p(x) \int f(x) \, dx = p^{(0)}(x) f_{(1)}(x) = \sum_{k=1}^{\infty} (-1)^{i+1} p^{(i-1)}(x) f_{(i)}(x)$$ since $p^{(i-2)} = p^{(i-3)} = p^{(i-4)} = \cdots = 0.$
Now assume that the formula is valid for a polynomial of degree $n$. We will show that it is then valid for a polynomial of degree $n+1$. Thus, assume that $p$ is of degree $n+1$. Integrating by parts and applying the formula to $\int p^{(1)}(x) f_{(1)}(x) \, dx$ gives, $$\int p(x) f(x) \, dx = p(x) f_{(1)}(x) - \int p^{(1)}(x) f_{(1)}(x) \, dx \\ = p^{(0)}(x) f_{(1)}(x) - \sum_{k=1}^{\infty} (-1)^{i+1} p^{(i)}(x) f_{(i+1)}(x) \\ = p^{(0)}(x) f_{(1)}(x) - \sum_{k=2}^{\infty} (-1)^{i} p^{(i-1)}(x) f_{(i)}(x) \\ = p^{(0)}(x) f_{(1)}(x) + \sum_{k=2}^{\infty} (-1)^{i+1} p^{(i-1)}(x) f_{(i)}(x) \\ = \sum_{k=1}^{\infty} (-1)^{i+1} p^{(i-1)}(x) f_{(i)}(x) \\$$
you can also write $$\int x^3\sin(x)dx$$ and $$\int x^2\sin(x)dx$$
• It is enough to work with $\int x^{k} f(x) dx$. It is reasonable to try it for the first smaller n values. Sep 2, 2017 at 17:13