Integration with absolute value.

In summary: So, the idea is if you want to integrate a piecewise function, just split the integral into subintervals where the function is defined using the corresponding formula for each subinterval and integrate each subinterval separately. In the end, you will have something like this:$\displaystyle\int_{-1}^1 (2x-1)dx$$\displaystyle\int_{-1}^1 (1-2x)dx$$\displaystyle =\int_{-1}^{1/2}(1-2x)dx+\int_{1/2}^1(2x-1)dx$$\displaystyle =\left(x-\frac{x^2}{2}\right)\Big
  • #1
paulmdrdo1
385
0
$\displaystyle\int|2x-1|dx$

please tell me what is the first step to solve this.
 
Physics news on Phys.org
  • #2
$|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. $
 
  • #3
does that mean i have to integrate those two definitions?
 
  • #4
paulmdrdo said:
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.
 
  • #5
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}$
 
  • #6
paulmdrdo said:
$\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.
 
  • #7
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$
 
  • #8
paulmdrdo said:
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.

paulmdrdo said:
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.
 
  • #9
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?
 
  • #10
paulmdrdo said:
follow-up question, what if it is bounded?
$\displaystyle\int_{-1}^1|2x-1|dx$

paulmdrdo said:
why is it from-1 to 1/2 plus 1/2 to 1?

Look at the plot here.

Think about the area involved.
 

Attachments

  • Untitled.gif
    Untitled.gif
    7.9 KB · Views: 76
  • #11
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?
 
  • #12
paulmdrdo said:
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. .

paulmdrdo said:
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:
  • #13
what i have in my mind is like this

$\displaystyle\int_{-1}^1 (2x-1)dx$
$\displaystyle\int_{-1}^1 (1-2x)dx$
 
  • #14
Evgeny.Makarov said:
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$$
 
  • #15
paulmdrdo said:
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.
 
  • #16
$\displaystyle\int |2x-1|\;dx=\frac{(2x-1)\left |2x-1\right|}{4}+C$ --- why the other (2x-1) is in absolute value?
 
  • #17
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})$$
 
  • #18
oh men, I'm lost here! :confused:
 
  • #19
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.
 

FAQ: Integration with absolute value.

What is integration with absolute value?

Integration with absolute value is a mathematical process that involves finding the area under a curve that includes both positive and negative values. It is used to calculate the total change in a quantity over a given range.

Why is integration with absolute value important?

Integration with absolute value is important because it allows us to calculate the total change in a quantity, even when that quantity changes in both positive and negative directions. This is useful in many real-world applications, such as calculating net displacement in physics or total profit in economics.

What are the key steps in integrating with absolute value?

The key steps in integrating with absolute value include first identifying the intervals where the function is positive and negative, then breaking up the integral into separate parts for each interval. Next, the absolute value is removed and the integral is solved for each interval separately. Finally, the results from each interval are combined to find the total change in the quantity.

Can integration with absolute value be applied to any function?

Yes, integration with absolute value can be applied to any function. However, it is most commonly used when the function has both positive and negative values over a given range.

What are some real-world applications of integration with absolute value?

Some real-world applications of integration with absolute value include calculating net displacement in physics, total profit in economics, and finding the total change in temperature over a given time period in thermodynamics. It is also used in engineering, finance, and other fields where the total change in a quantity needs to be calculated.

Back
Top