← Back to modules

Integrals

Understand accumulation and compute integrals.

Integration is the reverse of differentiation. Where derivatives break things apart to measure rates, integrals put things together to measure totals.

The integral abf(x)dx\int_a^b f(x)\,dx gives the net area between the curve y=f(x)y=f(x) and the xx-axis from x=ax=a to x=bx=b. But integrals are far more than area: they compute distance, work, probability, volume, and any accumulated quantity.

Mastering integration requires two skills: knowing the antiderivative formulas and knowing the techniques to transform difficult integrals into ones you can solve.

The big idea: Riemann sums

Divide the interval [a,b][a,b] into nn thin strips of width Δx=(ba)/n\Delta x = (b-a)/n. In each strip, build a rectangle with height f(xi)f(x_i).

The total area of all rectangles is approximately i=1nf(xi)Δx\sum_{i=1}^{n} f(x_i)\Delta x. This is a Riemann sum.

As nn \to \infty (strips get infinitely thin), the Riemann sum converges to the definite integral: abf(x)dx=limni=1nf(xi)Δx\int_a^b f(x)\,dx = \lim_{n\to\infty} \sum_{i=1}^{n} f(x_i)\Delta x.

This is why integrals represent accumulation: you are adding up infinitely many infinitesimally small contributions.

1

Setting up a Riemann sum

  1. Estimate 02x2dx\int_0^2 x^2\,dx using a right Riemann sum with n=4n = 4 rectangles.
  2. Width of each rectangle: Δx=204=0.5\Delta x = \frac{2-0}{4} = 0.5.
  3. Right endpoints: x1=0.5,  x2=1.0,  x3=1.5,  x4=2.0x_1 = 0.5,\; x_2 = 1.0,\; x_3 = 1.5,\; x_4 = 2.0.
  4. Heights: f(0.5)=0.25,  f(1)=1,  f(1.5)=2.25,  f(2)=4f(0.5) = 0.25,\; f(1) = 1,\; f(1.5) = 2.25,\; f(2) = 4.
  5. Sum: 0.25(0.5)+1(0.5)+2.25(0.5)+4(0.5)=0.125+0.5+1.125+2=3.750.25(0.5) + 1(0.5) + 2.25(0.5) + 4(0.5) = 0.125 + 0.5 + 1.125 + 2 = 3.75.
  6. The exact answer (using the FTC) is x3302=832.667\frac{x^3}{3}\Big|_0^2 = \frac{8}{3} \approx 2.667. Our overestimate of 3.753.75 comes from the right endpoints overshooting on an increasing function. With more rectangles, the estimate converges to 83\frac{8}{3}.

The Fundamental Theorem of Calculus (FTC)

FTC Part 1: if F(x)=axf(t)dtF(x) = \int_a^x f(t)\,dt, then F(x)=f(x)F'(x) = f(x). Differentiation and integration are inverse operations.

FTC Part 2: abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a) where FF is any antiderivative of ff (meaning F=fF'=f).

Part 2 is the computational powerhouse: instead of computing limits of Riemann sums, just find an antiderivative and evaluate at the bounds.

The connection to derivatives: if position is s(t)s(t) and velocity is v(t)=s(t)v(t) = s'(t), then total displacement is abv(t)dt=s(b)s(a)\int_a^b v(t)\,dt = s(b) - s(a). Integration recovers position from velocity.

💡Explain it simply

Imagine you're on a road trip. Your speedometer tells you how fast you're going at each moment (that's the derivative — the rate). The odometer tells you the total distance you've covered (that's the integral — the accumulation).

The FTC says: if you know the speedometer reading at every moment, you can figure out the total distance by 'adding up' all those tiny speeds. And the shortcut is: just check the odometer at the start and end, and subtract.

That's why it's called the Fundamental Theorem — it connects the two main ideas in all of calculus (rates and totals) and gives you a shortcut so you never have to actually add up infinitely many tiny rectangles.

1

Evaluating a definite integral with the FTC

  1. Compute 13(2x+1)dx\int_1^3 (2x + 1)\,dx.
  2. Step 1 — find an antiderivative: (2x+1)dx=x2+x+C\int (2x+1)\,dx = x^2 + x + C. (We don't need the CC for definite integrals.)
  3. Step 2 — evaluate at the bounds using FTC Part 2: F(x)=x2+xF(x) = x^2 + x.
  4. F(3)=9+3=12F(3) = 9 + 3 = 12.
  5. F(1)=1+1=2F(1) = 1 + 1 = 2.
  6. 13(2x+1)dx=F(3)F(1)=122=10\int_1^3 (2x+1)\,dx = F(3) - F(1) = 12 - 2 = 10.
  7. This is the net area under the line y=2x+1y = 2x+1 from x=1x=1 to x=3x=3. Since 2x+1>02x+1 > 0 on this interval, the net area equals the total area.

Net area vs. total area

The definite integral computes net (signed) area: regions above the xx-axis contribute positively, regions below contribute negatively.

If you want total area (all positive), integrate the absolute value: abf(x)dx\int_a^b |f(x)|\,dx.

In practice, find where f(x)=0f(x) = 0, split the interval at those zeros, and flip the sign on intervals where f<0f < 0.


Antiderivatives and the constant of integration

An indefinite integral f(x)dx\int f(x)\,dx represents the family of all antiderivatives of ff.

Since the derivative of a constant is 00, any two antiderivatives differ by a constant. That's why we write +C+C.

Never forget +C+C on indefinite integrals. It's not optional: it represents an infinite family of solutions.


Common integrals (your core toolbox)

  • xndx=xn+1n+1+C\int x^n\,dx = \frac{x^{n+1}}{n+1} + C for n1n \neq -1.
  • 1xdx=lnx+C\int \frac{1}{x}\,dx = \ln|x| + C. (The power rule doesn't work for n=1n = -1.)
  • exdx=ex+C\int e^x\,dx = e^x + C and axdx=axlna+C\int a^x\,dx = \frac{a^x}{\ln a} + C.
  • sinxdx=cosx+C\int \sin x\,dx = -\cos x + C and cosxdx=sinx+C\int \cos x\,dx = \sin x + C.
  • sec2xdx=tanx+C\int \sec^2 x\,dx = \tan x + C and csc2xdx=cotx+C\int \csc^2 x\,dx = -\cot x + C.
  • secxtanxdx=secx+C\int \sec x \tan x\,dx = \sec x + C and cscxcotxdx=cscx+C\int \csc x \cot x\,dx = -\csc x + C.
  • 11x2dx=arcsinx+C\int \frac{1}{\sqrt{1-x^2}}\,dx = \arcsin x + C and 11+x2dx=arctanx+C\int \frac{1}{1+x^2}\,dx = \arctan x + C.

Substitution (reverse chain rule)

If the integrand looks like f(g(x))g(x)f(g(x)) \cdot g'(x), substitute u=g(x)u = g(x) so du=g(x)dxdu = g'(x)\,dx.

The integral becomes f(u)du\int f(u)\,du, which is usually simpler.

Example: 2xcos(x2)dx\int 2x \cos(x^2)\,dx. Let u=x2u = x^2, du=2xdxdu = 2x\,dx. Integral becomes cosudu=sinu+C=sin(x2)+C\int \cos u\,du = \sin u + C = \sin(x^2) + C.

For definite integrals, either convert the bounds to uu-values, or back-substitute and use the original bounds.

Tip: look for an "inner function" whose derivative (or a constant multiple of it) appears as a factor in the integrand.

💡Explain it simply

Substitution is like changing languages to make a sentence easier to read. The math looks complicated in xx-language, so you switch to uu-language where it's simpler.

The trick is spotting the 'inside function.' Look at your integral and ask: is there a function stuffed inside another function? If yes, call the inside part uu. If the derivative of that inside part is also floating around in the integral, you're golden — everything converts cleanly to uu.

When you're done integrating in uu-land, just swap back to xx. It's like translating your answer back to the original language.

1

u-substitution with a definite integral

  1. Compute 012x(x2+1)3dx\int_0^1 2x(x^2 + 1)^3\,dx.
  2. Spot the pattern: the inner function is x2+1x^2 + 1 and its derivative 2x2x appears as a factor. Perfect for substitution.
  3. Let u=x2+1u = x^2 + 1, so du=2xdxdu = 2x\,dx. The 2xdx2x\,dx in the integral is exactly dudu.
  4. Convert the bounds: when x=0x=0, u=0+1=1u = 0+1 = 1. When x=1x=1, u=1+1=2u = 1+1 = 2.
  5. The integral becomes 12u3du\int_1^2 u^3\,du.
  6. Integrate: u4412=16414=40.25=154\frac{u^4}{4}\Big|_1^2 = \frac{16}{4} - \frac{1}{4} = 4 - 0.25 = \frac{15}{4}.
  7. Final answer: 154\frac{15}{4}. No need to back-substitute since we converted the bounds.

Integration by parts (reverse product rule)

Formula: udv=uvvdu\int u\,dv = uv - \int v\,du. This comes from the product rule run backwards.

Choose uu and dvdv using the LIATE heuristic: Logarithms, Inverse trig, Algebraic (xnx^n), Trig, Exponentials. Pick uu from higher in this list.

Example: xexdx\int x e^x\,dx. Let u=xu = x (algebraic), dv=exdxdv = e^x\,dx. Then du=dxdu = dx, v=exv = e^x.

Result: xexexdx=xexex+C=ex(x1)+Cx e^x - \int e^x\,dx = x e^x - e^x + C = e^x(x-1) + C.

Sometimes you need to apply by-parts twice (e.g., x2exdx\int x^2 e^x\,dx) or use the tabular method for repeated applications.

A special case: exsinxdx\int e^x \sin x\,dx requires by-parts twice, then solving for the integral algebraically.

💡Explain it simply

Imagine you're trying to find the area of a weird shape made by two things multiplied together. You can't handle both at once, so you break the job into pieces.

The idea: pick one part to differentiate (make simpler) and the other to integrate. You do one step of the problem, and in exchange, the remaining integral becomes easier. It's like trading a hard problem for an easier one.

The LIATE trick tells you which part to pick as uu: Logs first, then Inverse trig, Algebra (xx, x2x^2), Trig, and Exponentials last. Pick uu from higher in the list because those get simpler when you differentiate them.

1

Integration by parts: x·sin(x)

  1. Compute xsinxdx\int x \sin x\,dx.
  2. We have a product of algebraic (xx) and trig (sinx\sin x). By LIATE, pick u=xu = x (algebraic is above trig).
  3. Set u=xu = x and dv=sinxdxdv = \sin x\,dx.
  4. Differentiate uu: du=dxdu = dx. Integrate dvdv: v=cosxv = -\cos x.
  5. Apply the formula udv=uvvdu\int u\,dv = uv - \int v\,du:
  6. xsinxdx=x(cosx)(cosx)dx=xcosx+cosxdx\int x \sin x\,dx = x(-\cos x) - \int (-\cos x)\,dx = -x\cos x + \int \cos x\,dx.
  7. The remaining integral is easy: cosxdx=sinx+C\int \cos x\,dx = \sin x + C.
  8. Final answer: xsinxdx=xcosx+sinx+C\int x \sin x\,dx = -x\cos x + \sin x + C.
  9. Check: differentiate xcosx+sinx-x\cos x + \sin x using the product rule on the first term: cosx+xsinx+cosx=xsinx-\cos x + x\sin x + \cos x = x\sin x. Correct!

Trigonometric integrals

Powers of sin and cos: for sinmxcosnxdx\int \sin^m x \cos^n x\,dx, use the following strategies:

If one power is odd, peel off one factor, convert the rest using sin2x+cos2x=1\sin^2 x + \cos^2 x = 1, and substitute.

If both powers are even, use the half-angle identities: sin2x=1cos(2x)2\sin^2 x = \frac{1-\cos(2x)}{2} and cos2x=1+cos(2x)2\cos^2 x = \frac{1+\cos(2x)}{2}.

Example: sin2xdx=1cos(2x)2dx=x2sin(2x)4+C\int \sin^2 x\,dx = \int \frac{1-\cos(2x)}{2}\,dx = \frac{x}{2} - \frac{\sin(2x)}{4} + C.

Example: cos3xdx=cos2xcosxdx=(1sin2x)cosxdx\int \cos^3 x\,dx = \int \cos^2 x \cos x\,dx = \int (1-\sin^2 x)\cos x\,dx. Let u=sinxu = \sin x: result is sinxsin3x3+C\sin x - \frac{\sin^3 x}{3} + C.


Trigonometric substitution

For integrands involving a2x2\sqrt{a^2 - x^2}, a2+x2\sqrt{a^2 + x^2}, or x2a2\sqrt{x^2 - a^2}, use trig substitutions:

a2x2\sqrt{a^2 - x^2}: let x=asinθx = a\sin\theta, so a2x2=acosθ\sqrt{a^2-x^2} = a\cos\theta.

a2+x2\sqrt{a^2 + x^2}: let x=atanθx = a\tan\theta, so a2+x2=asecθ\sqrt{a^2+x^2} = a\sec\theta.

x2a2\sqrt{x^2 - a^2}: let x=asecθx = a\sec\theta, so x2a2=atanθ\sqrt{x^2-a^2} = a\tan\theta.

After substituting, the square root disappears and you get a trig integral. Evaluate, then convert back to xx using a reference triangle.


Partial fractions

To integrate a rational function P(x)Q(x)\frac{P(x)}{Q(x)} where degP<degQ\deg P < \deg Q, decompose it into simpler fractions.

Factor the denominator, then write: 1(x1)(x+2)=Ax1+Bx+2\frac{1}{(x-1)(x+2)} = \frac{A}{x-1} + \frac{B}{x+2}.

Solve for AA and BB by clearing denominators and comparing coefficients or plugging in strategic xx values.

Repeated factors: 1(x1)2\frac{1}{(x-1)^2} requires terms Ax1+B(x1)2\frac{A}{x-1} + \frac{B}{(x-1)^2}.

Irreducible quadratics: for (x2+1)(x^2+1) in the denominator, the numerator is Ax+BAx+B, not just AA.

If degPdegQ\deg P \geq \deg Q, perform polynomial long division first, then decompose the remainder.

1

Partial fraction decomposition

  1. Compute 5x+1(x+1)(x2)dx\int \frac{5x + 1}{(x+1)(x-2)}\,dx.
  2. Decompose: 5x+1(x+1)(x2)=Ax+1+Bx2\frac{5x+1}{(x+1)(x-2)} = \frac{A}{x+1} + \frac{B}{x-2}.
  3. Multiply both sides by (x+1)(x2)(x+1)(x-2): 5x+1=A(x2)+B(x+1)5x + 1 = A(x-2) + B(x+1).
  4. Smart substitution — let x=2x = 2: 10+1=A(0)+B(3)10 + 1 = A(0) + B(3), so B=113B = \frac{11}{3}.
  5. Let x=1x = -1: 5+1=A(3)+B(0)-5 + 1 = A(-3) + B(0), so A=43A = \frac{4}{3}.
  6. The integral becomes 4/3x+1dx+11/3x2dx\int \frac{4/3}{x+1}\,dx + \int \frac{11/3}{x-2}\,dx.
  7. =43lnx+1+113lnx2+C= \frac{4}{3}\ln|x+1| + \frac{11}{3}\ln|x-2| + C.

Improper integrals

An improper integral has an infinite bound or an integrand with an infinite discontinuity.

Type 1 (infinite bound): 11x2dx=limb1b1x2dx=limb[1/x]1b=limb(1/b+1)=1\int_1^{\infty} \frac{1}{x^2}\,dx = \lim_{b\to\infty} \int_1^b \frac{1}{x^2}\,dx = \lim_{b\to\infty} [-1/x]_1^b = \lim_{b\to\infty}(-1/b+1) = 1. This converges.

Type 2 (discontinuity): 011xdx=lima0+a1x1/2dx=lima0+[2x]a1=2\int_0^1 \frac{1}{\sqrt{x}}\,dx = \lim_{a\to 0^+} \int_a^1 x^{-1/2}\,dx = \lim_{a\to 0^+} [2\sqrt{x}]_a^1 = 2. This also converges.

If the limit is finite, the improper integral converges. If the limit is ±\pm\infty or does not exist, it diverges.

Key result: 11xpdx\int_1^{\infty} \frac{1}{x^p}\,dx converges if p>1p > 1 and diverges if p1p \leq 1. This mirrors the p-series test.


Which technique should I use? (Decision tree)

1. Simplify first: can algebra, trig identities, or long division reduce the integral?

2. Check the table: is it a standard form you already know?

3. Substitution: is there an inner function whose derivative appears in the integrand?

4. Trig integrals: powers of sin\sin and cos\cos? Use identities.

5. Trig substitution: see a2±x2\sqrt{a^2 \pm x^2} or x2a2\sqrt{x^2 - a^2}?

6. Integration by parts: product of two different types of functions?

7. Partial fractions: rational function with a factorable denominator?

Practice is the only way to develop intuition for which technique to try first.


Area between curves and volumes (preview)

Area between f(x)f(x) and g(x)g(x) on [a,b][a,b]: abf(x)g(x)dx\int_a^b |f(x) - g(x)|\,dx. Determine which function is on top on each sub-interval.

Volume by disks/washers: revolve a region around the xx-axis: V=πab[f(x)]2dxV = \pi\int_a^b [f(x)]^2\,dx.

Volume by shells: revolve around the yy-axis: V=2πabxf(x)dxV = 2\pi\int_a^b x\,f(x)\,dx.

These are applications of integration, extending the concept of 'summing up infinitely many small pieces' to 2D and 3D geometry.


⚠️

Common Mistakes to Avoid

  • Forgetting +C+C on indefinite integrals. Every indefinite integral has a constant of integration.
  • Trying to use the power rule for 1xdx\int \frac{1}{x}\,dx. The power rule gives x00\frac{x^0}{0} which is undefined. The answer is lnx+C\ln|x| + C.
  • Forgetting to change the bounds when using substitution in a definite integral. Either convert bounds to uu-values or back-substitute before evaluating.
  • Choosing uu and dvdv poorly in integration by parts. If vdu\int v\,du is harder than the original, try swapping your choices.
  • In partial fractions, forgetting to do polynomial long division first when the degree of the numerator is \geq the degree of the denominator.
  • Not checking convergence of improper integrals. Always set up the limit explicitly before evaluating.
  • Getting sign errors with trig antiderivatives: sinxdx=cosx+C\int \sin x\,dx = -\cos x + C (note the negative sign).

Worked Practice Problems (5 examples)

Study these solved examples to understand the techniques. Then head to Practice to try problems on your own.

Practice on your own →
1

Problem 1

Compute x3dx\int x^3\,dx

Step-by-Step Solution

1

Power rule: xndx=xn+1n+1+C\int x^n\,dx = \frac{x^{n+1}}{n+1} + C.

2

x44+C\frac{x^4}{4} + C.

Final Answer: x44+C\frac{x^4}{4} + C

2

Problem 2

Compute 4xdx\int 4x\,dx

Step-by-Step Solution

1

4x22+C=2x2+C4 \cdot \frac{x^2}{2} + C = 2x^2 + C.

Final Answer: 2x2+C2x^2 + C

3

Problem 3

Compute exdx\int e^x\,dx

Step-by-Step Solution

1

The integral of exe^x is itself.

2

ex+Ce^x + C.

Final Answer: ex+Ce^x + C

4

Problem 4

Compute cos(x)dx\int \cos(x)\,dx

Step-by-Step Solution

1

The integral of cos(x)\cos(x) is sin(x)\sin(x).

Final Answer: sin(x)+C\sin(x) + C

5

Problem 5

Compute 1xdx\int \frac{1}{x}\,dx

Step-by-Step Solution

1

This is a fundamental integral.

2

lnx+C\ln|x| + C.

Final Answer: lnx+C\ln|x| + C

Ready to practice?

Test your understanding with 40 problems on integrals.