Lesson 15 of 15
Improper Integrals
Improper Integrals
An improper integral has either an infinite limit of integration or an integrand that is unbounded.
Type 1: Infinite Limits
The integral converges if this limit exists and is finite.
Type 2: Unbounded Integrands
If (f) is unbounded at (a):
Key Examples
| Integral | Converges? | Value |
|---|---|---|
| (\int_1^{\infty} 1/x^2,dx) | Yes | 1 |
| (\int_1^{\infty} 1/x,dx) | No | (\infty) |
| (\int_1^{\infty} e^{-x},dx) | Yes | (1/e) |
The p-Test
(\int_1^{\infty} 1/x^p,dx) converges if and only if (p > 1).
Numerical Approximation
We approximate (\int_a^{\infty} f(x),dx) by computing (\int_a^T f(x),dx) for increasingly large (T) and checking for convergence.
Your Task
Implement:
improper_integral(f, a, T, n)-- approximates (\int_a^T f(x),dx) using Simpson's rule with (n) subintervalstest_convergence(f, a, T_values)-- computes the integral for each (T) inT_valuesand returns the list of valuesp_test(p, T, n)-- evaluates (\int_1^T 1/x^p,dx) to numerically check the p-test
Pyodide loading...
Loading...
Click "Run" to execute your code.