Skip to content
Mathematics

Integrals

An integral adds up many small contributions. On a graph, a definite integral is the signed area between the curve and the horizontal axis.

From rectangles to accumulation

Split an interval into thin slices. For each slice, multiply its width by the function’s height at the midpoint. Add the rectangles, then make them thinner. Their sum approaches the definite integral.

∫abf(x) dx=lim⁡n→∞∑i=1nf(xi∗) Δx,Δx=b−an\int_a^b f(x)\,dx=\lim_{n\to\infty}\sum_{i=1}^{n} f(x_i^*)\,\Delta x,\qquad\Delta x=\frac{b-a}{n}

A rectangle below the horizontal axis counts negatively. That is why a definite integral can be zero even when the curve encloses visible regions.

Build area from rectangles

Add rectangles and watch the estimate approach the exact integral.

Blue rectangles contribute positive signed area. Amber rectangles below the horizontal axis contribute negative signed area. Each rectangle uses the function value at its midpoint.
f(x)=x2f(x)=x^2
a=0,b=2a=0,\quad b=2
n=8n=8
∫02x2 dx=2.6667\int_{0}^{2} x^2\,dx=2.6667
Midpoint estimate: 2.65632.6563
Absolute error: 0.01040.0104

A definite integral measures signed accumulation. When the curve crosses the axis, positive and negative parts can cancel even though the geometric area is not zero.

A faster exact method

An antiderivative reverses differentiation. If differentiating a function gives the curve you are integrating, evaluate that function at the bounds and subtract. This is the Fundamental Theorem of Calculus.

F′(x)=f(x)⟹∫abf(x) dx=F(b)−F(a)F'(x)=f(x)\quad\Longrightarrow\quad\int_a^b f(x)\,dx=F(b)-F(a)

For the square curve, the power rule works in reverse. The result agrees with what the rectangles approach.

∫02x2 dx=[x33]02=83\int_0^2 x^2\,dx=\left[\frac{x^3}{3}\right]_0^2=\frac{8}{3}

Where the basic integration rules come from

Every indefinite-integral rule can be checked by differentiating its answer. If F′(x)=f(x)F'(x)=f(x), then ∫f(x) dx=F(x)+C\int f(x)\,dx=F(x)+C. The constant CC is needed because differentiating any constant gives zero.

  1. 1. Constants, multiples, and sums

    Differentiation distributes across sums and constant multiples. It also turns cxcx into the constant cc. Reverse those three facts together:

    ddx(AF(x)+BG(x)+cx)=Af(x)+Bg(x)+c∫(Af(x)+Bg(x)+c) dx=AF(x)+BG(x)+cx+C\begin{aligned}\frac{d}{dx}\bigl(AF(x)+BG(x)+cx\bigr)&=Af(x)+Bg(x)+c\\[4pt]\int\bigl(Af(x)+Bg(x)+c\bigr)\,dx&=AF(x)+BG(x)+cx+C\end{aligned}

    Here F′=fF'=f and G′=gG'=g. This is why you can integrate a polynomial one term at a time.

  2. 2. Powers

    The derivative power rule lowers an exponent by one. To reverse it, raise the exponent first, then divide by the new exponent:

    ddx(xn+1n+1)=(n+1)xnn+1=xn∫xn dx=xn+1n+1+C,n≠−1\begin{aligned}\frac{d}{dx}\left(\frac{x^{n+1}}{n+1}\right)&=\frac{(n+1)x^n}{n+1}=x^n\\[4pt]\int x^n\,dx&=\frac{x^{n+1}}{n+1}+C,\qquad n\ne-1\end{aligned}

    For example, ∫x2 dx\int x^2\,dx becomes x3/3+Cx^3/3+C. The rule cannot use n=−1n=-1 because that would divide by zero. Apply it on an interval where the power is defined.

  3. 3. The reciprocal becomes a logarithm

    The missing power-rule case has its own antiderivative. On either side of zero, the derivative of the logarithm of absolute value is the reciprocal:

    ddxln⁡∣x∣=1x(x≠0)⟹∫1x dx=ln⁡∣x∣+C\frac{d}{dx}\ln|x|=\frac{1}{x}\quad(x\ne0)\qquad\Longrightarrow\qquad\int\frac{1}{x}\,dx=\ln|x|+C

    Work on an interval that does not cross zero, where the integrand is defined.

  4. 4. Exponentials

    The natural exponential differentiates to itself. For any other positive base, differentiation introduces a logarithm factor, so integration must divide by it:

    ddxex=ex∫ex dx=ex+Cddxax=axln⁡a∫ax dx=axln⁡a+C(a>0, a≠1)\begin{aligned}\frac{d}{dx}e^x&=e^x&\int e^x\,dx&=e^x+C\\[4pt]\frac{d}{dx}a^x&=a^x\ln a&\int a^x\,dx&=\frac{a^x}{\ln a}+C\end{aligned}\qquad(a>0,\ a\ne1)
  5. 5. Basic trigonometric functions

    The familiar derivative identities supply the antiderivatives. In particular, differentiating cosine introduces a minus sign, so integrating sine needs one too:

    ddxsin⁡x=cos⁡x,ddxcos⁡x=−sin⁡x,ddxtan⁡x=sec⁡2x\frac{d}{dx}\sin x=\cos x,\qquad\frac{d}{dx}\cos x=-\sin x,\qquad\frac{d}{dx}\tan x=\sec^2x

    Reverse each identity to obtain the integration rules:

    ∫cos⁡x dx=sin⁡x+C∫sin⁡x dx=−cos⁡x+C∫sec⁡2x dx=tan⁡x+C\begin{aligned}\int\cos x\,dx&=\sin x+C\\[4pt]\int\sin x\,dx&=-\cos x+C\\[4pt]\int\sec^2x\,dx&=\tan x+C\end{aligned}

    These identities hold on intervals where the functions are defined; in particular, tan⁡x\tan x and sec⁡2x\sec^2x are undefined where cos⁡x=0\cos x=0.

  6. 6. Substitution reverses the chain rule

    If an inner function appears along with its derivative, treat the inner function as a new variable. The chain rule explains why this works:

    ddxF(g(x))=F′(g(x))g′(x)=f(g(x))g′(x)∫f(g(x))g′(x) dx=F(g(x))+C\begin{aligned}\frac{d}{dx}F(g(x))&=F'(g(x))g'(x)=f(g(x))g'(x)\\[4pt]\int f(g(x))g'(x)\,dx&=F(g(x))+C\end{aligned}

    For u=x2u=x^2, we have du=2x dxdu=2x\,dx. The integral then becomes a familiar cosine rule:

    ∫2xcos⁡(x2) dx=∫cos⁡u du=sin⁡u+C=sin⁡(x2)+C\int 2x\cos(x^2)\,dx=\int\cos u\,du=\sin u+C=\sin(x^2)+C
  7. 7. Integration by parts reverses the product rule

    A product is different: differentiating it creates two terms. Integrate the product rule and move one term to the other side:

    ddx(uv)=u′v+uv′d(uv)=u dv+v du∫u dv=uv−∫v du\begin{aligned}\frac{d}{dx}(uv)&=u'v+uv'\\[4pt]d(uv)&=u\,dv+v\,du\\[4pt]\int u\,dv&=uv-\int v\,du\end{aligned}

    Choose u=xu=x and dv=ex dxdv=e^x\,dx. Then du=dxdu=dx and v=exv=e^x:

    ∫xex dx=xex−∫ex dx=xex−ex+C\int xe^x\,dx=xe^x-\int e^x\,dx=xe^x-e^x+C
  8. 8. Why endpoint subtraction gives a definite integral

    Let A(x)=∫axf(t) dtA(x)=\int_a^x f(t)\,dt be the area accumulated up to xx. If ff is continuous, the extra area over a very short interval is approximately its width times f(x)f(x). Shrinking that width gives:

    A′(x)=lim⁡h→01h∫xx+hf(t) dt=f(x)A'(x)=\lim_{h\to0}\frac{1}{h}\int_x^{x+h}f(t)\,dt=f(x)

    So AA and any antiderivative FF differ only by a constant. Because A(a)=0A(a)=0, that constant is −F(a)-F(a). At the upper bound:

    A(x)=F(x)−F(a)⟹∫abf(x) dx=F(b)−F(a)A(x)=F(x)-F(a)\qquad\Longrightarrow\qquad\int_a^b f(x)\,dx=F(b)-F(a)

Check your understanding

Choose an answer to see why it works. You can change your choice.

  1. Question 1

    What is the exact signed area over this interval?

    ∫02x dx\int_0^2 x\,dx
  2. Question 2

    What happens when the positive and negative parts balance?

    ∫−22x dx\int_{-2}^{2}x\,dx
  3. Question 3

    Use an antiderivative to evaluate the accumulation.

    ∫02x2 dx\int_0^2 x^2\,dx