|q⟩ Bad Qubits

beginner · Physics · Math Foundations: Calculus, Probability & Statistics

Calculus Essentials: Definite Integrals

Quantum mechanics measures probabilities, and a probability is an area under a curve — the area under ψ(x)2|\psi(x)|^2. Computing those areas is what the definite integral does. This lesson gives you exactly the calculus you need: how to evaluate abf(x)dx\int_a^b f(x)\,dx for the polynomial integrands that show up in normalization, expectation values, and probability over an interval.

The definite integral as area

For a function f(x)f(x) on an interval [a,b][a, b], the definite integral

abf(x)dx\int_a^b f(x)\,dx

is the (signed) area between the curve y=f(x)y = f(x) and the xx-axis from x=ax = a to x=bx = b. When f(x)=ψ(x)2f(x) = |\psi(x)|^2 is a probability density, that area is the probability of finding the particle between aa and bb.

The power rule

An antiderivative F(x)F(x) of f(x)f(x) is any function whose derivative is ff: F(x)=f(x)F'(x) = f(x). For powers of xx, the antiderivative follows one rule — raise the exponent by one and divide by the new exponent:

xndx=xn+1n+1(n1).\int x^n\,dx = \frac{x^{n+1}}{n+1} \qquad (n \neq -1).

A sum integrates term by term, and a constant multiple pulls outside the integral, so any polynomial integrates immediately. For example (x22x3)dx=x33x42\int (x^2 - 2x^3)\,dx = \tfrac{x^3}{3} - \tfrac{x^4}{2}.

The Fundamental Theorem of Calculus

To turn an antiderivative into a definite integral, evaluate it at the two endpoints and subtract. This is the Fundamental Theorem of Calculus: if F(x)=f(x)F'(x) = f(x), then

abf(x)dx=F(x)ab=F(b)F(a).\int_a^b f(x)\,dx = F(x)\Big|_a^b = F(b) - F(a).

The notation F(x)abF(x)\big|_a^b is just shorthand for "plug in bb, then subtract the value at aa."

A worked example

Evaluate 01x2(1x)2dx\displaystyle\int_0^1 x^2(1-x)^2\,dx — the exact integral you will meet again when normalizing a wavefunction. First expand the integrand:

x2(1x)2=x2(12x+x2)=x22x3+x4.x^2(1-x)^2 = x^2\big(1 - 2x + x^2\big) = x^2 - 2x^3 + x^4.

Integrate term by term with the power rule:

01(x22x3+x4)dx=[x33x42+x55]01.\int_0^1 \big(x^2 - 2x^3 + x^4\big)\,dx = \left[\frac{x^3}{3} - \frac{x^4}{2} + \frac{x^5}{5}\right]_0^1.

At x=1x = 1 every power is 11 and at x=0x = 0 every term vanishes, so by the Fundamental Theorem:

1312+15=1015+630=1300.0333.\frac{1}{3} - \frac{1}{2} + \frac{1}{5} = \frac{10 - 15 + 6}{30} = \frac{1}{30} \approx 0.0333.

Try it

This is a numerical exercise — your code should return a number. Compute the definite integral 01x2(1x)2dx\displaystyle\int_0^1 x^2(1-x)^2\,dx and return its value.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.