Integrating to infinity
The fundamental theorem (lesson 2.5.3) needs a finite interval and a curve that stays finite on it. An improper integral breaks one of the two. The first kind runs to infinity: asks for the area under from 1 onwards, for ever.
The plan is to integrate up to a finite right edge , then let grow (lesson 2.1.3).
Rule: Improper integral
If the limit is a number, the integral converges to it. If not, it diverges: the area grows without end, or never settles. The units are those of any integral: the height's units times the input's.
Here , which tends to 1. But , which grows without end.
| right edge | 10 | 100 | 1000 |
|---|---|---|---|
| 0.9 | 0.99 | 0.999 | |
| 2.302585 | 4.60517 | 6.907755 |
Both curves sink towards 0, but only sinks fast enough. Its area from 1 to levels off at 1; the area under climbs by 2.30 every time is multiplied by 10.
A curve that sinks to 0 can still enclose infinite area. At , is 0.01 while is 0.1, and the gap keeps widening. The harmonic series of lesson 1.5.3 diverges in the same way.
Powers: which tails converge
For any power , the power rule backwards (lesson 2.5.2) gives
If , the exponent is negative, so and the integral tends to . If , grows without end. The case is the above.
| as | |||||
|---|---|---|---|---|---|
| 0.5 | 4.324555 | 18 | 61.245553 | 1998 | diverges |
| 1 | 2.302585 | 4.60517 | 6.907755 | 13.815511 | diverges |
| 1.5 | 1.367544 | 1.8 | 1.936754 | 1.998 | 2 |
| 2 | 0.9 | 0.99 | 0.999 | 0.999999 | 1 |
Rule: Tails of powers
For the integral diverges. The boundary case diverges very slowly: reaches only 13.8 at = one million.
Try it
area(p, b) is the formula above, with for . The loop prints the table; the rows for and also give the first table.
SymPy writes infinity as sp.oo (two letters o). It confirms the limits for and , and answers oo for .
Exponential tails
Exponentials sink much faster than any power. , which tends to 1.
In general for any , using from lesson 2.5.2. For the curve does not sink at all, and the integral diverges.
A power times an exponential still converges. By parts (lesson 2.6.2), . Since outgrows every power of (lesson 2.1.3), and the area is 1.
The finite pieces get there fast: 0.95957232 at , 0.9995006 at and 0.99999996 at . A higher power changes the value but not the verdict: .
Try it
SciPy's quad accepts an infinite limit, written math.inf. It finds the four tails of this section.
The last line prints for three edges. round hides float noise in the last digit.
A curve that blows up
The second kind of improper integral has a curve that blows up (lesson 2.1.2) at an end of the interval. In , the curve has no value at 0. Start at a small instead, then let shrink to 0 from the right.
Here , which tends to 2. But , which grows without end.
| left edge | 0.01 | 0.0001 | 0.000001 |
|---|---|---|---|
| 1.8 | 1.98 | 1.998 | |
| 4.60517 | 9.21034 | 13.815511 |
Rule: Blow-ups of powers at 0
For the integral diverges. This is the other way round from tails. Near 0 a small power blows up gently enough; far out, a large power is needed.
A blow-up inside the interval
Lesson 2.5.3 showed that is not : the curve blows up at 0, inside the interval. Split the integral there into and , so each piece has its trouble at an end.
By the rule above with , diverges, so the whole integral diverges. By contrast, splits into two pieces of 2, so it converges to 4.
Infinite at both ends
An integral over the whole line has two infinite ends. Split it at any point, such as 0, and each half must converge on its own.
for every , because the two sides cancel. But diverges, so diverges too. Cancelling two infinite areas does not give a number.
Rule: Split at every trouble spot
Split an integral so that each piece has only one trouble spot: one infinite end, or one blow-up at an end. The whole converges only if every piece converges.
Try it
The first line prints the table, and . SymPy then finds each limit: 2 for , oo for , and oo for across 0.
quad adds the two halves of . The last line shows the trap: the symmetric pieces give 0, but one half alone is infinite.
The Gaussian integral
The curve is a bell: 1 at , falling fast on both sides. Lesson 2.5.2 noted that it has no antiderivative made of powers, roots, exponentials and logs.
The natural guess shows why. The chain rule suggests trying with a polynomial; the product rule then gives . For we need , but has a higher power of than , so they never cancel down to 1.
Mathematicians proved in the nineteenth century that no formula built from familiar functions works, not just this guess. The area function still exists (lesson 2.5.3); it is a new function, computed numerically, like a square root. SymPy's erf from lesson 2.5.2 is this area times .
Its total area
The tails converge. For , , so , and exponential tails have finite area. The total area is known exactly.
Rule: Gaussian integral
Stated here without proof. Module 4.7 shows where it comes from, using a double integral, and the proof belongs to the Proof Gym.
Check it numerically by integrating from to . The missing tails shrink astonishingly fast, because is already at .
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1.493648 | 1.764163 | 1.772415 | 1.772454 | 1.772454 | |
| tails left out | 0.28 | 0.0083 | 0.000039 |
So cutting the integral off at a moderate loses almost nothing. Case study 2.6.5 relies on that.
An extra factor of changes everything. does have an antiderivative, , by substitution (lesson 2.6.1). So exactly.
Try it
The loop integrates from to and prints what is left out, minus the result, in scientific notation (e-08 means ).
quad over the whole line and SymPy both give . SymPy also gives the half-line integral of .
The standard normal density
Stretch the bell sideways by and it becomes . Substitute , a linear inner function, so (lesson 2.6.1). The limits stay at and , and
That is about 2.506628. Dividing the curve by gives it total area 1.
Rule: Standard normal density
(phi) is the bell curve scaled to have area 1. Its peak is , and it is symmetric: .
The standard normal density . The whole shaded area is 1; the darker band from to 1 holds 0.683 of it.
Areas under have no formula either, so they are computed numerically. The band from to 1.96 holds 0.950004, and the area up to 1 is 0.841345. By symmetry, the area up to 0 is exactly .
The area from up to is called , the normal cumulative distribution; SciPy computes it as norm.cdf(x). Level 5 (module 5.4) reads these areas as probabilities. Case study 2.6.5 prices an option with them.
Try it
norm.pdf is and norm.cdf is , from scipy.stats. quad of gives , and quad of gives 1.
Then each band is found twice: by quad and by subtracting values of .
Common mistakes
- An improper integral is a limit. Integrate to a finite edge first, then let it go to infinity or to the blow-up.
- A curve that sinks to 0 can still have infinite area, like from 1 on.
- The power tests run opposite ways. Tails need ; blow-ups need ; fails both.
- Do not integrate across a blow-up. is not : split at 0, and it diverges.
- Each half must converge. does not make equal 0.
- has no antiderivative formula, but does, by substitution.
- Match the bell to its area. has area ; has area ; has area 1.
Improper integrals and the Gaussian integral
0 of 12 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- An improper integral is a limit: , and likewise towards a blow-up. It converges if the limit is a number.
- Tails: for , and diverges for . Exponential tails always converge.
- Blow-ups at 0: for , and diverges for .
- Split at every trouble spot; the whole converges only if every piece does.
- has no antiderivative formula, yet , and its tails shrink very fast.
- has area 1; its areas are computed numerically with
norm.cdf.