Welcome to our community

Be a part of something great, join today!

integration with absolute value.

paulmdrdo

Active member
May 13, 2013
386
$\displaystyle\int|2x-1|dx$

please tell me what is the first step to solve this.
 

Fernando Revilla

Well-known member
MHB Math Helper
Jan 29, 2012
661
$|2x-1|= \left \{ \begin{matrix} 2x-1&\text{ if }&x\geq \dfrac{1}{2}\\1-2x&\text{ if }&x< \dfrac{1}{2}\end{matrix}\right. $
 

paulmdrdo

Active member
May 13, 2013
386
does that mean i have to integrate those two definitions?
 

Fernando Revilla

Well-known member
MHB Math Helper
Jan 29, 2012
661
does that mean i have to integrate those two definitions?
There is only one definition: a piecewise function with two subdomains. Integrate at each subdomain.
 

paulmdrdo

Active member
May 13, 2013
386
we will have two answers is this correct?
$\displaystyle \int (2x-1)dx = {x^2}+x+C\,\,if\,x\geq\frac{1}{2}$
$\displaystyle \int (1-2x)dx = x-{x^2}+C\,\,if\,x\leq\frac{1}{2}$
 

Fernando Revilla

Well-known member
MHB Math Helper
Jan 29, 2012
661
$\displaystyle \int (2x-1)dx = {x^2}+x+C\,\,if\,x\geq\frac{1}{2}$
$\displaystyle \int (1-2x)dx = x-{x^2}+C\,\,if\,x\leq\frac{1}{2}$
Check the first one.
 

paulmdrdo

Active member
May 13, 2013
386
oh i made a typo. it should be,
$\displaystyle \int (2x-1)dx = {x^2}-x+C\,\,if\,x\geq\frac{1}{2}.$

- - - Updated - - -

follow-up question, what if it is bounded?

$\displaystyle\int_{-1}^1|2x-1|dx$
 

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
we will have two answers is this correct?
$\displaystyle \int (2x-1)dx = {x^2}+x+C\,\,if\,x\geq\frac{1}{2}$
$\displaystyle \int (1-2x)dx = x-{x^2}+C\,\,if\,x\leq\frac{1}{2}$
Besides $x^2-x$ in the first formula, an indefinite integral, by definition, is a differentiable, and therefore a continuous, function. So, the constants in the two lines have to be such that at 1/2 the functions have the same value.

follow-up question, what if it is bounded?

$\displaystyle\int_{-1}^1|2x-1|dx$
You still compute two definite integrals: from -1 to 1/2 plus from 1/2 to 1.
 

paulmdrdo

Active member
May 13, 2013
386
evgenymakarov "So, the constants in the two lines have to be such that at 1/2 the functions have the same value." - what do you mean by this?

and why is it from-1 to 1/2 plus 1/2 to 1?
 

Plato

Well-known member
MHB Math Helper
Jan 27, 2012
196

Attachments

paulmdrdo

Active member
May 13, 2013
386
can you show me your work? i'm kind of confused because the boundary is from -1 to 1 only. why did you insert 1/2 there?
 

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
evgenymakarov "So, the constants in the two lines have to be such that at 1/2 the functions have the same value." - what do you mean by this?
It's not like there are many lines with formulas and constants in the first quote in post #8. Anyway, to understand this I suggest you write explicitly the answer to your original problem in post #1, i.e., the result of evaluating this indefinite integral. And remember that the resulting function should be differentiable and, in particular, continuous. .

and why is it from-1 to 1/2 plus 1/2 to 1?
Try evaluating it any other way algebraically. Because the function being integrated is a piecewise function that is given by simple but different algebraic expressions below 1/2 and above 1/2, as shown in post #2.
 
Last edited:

paulmdrdo

Active member
May 13, 2013
386
what i have in my mind is like this

$\displaystyle\int_{-1}^1 (2x-1)dx$
$\displaystyle\int_{-1}^1 (1-2x)dx$
 

Fernando Revilla

Well-known member
MHB Math Helper
Jan 29, 2012
661
Besides $x^2-x$ in the first formula, an indefinite integral, by definition, is a differentiable, and therefore a continuous, function. So, the constants in the two lines have to be such that at 1/2 the functions have the same value.
Right. And considering it, we can express the solution in a more elegant way:
$$\int |2x-1|\;dx=\frac{(2x-1)\left |2x-1\right|}{4}+C$$
 

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
what i have in my mind is like this

$\displaystyle\int_{-1}^1 (2x-1)dx$
$\displaystyle\int_{-1}^1 (1-2x)dx$
I assume this is related to evaluating $\int_{-1}^1|2x-1|\,dx$, but I am not sure how it is related.
 

paulmdrdo

Active member
May 13, 2013
386
$\displaystyle\int |2x-1|\;dx=\frac{(2x-1)\left |2x-1\right|}{4}+C$ --- why the other (2x-1) is in absolute value?
 

Fernando Revilla

Well-known member
MHB Math Helper
Jan 29, 2012
661
You can easily verify that if
$$f(x)= \left \{ \begin{matrix} \;\;\;x^2-x+\dfrac{1}{4}&\text{if}&x\geq \dfrac{1}{2}\\ -x^2+x-\dfrac{1}{4}&\text{if}&x< \dfrac{1}{2}\end{matrix}\right. $$
then, $f'(x)=\left|2x-1\right|$ for all $x\in\mathbb{R}$. But
$$\frac{(2x-1)|2x-1|}{4}=\left \{ \begin{matrix} \dfrac{(2x-1)(2x-1)}{4}&\text{if}&x\geq \dfrac{1}{2}\\ \frac{(2x-1)(1-2x)}{4}&\text{if}&x< \dfrac{1}{2}\end{matrix}\right.\\= \left \{ \begin{matrix} \;\;\;x^2-x+\dfrac{1}{4}&\text{if}&x\geq \dfrac{1}{2}\\ -x^2+x-\dfrac{1}{4}&\text{if}&x< \dfrac{1}{2}\end{matrix}\right.$$
As a consequence,
$$\int |2x-1|\;dx=\frac{(2x-1)\left |2x-1\right|}{4}+C\quad (C\in\mathbb{R})$$
 

paulmdrdo

Active member
May 13, 2013
386
oh men, i'm lost here! :confused:
 

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
As Fernando pointed out, writing the result of integration using absolute value is more elegant, but not necessarily easier.

The idea is simple. You have a piecewise function that is made of two functions: before 1/2 it is $1 - 2x$ and after 1/2 it is $2x - 1$. Correspondingly, the indefinite integral will also be different before and after 1/2. You just need to integrate the corresponding function. The definite integral can also be broken into two parts (before and after 1/2) because in each part the function being integrated is either $1-2x$ or $2x-1$, and integrating such functions is straigtforward.