# Math Help - Intergration problem, absolute value

1. ## Intergration problem, absolute value

This is the problem:

$\int_{0}^{2}|x^{2}-x|$

Solution:

$|x^2-x| = x|x-1|$

$\int_{0}^{2}|x^{2}-x| = \int_{0}^{1} x(x-1) + \int_{1}^{2} x(x-1)$

$=/ \\ \int x(x-1) = x^2/2(x-1) - x^3/6 = x^3/2 - x^2/2 - x^3/6 \\ /\\ = [x^3/2 - x^2/2 - x^3/6]_{0}^{1} + [x^3/2 - x^2/2 - x^3/6]^{2}_{1} = 1$

This is the correct answer, however I was wondering why:

$\int_{0}^{1} x(x-1) + \int_{1}^{2} x(x-1) \neq \int_{0}^{1} x^2-x + \int_{1}^{2} x^2-x$

I got $\int_{0}^{1} x^2-x + \int_{1}^{2} x^2-x = 2/3$ , am I right?

2. ## Re: Intergration problem, absolute value

Originally Posted by Pettzon
This is the problem:

$\int_{0}^{2}|x^{2}-x|$

Solution:

$|x^2-x| = x|x-1|$

$\int_{0}^{2}|x^{2}-x| = \int_{0}^{1} x(x-1) + \int_{1}^{2} x(x-1)$

$=/ \\ \int x(x-1) = x^2/2(x-1) - x^3/6 = x^3/2 - x^2/2 - x^3/6 \\ /\\ = [x^3/2 - x^2/2 - x^3/6]_{0}^{1} + [x^3/2 - x^2/2 - x^3/6]^{2}_{1} = 1$

This is the correct answer, however I was wondering why:

$\int_{0}^{1} x(x-1) + \int_{1}^{2} x(x-1) \neq \int_{0}^{1} x^2-x + \int_{1}^{2} x^2-x$

I got $\int_{0}^{1} x^2-x + \int_{1}^{2} x^2-x = 2/3$ , am I right?
For starters, I think you'll find that $\displaystyle |x^2 - x| = |x||x - 1|$, not $\displaystyle x|x-1|$...

3. ## Re: Intergration problem, absolute value

Originally Posted by Pettzon
This is the problem:

$\int_{0}^{2}|x^{2}-x|$
$\int_{0}^{2}|x^{2}-x|=\int_{0}^{1}(x-x^2)+\int_{1}^{2}(x^2-x)$

4. ## Re: Intergration problem, absolute value

Originally Posted by Prove It
For starters, I think you'll find that $\displaystyle |x^2 - x| = |x||x - 1|$, not $\displaystyle x|x-1|$...
$|x^2 - x| = |x(x-1)| = x|x-1|$?

Originally Posted by Plato
$\int_{0}^{2}|x^{2}-x|=\int_{0}^{1}(x-x^2)+\int_{1}^{2}(x^2-x)$
Of course, thank you!

5. ## Re: Intergration problem, absolute value

Originally Posted by Pettzon
$|x^2 - x| = |x(x-1)| = x|x-1|$?

Of course, thank you!
Wrong, what if $\displaystyle x < 0$? It's impossible for $\displaystyle |x(x - 1)|$ to be negative, but $\displaystyle x|x - 1|$ would be.

The general rule is $\displaystyle |AB| = |A||B|$, so $\displaystyle |x(x-1)| = |x||x-1|$.

Anyway, for this integral, you should know that

\displaystyle \begin{align*}|x^2 - x| &= \begin{cases}x^2 - x\textrm{ if }x^2 - x \geq 0\\x - x^2\textrm{ if }x^2-x<0 \end{cases} \\ &= \begin{cases}x^2 - x\textrm{ if } x \leq 0 \textrm{ or }x \geq 1 \\ x - x^2 \textrm{ if }0 < x < 1\end{cases} \end{align*}

so that means

\displaystyle \begin{align*} \int_0^2{|x^2-x|\,dx} &= \int_0^1{|x^2-x|\,dx} + \int_1^2{|x^2-x|\,dx} \\ &= \int_0^1{x - x^2\,dx} + \int_1^2{x^2 - x\,dx} \end{align*}

6. ## Re: Intergration problem, absolute value

Originally Posted by Prove It
For starters, I think you'll find that $\displaystyle |x^2 - x| = |x||x - 1|$, not $\displaystyle x|x-1|$...
Originally Posted by Prove It
Wrong, what if $\displaystyle x < 0$? It's impossible for $\displaystyle |x(x - 1)|$ to be negative, but $\displaystyle x|x - 1|$ would be.

The general rule is $\displaystyle |AB| = |A||B|$, so $\displaystyle |x(x-1)| = |x||x-1|$.

Anyway, for this integral, you should know that

\displaystyle \begin{align*}|x^2 - x| &= \begin{cases}x^2 - x\textrm{ if }x^2 - x \geq 0\\x - x^2\textrm{ if }x^2-x<0 \end{cases} \\ &= \begin{cases}x^2 - x\textrm{ if } x \leq 0 \textrm{ or }x \geq 1 \\ x - x^2 \textrm{ if }0 < x < 1\end{cases} \end{align*}

so that means

\displaystyle \begin{align*} \int_0^2{|x^2-x|\,dx} &= \int_0^1{|x^2-x|\,dx} + \int_1^2{|x^2-x|\,dx} \\ &= \int_0^1{x - x^2\,dx} + \int_1^2{x^2 - x\,dx} \end{align*}
Ah, I see. Thanks a bunch!