MHB Finding the Integral of $||x||$ from 0 to 100

  • Thread starter Thread starter anemone
  • Start date Start date
  • Tags Tags
    Integral
AI Thread Summary
The integral of the function \( ||x|| \), defined as the distance of \( x \) from the nearest integer, from 0 to 100 can be simplified by recognizing its periodic nature with a period of 1. The function is symmetric about \( x = \frac{1}{2} \) on the interval [0,1], allowing the integral to be calculated from 0 to \( \frac{1}{2} \) as the area of a triangle with base and height both equal to \( \frac{1}{2} \), resulting in an area of \( \frac{1}{8} \). Multiplying this area by 200 (the number of periods from 0 to 100) gives a total integral value of 25. Some participants initially miscalculated the integral, but the correct approach clarified the solution. The final result is confirmed to be 25.
anemone
Gold Member
MHB
POTW Director
Messages
3,851
Reaction score
115
Let $||x||$ be the distance of $x$ from the nearest integer, e.g. $||2.6||=0.4$, or $||1.2||=0.2$.

Determine $\displaystyle \int_{0}^{100} ||x||\,dx$.
 
Mathematics news on Phys.org
The integral from x to x +t where t =.5 is .25 as we need to integrate t from 0 to .5 x is integer
The integral from x-t to x where t =.5 is .25

So integral from x to x+ 1 for integer x = .5
So integral from 0 to 100 is 50
 
My solution:

$$\int_{0}^{100}||x||\,dx=100\left(\int_0^{\frac{1}{2}}x\,dx+\int_{\frac{1}{2}}^{1}1-x\,dx\right)=$$

$$100\left(\left[\frac{x^2}{2}\right]_0^{\frac{1}{2}}+\left[x-\frac{x^2}{2}\right]_{\frac{1}{2}}^{1}\right)=$$

$$100\left(\frac{1}{8}+1-\frac{1}{2}-\frac{1}{2}+\frac{1}{8}\right)=100\cdot\frac{1}{4}=25$$

edit: a simpler computation:

$$\int_{0}^{100}||x||\,dx=100\left(\int_0^{\frac{1}{2}}x\,dx+\int_{\frac{1}{2}}^{1}1-x\,dx\right)=$$

$$100\left(\int_0^{\frac{1}{2}}x\,dx+\int_{0}^{\frac{1}{2}}\frac{1}{2}-x\,dx\right)=$$

$$50\int_0^{\frac{1}{2}}\,dx=25$$
 
kaliprasad said:
The integral from x to x +t where t =.5 is .25 as we need to integrate t from 0 to .5 x is integer
The integral from x-t to x where t =.5 is .25

So integral from x to x+ 1 for integer x = .5
So integral from 0 to 100 is 50

Hey kali, I think both the integral should give a 0.125 but not 0.25 so your answer is off since it is twice as large as the actual answer.:(
MarkFL said:
My solution:

$$\int_{0}^{100}||x||\,dx=100\left(\int_0^{\frac{1}{2}}x\,dx+\int_{\frac{1}{2}}^{1}1-x\,dx\right)=$$

$$100\left(\left[\frac{x^2}{2}\right]_0^{\frac{1}{2}}+\left[x-\frac{x^2}{2}\right]_{\frac{1}{2}}^{1}\right)=$$

$$100\left(\frac{1}{8}+1-\frac{1}{2}-\frac{1}{2}+\frac{1}{8}\right)=100\cdot\frac{1}{4}=25$$

edit: a simpler computation:

$$\int_{0}^{100}||x||\,dx=100\left(\int_0^{\frac{1}{2}}x\,dx+\int_{\frac{1}{2}}^{1}1-x\,dx\right)=$$

$$100\left(\int_0^{\frac{1}{2}}x\,dx+\int_{0}^{\frac{1}{2}}\frac{1}{2}-x\,dx\right)=$$

$$50\int_0^{\frac{1}{2}}\,dx=25$$

Well done, MarkFL! I especially like your second simpler computation and thanks for participating!
 
Some simple observations:

[sp]$\|x\|$ is periodic, with a period of 1. So it suffices to integrate from 0 to 1.

Also, the graph of $f(x) = \|x\|$ on the interval $[0,1]$ is symmetric about the line $x = \frac{1}{2}$, and $f$ is non-negative on $[0,1]$, so it suffices to integrate from 0 to $\frac{1}{2}$. But on this interval, said integral is just the area of a triangle with base $\frac{1}{2}$ and height $\frac{1}{2}$ (with area $\frac{1}{8}$). It follows, then, that the integral is $\frac{200}{8} = 25$.[/sp]
 
Deveno said:
Some simple observations:

[sp]$\|x\|$ is periodic, with a period of 1. So it suffices to integrate from 0 to 1.

Also, the graph of $f(x) = \|x\|$ on the interval $[0,1]$ is symmetric about the line $x = \frac{1}{2}$, and $f$ is non-negative on $[0,1]$, so it suffices to integrate from 0 to $\frac{1}{2}$. But on this interval, said integral is just the area of a triangle with base $\frac{1}{2}$ and height $\frac{1}{2}$ (with area $\frac{1}{8}$). It follows, then, that the integral is $\frac{200}{8} = 25$.[/sp]

Hi Deveno,

What a great observation! Honestly speaking, I didn't think of relating it to a triangle and then solved it geometrically, thanks for participating and sharing your solution with us. I appreciate that!
 
anemone said:
Hey kali, I think both the integral should give a 0.125 but not 0.25 so your answer is off since it is twice as large as the actual answer.:(

Well done, MarkFL! I especially like your second simpler computation and thanks for participating!

Thanks. The base is 1/2 height is 1/2 so area is 1/2 * 1/2 * 1/2 = 1/8 and I did a mistake in calculation. I realized it after seeing Marks's Ans.
 
Back
Top