Definite integral with floor function of shifted arguments

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 4K views
maverick280857
Messages
1,774
Reaction score
5
Hi

I need help doing the following integration:

[tex]\int_{x=0}^{x=n}[{x-\frac{1}{\sqrt{2}}]-[{x-\frac{1}{\sqrt{3}}]dx[/tex]

where n is an integer and [.] denotes the greatest integer function (floor), i.e. [x] = greatest integer less than or equal to x.

The answer given in the book is

[tex]n(\frac{1}{\sqrt{3}}-\frac{1}{\sqrt{2}})[/tex]

whereas I am getting zero as the answer. My solution is a bit jerky due to the step marked # below:

By definition, there exists some [tex]k \epsilon Z[/tex] such that

[tex]k\leq x < k+1[/tex] (so that [x] = k)

which means that

[tex]k-1<k-\frac{1}{\sqrt{2}}\leq x - \frac{1}{\sqrt{2}} < k+1-\frac{1}{\sqrt{2}}[/tex] and
[tex]k-1<k-\frac{1}{\sqrt{3}}\leq x - \frac{1}{\sqrt{3}} < k+1-\frac{1}{\sqrt{3}}[/tex]

But this would mean that (#)

[tex][{x-\frac{1}{\sqrt{2}}] = k-1[/tex]
[tex][{x-\frac{1}{\sqrt{3}}] = k-1[/tex]

Making the integrand zero and hence the integral zero as well.

I am not sure if this reasoning is correct (in particular, the integer parts cannot be greater than k-1 so this step could be wrong but still they can attain no other integral value) so I would be very grateful if someone could guide me here.

Thanks and cheers
Vivek
 
Last edited:
Physics news on Phys.org
I suggest another method of approach. Draw the graph. Once you have that, the answer is trivial.

Notice that
[tex]\lfloor x-\sqrt2 \rfloor=\lfloor x-\sqrt3 \rfloor[/tex] if [tex]0\leq x < \sqrt{2}[/tex] or [tex]\sqrt{3}\leq x \leq 1[/tex]

What happens when [tex]\sqrt{2} \leq x < \sqrt{3}[/tex].

What changes when x increases by 1?
 
Last edited:



Hi Vivek,

Thank you for reaching out for help with this definite integral problem. I can see that you have put a lot of thought and effort into solving it, but there are a few errors in your reasoning. Let me guide you through the correct approach to solving this problem.

First, let's rewrite the integral using the definition of the floor function:

\int_{x=0}^{x=n}[{x-\frac{1}{\sqrt{2}}]-[{x-\frac{1}{\sqrt{3}}]dx
= \int_{x=0}^{x=n}[x-\frac{1}{\sqrt{2}}]-[x-\frac{1}{\sqrt{3}}]dx
= \int_{x=0}^{x=n}x - \left\lfloor x-\frac{1}{\sqrt{2}}\right\rfloor - \left\lfloor x-\frac{1}{\sqrt{3}}\right\rfloor dx

Now, let's focus on the limits of integration. We have x=0 on the lower limit, and x=n on the upper limit. This means that the value of x ranges from 0 to n, including both endpoints. In other words, x is a continuous variable, not an integer. So, your assumption that there exists some k \epsilon Z such that k\leq x < k+1 is incorrect. Instead, we can say that x is a real number such that 0\leq x \leq n.

Next, let's look at the floor functions in the integrand. Remember that the floor function takes the greatest integer less than or equal to the input. So, for any real number x, we have [x-\frac{1}{\sqrt{2}}] = k if and only if k\leq x-\frac{1}{\sqrt{2}} < k+1. Similarly, [x-\frac{1}{\sqrt{3}}] = m if and only if m\leq x-\frac{1}{\sqrt{3}} < m+1. Notice that the values of k and m are not necessarily integers, they can be any real numbers. This means that the floor functions in the integrand can take on non-integer values, and your assumption that they are equal to k-1 and m-1 is incorrect.

Now