3

Integral in question, and its answer

The integral $$\int_{0}^{1000} e^{\left\{ x \right\}}\, \operatorname{d}x$$ where $\left\{\cdot \right\}$ is the fractional part function, evaluates to $1716.02$ in Desmos, which should THEORETICALLY be equal to $1000 \cdot \left( e - 1 \right)$, but calculating gives $1000 \cdot \left( e - 1 \right) = 1718.28$. The difference isn't $e$, so why the discrepancy? Just curious.

My steps for calculation: The fractional part function is defined as the difference between a number $x$ and its floor function, $\left\{ x \right\} = x - \left\lfloor x \right\rfloor$. Since $e^{\left\{ x \right\}}$ is a periodic function of period 1, we can break the integral into 1000 equal parts, evaluating: $\int_{0}^{1000} e^{\left\{ x \right\}}\, \operatorname{d}x = 1000 \times \int_{0}^{1} e^{\left\{ x \right\}}\, \operatorname{d}x = 1000 \cdot \left( e - 1 \right)$.

J.G.
  • 118,742
sachyrus
  • 43
  • 6

2 Answers2

1

In general, you should not trust an unexpected result found via Desmos.

Desmos is not perfect. If you look through the Desmos tag on this site you will find a plethora of examples of Desmos calculating things incorrectly. In this particular case, my guess is something along the lines of @Moo's comment. Desmos themselves admit that equations deemed too complicated to plot will be plotted incorrectly or at a lower resolution. I suspect this is a similar case.

Edit: you can also try using a different calculator to confirm that it is simply a Desmos error. I just plugged it into Mathematica and got the expected answer.

0

As suggested in a comment, I tried plotting $\int_0^{x}\exp\left(u-\operatorname{floor}\left(u\right)\right)du$ in Desmos, starting with the example linked in the question.

The result was this graph, but it didn't all plot at once. In fact, I notice that when I open this graph in a new browser window it takes a while for anything to show up. When I do get a plot, it initially shows only a relatively small range along the $x$ axis. So after a few minutes I might have a graph with a range like $-10$ to $30$.

The results for small $x$ look OK:

graph of the integral for x from 0 to 6

Everything is as expected; the integral is a steep, slightly wiggly line.

But even for $x$ between $30$ and $40$ there might be some weird results at first:

graph of the integral for x from 33.9 to 34.2

I left a browser window open overnight to get more complete results. Here are some samples:

graph of the integral for x from 55 to 75
graph of the integral for x from 120 to 145 later graph of the integral for x from 120 to 145

The two side-by-side images for $x$ near $140$ are from the same browser window at two different times. (The image on the right occurred later.) Apparently Desmos is still working out the details of the graph while it is displayed and occasionally makes an update to what is plotted.

Judging from this, the fact that you got such a small error is the remarkable thing. Many of the errors in the integral while it is being graphed are much larger.

David K
  • 111,757