Integral Calculator
Calculate definite integrals using numerical integration methods.
Quick Examples
Integration Rules
Integration is the reverse of differentiation. The definite integral represents the area under a curve between two points.
Basic Integration Rules
Constant: ∫c dx = cx + C
Sum: ∫(f+g) dx = ∫f dx + ∫g dx
Integrals of Common Functions
| Function | Integral |
|---|---|
| sin(x) | -cos(x) + C |
| cos(x) | sin(x) + C |
| e^x | e^x + C |
| 1/x | ln|x| + C |
| a^x | a^x / ln(a) + C |
| sec²(x) | tan(x) + C |
Fundamental Theorem of Calculus
Where F(x) is the antiderivative of f(x).
Worked Example: Definite Integral
Evaluate ∫₀³ x² dx:
- Find the antiderivative (power rule): x³/3.
- Evaluate at the bounds: F(3) − F(0) = 27/3 − 0 = 9.
The result, 9, is the exact area under y = x² from x = 0 to x = 3.
Worked Example: U-Substitution
Evaluate ∫cos(2x+1) dx:
- Substitute: u = 2x + 1, so du = 2 dx, or dx = du/2.
- Rewrite: ∫cos(u)·du/2 = (1/2)∫cos(u) du.
- Integrate: (1/2)sin(u) + C.
- Substitute back: sin(2x+1)/2 + C.
Worked Example: Integration by Parts
Evaluate ∫x·eˣ dx using ∫u dv = uv − ∫v du:
- Choose u and dv (the LIATE rule: pick u as the algebraic part first): u = x, dv = eˣ dx.
- Then du = dx, v = eˣ.
- Apply the formula: x·eˣ − ∫eˣ dx = x·eˣ − eˣ + C = eˣ(x − 1) + C.
Worked Example: Improper Integral
Evaluate ∫₁^∞ (1/x²) dx by replacing infinity with a limit:
- Antiderivative: −1/x.
- Evaluate from 1 to b: −1/b − (−1) = 1 − 1/b.
- Take the limit as b → ∞: 1 − 0 = 1.
The curve extends forever yet encloses a finite area — the definition of a convergent improper integral.
Integration Methods at a Glance
| Method | Use when | Key formula |
|---|---|---|
| U-substitution | A function nested inside another (chain rule in reverse) | ∫f(g(x))·g'(x) dx = ∫f(u) du |
| Integration by parts | Products of different function types; pick u by LIATE (Log, Inverse trig, Algebraic, Trig, Exponential) | ∫u dv = uv − ∫v du |
| Partial fractions | Rational functions (polynomial ÷ polynomial) | Split into simpler fractions first |
Signed Area: Why a Definite Integral Can Be Zero or Negative
A definite integral measures signed area: regions below the x-axis subtract from the total.
- ∫₀^π sin(x) dx = −cos(π) − (−cos(0)) = 1 + 1 = 2.
- ∫₀^{2π} sin(x) dx = 0 — the positive and negative humps cancel exactly.
Why Every Indefinite Integral Has +C
Because the derivative of any constant is 0, infinitely many functions share the same derivative. The +C stands for that whole family: ∫2x dx = x² + C, and differentiating x² + 5, x² − 3, or x² + 0 all return 2x.
What Integrals Measure in the Real World
- Distance from velocity: integrating a velocity function over time gives total displacement.
- Work from force: integrating a variable force over distance gives the work done.
- Area and volume: the area under any curve, or the volume of a solid of revolution.
- Probability: the area under a probability density curve over an interval is the probability of landing in that interval.
Worked Example: Area Between Two Curves
Find the area enclosed by y = x and y = x² on [0, 1]. The line is on top, so integrate the difference:
Worked Example: Average Value of a Function
The average value of f on [a, b] is (1/(b−a))∫ₐᵇ f(x) dx. For f(x) = x² on [0, 3]:
Symmetry Shortcuts
- Odd function (f(−x) = −f(x)) over a symmetric interval [−a, a]: the integral is 0 — the halves cancel.
- Even function (f(−x) = f(x)) over [−a, a]: the integral equals 2 × ∫₀ᵃ — compute half and double.
Integrals of Trigonometric Functions
| Function | Indefinite integral |
|---|---|
| tan(x) | −ln|cos(x)| + C |
| cot(x) | ln|sin(x)| + C |
| sec(x) | ln|sec(x) + tan(x)| + C |
| csc(x) | −ln|csc(x) + cot(x)| + C |
How a Riemann Sum Becomes an Integral
Before the antiderivative shortcut, the definite integral was defined as the limit of Riemann sums: slice the interval into n rectangles, add their areas, and let n → ∞. Numerical integration methods (trapezoid, Simpson's rule) are just smarter finite versions of that sum — which is how this calculator evaluates definite integrals.
Worked Example: Displacement from Velocity
A particle's velocity is v(t) = 3t² m/s. Its displacement over the first 2 seconds is:
This is the precise version of "distance = speed × time" for changing speeds.
Worked Example: Volume of Revolution
Rotate the curve y = x² (from x = 0 to 1) around the x-axis. Using discs of radius y and thickness dx:
How Numerical Integration Works
When no antiderivative exists, calculators approximate. The trapezoid rule replaces each slice with a trapezoid: ∫ₐᵇ f(x) dx ≈ (Δx/2)[f(x₀) + 2f(x₁) + … + 2f(xₙ₋₁) + f(xₙ)]. Simpson's rule fits parabolas instead of straight lines and converges faster. This calculator uses numerical methods for definite integrals, which is why it handles functions like e^(x²) that have no elementary antiderivative.
Worked Example: Substitution in a Definite Integral
Evaluate ∫₀¹ 2x·e^(x²) dx:
- Substitute: u = x², so du = 2x dx.
- Change the bounds: x = 0 → u = 0; x = 1 → u = 1.
- Integrate: ∫₀¹ e^u du = [e^u]₀¹ = e − 1 ≈ 1.7183.
Changing the bounds with the substitution avoids substituting back — the most common source of errors in definite u-substitution.
Properties of Definite Integrals
∫ₐᵇ [f(x) + g(x)] dx = ∫ₐᵇ f(x) dx + ∫ₐᵇ g(x) dx
∫ₐᵇ c·f(x) dx = c·∫ₐᵇ f(x) dx
∫ₐᶜ f(x) dx = ∫ₐᵇ f(x) dx + ∫ᵦᶜ f(x) dx (splitting the interval)
These let you rearrange complicated integrals into simpler pieces before computing — split at discontinuities, factor out constants, and integrate term by term.
Quick Sanity Checks
- Differentiate your answer: the derivative of any antiderivative must return the original integrand.
- Check the sign: integrating a positive function over [a, b] with a < b must give a positive number.
- Check the scale: if f averages about 3 over an interval of length 4, expect an answer near 12.