# Thread: Intergration problem, absolute value

1. ## Intergration problem, absolute value

This is the problem:

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

Solution:

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

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

$\displaystyle =/ \\ \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:

$\displaystyle \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 $\displaystyle \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:

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

Solution:

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

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

$\displaystyle =/ \\ \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:

$\displaystyle \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 $\displaystyle \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 \displaystyle |x^2 - x| = |x||x - 1|$, not $\displaystyle \displaystyle x|x-1|$...

3. ## Re: Intergration problem, absolute value

Originally Posted by Pettzon
This is the problem:

$\displaystyle \int_{0}^{2}|x^{2}-x|$
$\displaystyle \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 \displaystyle |x^2 - x| = |x||x - 1|$, not $\displaystyle \displaystyle x|x-1|$...
$\displaystyle |x^2 - x| = |x(x-1)| = x|x-1|$?

Originally Posted by Plato
$\displaystyle \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
$\displaystyle |x^2 - x| = |x(x-1)| = x|x-1|$?

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

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

Anyway, for this integral, you should know that

\displaystyle \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 \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 \displaystyle |x^2 - x| = |x||x - 1|$, not $\displaystyle \displaystyle x|x-1|$...
Originally Posted by Prove It
Wrong, what if $\displaystyle \displaystyle x < 0$? It's impossible for $\displaystyle \displaystyle |x(x - 1)|$ to be negative, but $\displaystyle \displaystyle x|x - 1|$ would be.

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

Anyway, for this integral, you should know that

\displaystyle \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 \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!