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

af(x)dx=limtatf(x)dx\int_a^{\infty} f(x)\,dx = \lim_{t \to \infty} \int_a^t f(x)\,dx

The integral converges if this limit exists and is finite.

Type 2: Unbounded Integrands

If (f) is unbounded at (a):

abf(x)dx=limε0+a+εbf(x)dx\int_a^b f(x)\,dx = \lim_{\varepsilon \to 0^+} \int_{a + \varepsilon}^b f(x)\,dx

Key Examples

IntegralConverges?Value
(\int_1^{\infty} 1/x^2,dx)Yes1
(\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:

  1. improper_integral(f, a, T, n) -- approximates (\int_a^T f(x),dx) using Simpson's rule with (n) subintervals
  2. test_convergence(f, a, T_values) -- computes the integral for each (T) in T_values and returns the list of values
  3. p_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.