3
$\begingroup$

I wish to calculate $$\int_{0}^{\infty}dx\int_{0}^{xz}\lambda^{2}e^{-\lambda(x+y)}dy $$

I compared my result, and the result with Wolfram when setting $\lambda=3$ and I get different results.

What I did:

$$\int_{0}^{\infty}dx\int_{0}^{xz}\lambda^{2}e^{-\lambda(x+y)}dy $$

$$=\lambda^{2}\int_{0}^{\infty}\frac{e^{-\lambda(x+y)}}{-\lambda}|_{0}^{xz}\, dx$$

$$=\lambda^{2}\int_{0}^{\infty}\frac{e^{-\lambda(x+xz)}}{-\lambda}-\frac{e^{-\lambda x}}{-\lambda}\, dx$$

$$=-\lambda(\int_{0}^{\infty}e^{-\lambda(1+z)x}\, dx-\int_{0}^{\infty}e^{-\lambda x}\, dx)$$

$$=-\lambda(\frac{e^{-\lambda(1+z)x}}{-\lambda(1+z)}|_{0}^{\infty}-\frac{e^{-\lambda x}}{-\lambda}|_{0}^{\infty})$$

$$=-\lambda(\frac{1}{\lambda(1+z)}-(\frac{1}{-\lambda}))$$

$$=-\lambda(\frac{1}{\lambda(1+z)}+\frac{1}{\lambda})$$

$$=1-\frac{1}{1+z}$$

I went over the calculation a couple of times and not only that I couldn't find my mistake, I also don't understand how I can end up with $1-e^{\text{something}}$ because the integrals are done from $0$ to $\infty$ and then I get $1$ or $0$ when I set the limits.

Can someone please help me understand where I am mistaken ?

  • 0
    @BabakSorouh - No, did I use that somewhere ?2012-12-31
  • 0
    @Belgi When calculating the exponential limits do you know whether or not $\lambda >0$ and $z>-1$?2012-12-31
  • 0
    @BabakSorouh You mean $z=-1$ right?2012-12-31
  • 0
    @Nameless: Yes in the power of $e$ when he was trying to put infinity.2012-12-31
  • 0
    @Nameless - We know that $\lambda >0,z>0$. Sorry for not writing that (I didn't see it was used)2012-12-31
  • 0
    @BabakSorouh - please see my comment for Nameless. This came from a question in probability, I checked and from the conditions there I know both lambda and $z$ are positive.2012-12-31
  • 0
    @Belgi If thats true then everything is correct but the last line (it's $-1-...$)2012-12-31
  • 2
    To me it seems like Wolfram Alpha is interpreting $xz$ as a variable on its own, but you mean $x$ multiplied by $z$.2012-12-31
  • 0
    Are you trying to calculate the CDF of the ratio $Y/X$ of two independent exponential random variables with parameter $\lambda$ which parameter is supposed to be a positive number?2012-12-31
  • 0
    @Nameless - but it still very different then Wolfram's answer...I believe that the answer should be a function that have a limit $1$ when $z$ tends to infinity2012-12-31
  • 0
    @DilipSarwate - Yes, exactly2012-12-31
  • 0
    So $1 - \frac{1}{1+z}$ has value $0$ at $z=0$ and approaches $1$ as $z \to \infty$ as a CDF should. Why do you think something is wrong?2012-12-31
  • 0
    @DilipSarwate - the limit when $z$ approaches minus infinity is still $1$, no ? (when it should be $0$)2012-12-31
  • 0
    I did the same integral in Maple. Your answer is right as others said above. Please type $xz$ in Wolfram as $x*z$. Type the product. :)2012-12-31
  • 0
    @Belgi The calculation that you are doing is valid only for $z \geq 0$, and you cannot use the expression $1 - \frac{1}{1+z}$ as the CDF for $z < 0$. Enough said.2012-12-31
  • 0
    @BabakSorouh - how do I type that $z$ ? how does Wolfram treat it ?2012-12-31
  • 0
    The Wolfram answer is suspect, since it still has an $x$ term in it. Double check the order of integration.2012-12-31
  • 0
    @BabakSorouh - thanks for all the help!2012-12-31
  • 0
    @DilipSarwate - thanks for helping me understand my mistake!2012-12-31
  • 0
    [Try this](http://www.wolframalpha.com/input/?i=%5Cint_%7B0%7D%5E%7B%5Cinfty%7D%5Cint_%7B0%7D%5E%7Bxz%7D3%5E%7B2%7De%5E%7B-3%28x%2By%29%7Ddy+dx+assuming+z%3E-1).2012-12-31

3 Answers 3

0

Assuming $\lambda\neq 0$ everything up to

$$I=-\lambda(\int_{0}^{\infty}e^{-\lambda(1+z)x}\, dx-\int_{0}^{\infty}e^{-\lambda x}\, dx)$$ is correct.

If in addtion $z\neq -1$, $$I=-\lambda(\frac{e^{-\lambda(1+z)x}}{-\lambda(1+z)}|_{0}^{\infty}-\frac{e^{-\lambda x}}{-\lambda}|_{0}^{\infty})$$

Finally if $\lambda>0,z>-1$, $$I=-\lambda(\frac{1}{\lambda(1+z)}+(\frac{1}{-\lambda}))=1-\frac{1}{1+z}$$

I ran it through Wolfram Mathematica and the result was this (given the assumptions):

The code:

!( *SubsuperscriptBox[([Integral]), (0), ([Infinity])]( *SubsuperscriptBox[([Integral]), (0), (x\ z)]k^2
E^{(-k) ((x + y))} [DifferentialD]y [DifferentialD]x))

3

Both solutions are "correct" (or equally wrong)- it depends on what integration you preform first. If you first integrate over $dy$, you get your result: $$\frac{z}{1+z} \text{ Assuming: } \lambda + z \lambda > 0 \ \ \& \ \ \lambda > 0$$ If you integrate over $dx$ first, you get WA's answer: $$1-e^{-\lambda x z}$$

This just means the limit of the integral as $x\rightarrow\infty$ does not exist. To understand this, keep in mind the a basic Riemann integration isn't defined over infinite intervals. To define a generalized integral you use the concept of a limit, but in this case the limit simply does not exist, since different paths lead to different results.

  • 0
    I did the same in Maple and above answer happened.2012-12-31
  • 0
    @BabakSorouh - The math doesn't lie, software though..2012-12-31
  • 0
    The question is which $\color{#C00000}{x}$ is bound to which? $\displaystyle \int_0^\infty\,\mathrm{d}\color{#C00000}{x} \int_0^{\color{#C00000}{x}z}\lambda^2e^{-\lambda(\color{#C00000}{x}+y)}\,\mathrm{d}y$2012-12-31
  • 0
    @nbubis: Since the integrand is positive, switching the order of integration won't affect the value of the integral.2013-01-01
  • 0
    @robjohn - care to elaborate? the exponential solution can be arrived at all the same - what makes you think it's wrong?2013-01-01
  • 1
    @nbubis: The exponential solution is gotten by misapplying the limits of integration. That is, by decoupling the $x$ in the limit from the $x$ in the integral. We can't simply integrate in $x$ first since $x$ appears in the bounds of integration for the integration in $y$. One clue to the problem is that the answer $1-e^{xz}$ involves one of the variables of integration, which should not occur with definite integrals.2013-01-01
3

Assuming $\lambda>0$ and $z>0$, $$ \begin{align} \int_0^\infty\int_0^{xz}\lambda^2e^{-\lambda(x+y)}\,\mathrm{d}y\,\mathrm{d}x &\stackrel{y\to x(y-1)}=\int_0^\infty\int_1^{z+1}\lambda e^{-\lambda xy}\,\lambda x\mathrm{d}y\,\mathrm{d}x\\ &\stackrel{\hphantom{y\to x(y-1)}}=\int_0^\infty\left(e^{-\lambda x}-e^{-\lambda x(z+1)}\right)\,\lambda\mathrm{d}x\\ &\stackrel{\hphantom{y\to x(y-1)}}=1-\frac1{z+1}\\ &\stackrel{\hphantom{y\to x(y-1)}}=\frac{z}{z+1} \end{align} $$ After looking at Wolfram Alpha

The question on Wolfram Alpha is quite different. There, the upper limit of the inner integration is the variable "$xz$", not the product $x\cdot z$. If we replace the upper limit by $w$, we get $$ \begin{align} \int_0^\infty\int_0^w\lambda^2e^{-\lambda(x+y)}\,\mathrm{d}y\,\mathrm{d}x &=\int_0^\infty\lambda e^{-\lambda x}\,\mathrm{d}x\cdot\int_0^w\lambda e^{-\lambda y}\,\mathrm{d}y\\ &=1\cdot\left(1-e^{-\lambda w}\right)\\ &=1-e^{-\lambda w} \end{align} $$ restoring $w$ to $xz$ gives $1-e^{-\lambda xz}$