[THOUGHT]
We need to compute
I=n→∞lim∫02fn(x)dx,
where
fn(x)=k=1∑n2123456(2x)k−1(1−2x)3,x∈[0,2].
First, note that for fixed x, the sum is finite (up to k=n2), but as n→∞, the upper limit goes to infinity. So we can consider the limit inside the integral if justified.
Let’s write:
fn(x)=123456(1−2x)3k=1∑n2(2x)k−1.
The inner sum is a geometric series with ratio r=x/2 (with 0≤r≤1 since x∈[0,2]). For r=1,
k=1∑n2rk−1=1−r1−rn2.
For r=1 (i.e., x=2), each term is 1, so the sum is n2.
Thus,
fn(x)=123456(1−2x)3⋅1−x/21−(x/2)n2,x=2,
and for x=2:
fn(2)=123456⋅(1−1)3⋅n2=0.
Wait: at x=2, (1−x/2)3=0, so indeed fn(2)=0 for all n.
So for x∈[0,2), as n→∞, (x/2)n2→0 because ∣x/2∣<1. Therefore,
n→∞limfn(x)=123456(1−2x)3⋅1−x/21=123456(1−2x)2.
Check: (1−x/2)3/(1−x/2)=(1−x/2)2.
So the pointwise limit is
f(x)=123456(1−2x)2,x∈[0,2).
At x=2, f(2)=0, consistent with the limit (since (1−x/2)2 at x=2 is 0).
Thus fn→f pointwise on [0,2].
We want to compute
I=n→∞lim∫02fn(x)dx=∫02f(x)dx,
provided we can interchange limit and integral (e.g., dominated convergence theorem). Since fn(x) are bounded by a constant times a geometric series? Let's check: For each x, fn(x)≤123456(1−x/2)3⋅∑k=0∞(x/2)k=123456(1−x/2)3/(1−x/2)=123456(1−x/2)2 for x<2, and at x=2 it's 0. So indeed ∣fn(x)∣≤g(x)=123456(1−x/2)2 for x∈[0,2), and g is integrable on [0,2]. So DCT applies.
Thus,
I=∫02123456(1−2x)2dx.
Let u=1−x/2, then du=−dx/2, dx=−2du. When x=0, u=1; when x=2, u=0. So
I=123456∫u=10u2(−2du)=123456⋅2∫01u2du=246912⋅[3u3]01=246912⋅31=82304.
We should verify with Python integration of the original fn for large n to see if it approaches 82304.
Let's compute numerically for n=100 (large) and see if the integral is close to 82304.
We'll write Python code to compute ∫02fn(x)dx for large n and compare.
Note: For x close to 2, (1−x/2) is small, so the integrand is small anyway. We'll use numerical integration (e.g., Simpson or quad). But careful: the sum goes up to n2, which could be large, but we can compute the geometric sum formula directly for each x to avoid summing many terms.
We'll use scipy.integrate.quad for accurate integration, but note that fn(x) is defined piecewise: for x=2, it's zero; for x<2, we use the formula.
Let's implement for n=100 and see.
But note: for x very close to 2, r=x/2 is close to 1, so rn2 may not be negligible for moderate n, but for n=100, n2=10000, and r10000 for r=0.999 is extremely small (~exp(-10) ~ 0.000045). So it should be fine.
We'll compute integral using quad from scipy.integrate. We'll define f_n(x, n) and integrate.
Let's do it.
[/THOUGHT]
[PYTHON]
import numpy as np
from scipy.integrate import quad
def f_n(x, n):
# x in [0,2]
r = x / 2.0
# compute sum_{k=1}^{n^2} r^{k-1}
if r == 1.0:
# x == 2, then sum is n^2
s = n * n
else:
s = (1 - r**(n*n)) / (1 - r)
return 123456 * (1 - r)**3 * s
For n=100
n = 100
I_n, err = quad(lambda x: f_n(x, n), 0, 2)
print("Integral for n=100:", I_n)
print("Error estimate:", err)
Also compute the limit integral analytically: 82304
print("Analytic limit:", 82304)
print("Difference:", I_n - 82304)
[/PYTHON]