4

What is

$$\int_0^{\infty} (-1)^{\lfloor x^2 \rfloor} \, \operatorname{d}\!x \ ?$$

Lord_Farin
  • 17,743

5 Answers5

3

The integral is just a sum of the integrand value over an interval of a constant integer value times the length of that interval. Note that $\lfloor x^2\rfloor$ is equal to the integer $k$ when $x \in [\sqrt{k},\sqrt{k+1}]$. Therefore,

$$\int_0^{\infty} dx \: (-1)^{\lfloor x^2\rfloor} = \sum_{k=0}^{\infty} (-1)^k (\sqrt{k+1}-\sqrt{k}) = \sum_{k=0}^{\infty} \frac{(-1)^k}{\sqrt{k+1}+\sqrt{k}}$$

The sum converges by comparison with

$$\sum_{k=1}^{\infty} \frac{(-1)^{k+1}}{\sqrt{k}}$$

Ron Gordon
  • 138,521
  • It is not quite right to break the integral to a sum of integrals (here constants) because of the explicit choosing of M's (at the M->infinity definition) For ex, I may say the integral of sin for 0 to infinity is the sum of the integrals of sin from [2pik,2pi(k+1)] and I'll get zero. – ORBOT Inc. Apr 19 '13 at 16:18
  • @ORBOTInc.: what you say only applies when the sums are not convergent or defined (i.e., infinity zeroes are zero). The sums here are indeed convergent and well-defined, and what I have done is valid. – Ron Gordon Apr 19 '13 at 16:20
  • Yes, only if you'll prove it does converge, how can you do so? – ORBOT Inc. Apr 19 '13 at 16:22
  • @ORBOTInc.: I did; the sum converges by the comparison test. And BTW, your method of substitution leads to my result anyway. – Ron Gordon Apr 19 '13 at 16:24
  • @RonGordon How do we find a closed form for the sum? – Ishan Banerjee Apr 19 '13 at 16:32
  • Of course it is, As I said I know the answer just want to make it completely formal, and yours isn't too. Again, some logic: Int0,inf – ORBOT Inc. Apr 19 '13 at 16:33
  • Oh and I didn't have to return the sum... Just thought it would be nice if there is a way to find it. – ORBOT Inc. Apr 19 '13 at 16:34
  • @ORBOTInc.: Your logic is flawed; infinity zeroes are not zero. And I am not sure how much formality you want. To me, the logic is watertight: applying the definition of floor, I get a sum which is convergent, thus the integral is convergent. Should I put in some $\epsilon$s and $\delta$s to make it look rigorous? – Ron Gordon Apr 19 '13 at 16:36
  • 1
    Infinite sum of zeroes is zero, but the turning to sum isn't right because of the fact the definition is limM->infinity so if the limit exists you may look at a certain series Mn->infinity but it exists for a certain series (sqrt(n) for that matter) it doesn't mean it exists. What I may do in yours or my solution is to bound the integral between any M to the nearest Mn (or sqrt(n)) .. – ORBOT Inc. Apr 19 '13 at 16:39
  • @IshanBanerjee: that I do not know off the top of my head. Coincidentally, I posed this question to my nephew who is taking Calc II as a nontrivial problem in series convergence. – Ron Gordon Apr 19 '13 at 16:39
  • @ORBOTInc.: then by your logic, $0 \cdot \infty = 0/0 = 0$. So we can throw away L'Hopital and all that. – Ron Gordon Apr 19 '13 at 16:41
  • 1
    @RonGordon you got no point... At this case (Int0,2pi I'm not talking about a limit reaching zero, I'm talking about the constant zero. – ORBOT Inc. Apr 19 '13 at 16:42
  • I think I can get it if I can find a way to approximate $\sum_1^n\sqrt{k}$. Any Suggestions? – Ishan Banerjee Apr 19 '13 at 16:44
  • @ORBOTInc.: we can continue this discussion here http://chat.stackexchange.com/rooms/8421/discussion-about-convergence – Ron Gordon Apr 19 '13 at 16:46
  • @IshanBanerjee: try Euler-Maclurin summation. I know of no closed-form, though. – Ron Gordon Apr 19 '13 at 16:46
1

Hint: Draw a picture of the graph of the integrand and shade the relevant regions.

rschwieb
  • 153,510
1

My own answer was to substitute t=x^2 and to get Int( (-1)^floor(x) * 1/2sqrt(x) ) then trying to use the fact Int( (-1)^floor(x) ) for x=0 to 2 is 0 and it's repeating, also 1/2sqrt(x) is monotonic to zero... Is it a right way of solving this question? How may I complete it on a formal way?

1

Let $f(x) = (-1)^{\lfloor x^2 \rfloor}$. Then you can show that $$s_n=\int_0^{\sqrt{n}} f(t) \, dt = \sum_{k=0}^n \frac{(-1)^k}{\sqrt{k}+\sqrt{k+1}} \, .$$ Note that $s_n$ is a convergent sequence.

Now, for any fixed $x>0$, we can find some $n$ with $\sqrt{n}<x<\sqrt{n+1}$. Since the sign of $f$ is constant on $[\sqrt{n},\sqrt{n+1}]$, $\int_0^x f(t) \, dt$ lies between $s_n$ and $s_{n+1}$. The sequences $\{s_n\}$ and $\{s_{n+1}\}$ converge to the same value, and $n$ increases without bound as $x$ does; thus $\int_0^x f(t) \, dt$ converges by the squeeze theorem.

What lesson should you take from this in general? The only thing that can go wrong when you try to turn an improper integral into a sum is that you might be concealing some cancellation. In this case, we're breaking up the integral everywhere the sign of the integrand changes, so there's no way that could happen.

You are right to be somewhat worried, though. Notice that while $\sum_{k=0}^\infty \frac{(-1)^k}{\sqrt{k}+\sqrt{k+1}}$ converges, it doesn't converge absolutely. So there are certain things you can't do to this integral that you might want to (e.g., any substitution that amounts to a rearrangement of the sum).

Micah
  • 38,108
  • 15
  • 85
  • 133
0

Convergent.

And its value can be expressed as $$ \sum_{n\geqslant0}\left(2\sqrt{2n+1}-\sqrt{2n}-\sqrt{2n+2}\right) $$ or as $$ \sum_{n\geqslant0}\frac2{(\sqrt{2n+1}+\sqrt{2n})(\sqrt{2n+2}+\sqrt{2n+1})(\sqrt{2n+2}+\sqrt{2n})} $$

Did
  • 279,727
  • Is this effectively an Euler transformation on the alternating sum in my result? Or did I screw up the name for it? – Ron Gordon Apr 19 '13 at 16:26