# How do you integrate (x^2 + x - 1) * (x^2 + x - 1)?

Mar 11, 2018

$\int \left({x}^{2} + x - 1\right) \left({x}^{2} + x - 1\right) \mathrm{dx} = {x}^{5} / 5 + {x}^{4} / 2 - {x}^{3} / 3 - {x}^{2} + x$

#### Explanation:

Usually, the best way to integrate polynomial functions is to do it the "brute" way. Firstly, let's calculate $\left({x}^{2} + x - 1\right) \left({x}^{2} + x - 1\right)$ :

$\left(\textcolor{red}{{x}^{2}} + \textcolor{b l u e}{x} - 1\right) \left({x}^{2} + x - 1\right) =$
$\textcolor{red}{{x}^{4} + {x}^{3} - {x}^{2}} + \textcolor{b l u e}{{x}^{3} + {x}^{2} - x} - {x}^{2} - x + 1$

This simplifies to ${x}^{4} + 2 {x}^{3} - {x}^{2} - 2 x + x$.

In order to integrate it, you have to use a few properties of integrations :

int color(red)(f(x))+color(blue)(g(x)) dx = color(red)(int f(x)dx) +color(blue)(int g(x)dx
$\int k f \left(x\right) \mathrm{dx} = k \int f \left(x\right) \mathrm{dx}$, if $k$ is a constant.

The initial integral has become

$\int \left({x}^{2} + x - 1\right) \left({x}^{2} + x - 1\right) \mathrm{dx} =$

$= \int \left({x}^{4} + 2 {x}^{3} - {x}^{2} - 2 x + 1\right) \mathrm{dx} =$

$= \int {x}^{4} \mathrm{dx} + 2 \int {x}^{3} - \int {x}^{2} - 2 \int x \mathrm{dx} + \int 1 \mathrm{dx}$

Now, we know that

$\int {x}^{\textcolor{red}{k}} \mathrm{dx} = {x}^{\textcolor{red}{k + 1}} / \textcolor{red}{k + 1}$

And finally, we have

${x}^{\textcolor{red}{5}} / \textcolor{red}{5} + 2 \cdot {x}^{\textcolor{red}{4}} / \textcolor{red}{4} - {x}^{\textcolor{red}{3}} / \textcolor{red}{3} - 2 \cdot {x}^{\textcolor{red}{2}} / \textcolor{red}{2} + x$.

The last one, $\int 1 \mathrm{dx}$ is equal to $x$ because $1 = {x}^{\textcolor{red}{0}}$, for all $x$.

So the integral of $\left({x}^{2} + x - 1\right) \left({x}^{2} + x - 1\right)$ is

color(red)(int(x^2+x-1)(x^2+x-1)dx = x^5/5 +x^4/2-x^3/3-x^2+x.