3
$\begingroup$

How can I simplify $\lim_{n\to \infty } \, \int_0^n e^{-x} \left(1-\frac{x}{n}\right)^n \, dx$ ?

Limit[Integrate[(1 - x/n)^n/E^x, 
   {x, 0, n}], n -> Infinity]

The result was

Limit[ConditionalExpression[$\left.e^{-n} (-n)^{-n} (\Gamma (n+1,-n)-\Gamma (n+1)),\Re(n)>0\land \Im(n)=0\right],n\to \infty]$

Limit[ConditionalExpression[
   (-Gamma[1 + n] + Gamma[1 + n, 
      -n])/(E^n*(-n)^n), 
   Re[n] > 0 && Im[n] == 0], 
  n -> Infinity]

was supposed to be $1$ since

$\int_0^{\infty } e^{-x} \, dx=1$

Integrate[E^(-x), {x, 0, Infinity}]

I did try Simplify and Reduce but neither work.

Thank you in advance

$\endgroup$
  • 1
    $\begingroup$ People here generally like users to post code as Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this meta Q&A helpful $\endgroup$ – Michael E2 Jun 22 at 23:55
  • $\begingroup$ What happens if you use Assumptions? $\endgroup$ – Michael E2 Jun 22 at 23:56
  • $\begingroup$ @MichaelE2 I edited my question $\endgroup$ – g.a.l.l.e.t.a Jun 23 at 0:02
  • 3
    $\begingroup$ Shouldn't the limit be the integral of $e^{-2x}$ instead of $e^{-x}$? i.e., 1/2? Have you tried DiscreteLimit? $\endgroup$ – AccidentalFourierTransform Jun 23 at 0:42
  • 4
    $\begingroup$ For large $n$ the integral is $\frac12 - \frac{1}{8n} - \frac{1}{32 n^2} + \frac{1}{128 n^3}+O(n^{-4})$. I don't know how to get there in Mathematica though. $\endgroup$ – Roman Jun 23 at 0:53
6
$\begingroup$

$(1-\frac{x}{n})^n$ may be approximated by $exp(-\frac{x}{n})^n$

Exp[-1/n x] // Series[#, {x, 0, 3}] &

Mathematica graphics

Limit[Exp[-1/n x]^n - (1 - x/n)^n, n -> Infinity]

=>

0

Limit[Integrate[Exp[-x]*Exp[-1/n x]^n, {x, 0, n}], n -> Infinity]

=>

1/2



About the error

Table[Exp[-1/n x]^n - (1 - x/n)^n, {n, 500, 10000, 500}] // 
 Plot[#, {x, 0, 100}] &

Mathematica graphics

$\endgroup$
  • 1
    $\begingroup$ Your addition "About the error" is not good: the range of the integration is $[0,n]$ and the maximum value is reached around $x=2$ up to the results of Table[Maximize[{Exp[-1/n x]^n - (1 - x/n)^n, x >= 0 && x <= n}, x], {n, 10, 110, 20}];N[%] $$\left( \begin{array}{cc} 0.0280001 & \{x\to 1.931\} \\ 0.00912372 & \{x\to 1.97753\} \\ 0.00544974 & \{x\to 1.98658\} \\ 0.00388522 & \{x\to 1.99043\} \\ 0.00301863 & \{x\to 1.99257\} \\ 0.00246812 & \{x\to 1.99392\} \\ \end{array} \right). $$ $\endgroup$ – user64494 Jun 24 at 11:31
  • 2
    $\begingroup$ @user64494 "not good" is not a clear statement. It is even more confusing as your example clearly shows that the error decreases with n and what matters is n->Infinity. Maybe I missed your point, but you were previously asked to elaborate and decided to just repost it . $\endgroup$ – Kuba Jun 25 at 8:23
6
$\begingroup$

You can move the limit inside the integral (please see Rudin, Principles of Mathematical Analysis, Third Edition, Lebesgue's dominated convergence theorem, p. 321):

Limit[Integrate[Exp[-x] Limit[(1 - x/n)^n, n -> \[Infinity]],
      {x, 0, n}], n -> \[Infinity]]

Answer:

 1/2

As you surely know, $$\lim_{n\rightarrow\infty}\left(1-\frac{x}{n}\right)^n = e^{-x}$$

So the integral becomes

$$\int_0^\infty e^{-2x} dx=\frac{1}{2}$$

$\endgroup$
  • $\begingroup$ Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$ – Kuba Jun 25 at 8:00
5
$\begingroup$

Workaround:

We have a functionE^(-a*x) (1 - x/n)^n where a=1 then:

func=E^(-a*x) (1 - x/n)^n;
sol1 = InverseLaplaceTransform[func, a, s]
(*(1 - x/n)^n DiracDelta[s - x]*)
sol2 = Integrate[sol1, {x, 0, n}, Assumptions -> {s > 0, n < Infinity}]
(*(1 - s/n)^n (DiscreteDelta[n] + HeavisideTheta[n - s] - HeavisideTheta[-n, n - s])*)
sol3 = Limit[sol2, n -> Infinity, Assumptions -> s > 0]
(*E^-s*)
sol4 = LaplaceTransform[sol3, s, a]
(*1/(1 + a)*)
Limit[sol4, a -> 1]
(*1/2*)

By numerics:

f[n_?NumericQ] := NIntegrate[(1 - x/n)^n*E^(-x), {x, 0, n}, Method -> "LocalAdaptive"];
Table[f[10^n], {n, 0, 6}]
(*{0.367879, 0.487198, 0.498747, 0.499875, 0.499987, 0.499999, 0.5} *)

Answer is 1/2 not 1.

$\endgroup$
  • 2
    $\begingroup$ Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$ – Kuba Jun 23 at 20:51
  • 1
    $\begingroup$ Thank you @Kuba (and apologies to everyone who made inoffensive comments in various parts of this thread). $\endgroup$ – Daniel Lichtblau Jun 23 at 21:21
1
$\begingroup$

Firstly, it is not entirely correct to approximate $\left(1-\frac{x}{n}\right)^n$ as $e^{-x}$ because even though $n$ goes to infinity, the integration probes the region $x\sim n$, hence there are contributions in the integral for which $\frac{x}{n}$ is not arbitrarily small!

Of course $e^{-x}$ suppresses all such contributions; nonetheless, IMHO it is not warranted to apply the limit inside the integral.

Let us instead consider the following. With the change of variables $x=n a$, we have $$\lim\limits_{n\rightarrow\infty}\int\limits_{0}^{n}e^{-x}\left(1-\frac{x}{n}\right)^ndx=\lim\limits_{n\rightarrow\infty}\int\limits_{0}^{1}ne^{-na}\left(1-a\right)^nda=\lim\limits_{n\rightarrow\infty}\int\limits_{0}^{1}ne^{-na}\sum\limits_{k=0}^{\infty}(-1)^ka^k\binom{n}{k}da$$ Note that the Taylor expansion behaves well for all integration region as $0<a<1$. Thus $$\lim\limits_{n\rightarrow\infty}\int\limits_{0}^{n}e^{-x}\left(1-\frac{x}{n}\right)^ndx=\sum\limits_{k=0}^{\infty}(-1)^k\lim\limits_{n\rightarrow\infty}n\binom{n}{k}\int\limits_{0}^{1}e^{-na}a^kda$$

We can do the integration (e.g. with Mathematica) to find $$\lim\limits_{n\rightarrow\infty}\int\limits_{0}^{n}e^{-x}\left(1-\frac{x}{n}\right)^ndx=\sum\limits_{k=0}^{\infty}(-1)^k\lim\limits_{n\rightarrow\infty}n^{-k}\binom{n}{k}\left(k!-\Gamma(k+1,n)\right)=\sum\limits_{k=0}^{\infty}(-1)^k$$

Therefore, the limit does not exist! (Thanks to @user64494 for pointing out my typo) However, we can always get the regularized result (a.k.a do analytical continuation from the region it does exist):

Sum[(-1)^k, {k, 0, \[Infinity]}, Regularization -> "Abel"]

gives 1/2.

$\endgroup$
  • $\begingroup$ However, Table[NIntegrate[Exp[-x]*(1 - x/10^n)^(10^n), {x, 0, 10^n}], {n, 1, 4}] performs $\{0.487198,0.498747,0.499875,0.499987\} $, confirming $\frac 1 2$. $\endgroup$ – user64494 Jun 26 at 10:49
  • 1
    $\begingroup$ The limit exists or does not exist. The statement "the limit is NOT convergent! " is your invention. $\endgroup$ – user64494 Jun 26 at 10:51
  • $\begingroup$ This was a nice idea! How do you justify changing the order of integration and summation? $\endgroup$ – mjw Jun 27 at 2:30
  • $\begingroup$ @mjw Rigorously speaking, I am not. However, as the terms are integrable and bounded, I think the interchange should be fine (in the spirit of Fubini's theorem, considering the sum as another integral). In my opinion, the real issue is when I take the limit inside the sum: this may be too far. $\endgroup$ – Soner Jun 27 at 2:47
  • $\begingroup$ Also, relying on regularization to evaluate a limit does not exist may not be a convincing argument. $\endgroup$ – mjw Jun 27 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.