Solving Definite Integral with Floor Function: Help Needed

Click For Summary
The discussion revolves around solving the definite integral involving the floor function, specifically the integral from 0 to n of the difference between two floor functions. The original poster, Vivek, believes the integral evaluates to zero due to a misunderstanding of the floor function's behavior. However, responses clarify that the integral should be approached by recognizing that x is a continuous variable, not restricted to integers, and that the floor function can take on various values depending on the range of x. The correct evaluation leads to the conclusion that the integral equals n multiplied by the difference of the two square roots, confirming the book's answer. This highlights the importance of correctly interpreting the floor function in the context of continuous integration.
maverick280857
Messages
1,774
Reaction score
5
Hi

I need help doing the following integration:

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

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

n(\frac{1}{\sqrt{3}}-\frac{1}{\sqrt{2}})

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 k \epsilon Z such that

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

which means that

k-1<k-\frac{1}{\sqrt{2}}\leq x - \frac{1}{\sqrt{2}} < k+1-\frac{1}{\sqrt{2}} and
k-1<k-\frac{1}{\sqrt{3}}\leq x - \frac{1}{\sqrt{3}} < k+1-\frac{1}{\sqrt{3}}

But this would mean that (#)

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

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
\lfloor x-\sqrt2 \rfloor=\lfloor x-\sqrt3 \rfloor if 0\leq x < \sqrt{2} or \sqrt{3}\leq x \leq 1

What happens when \sqrt{2} \leq x < \sqrt{3}.

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
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K