What is an integral?
An integral is the opposite of a derivative. If you know how fast something changes, the integral tells you how much it has changed in total. If the derivative of position is speed, the integral of speed gives distance travelled.
On a graph, a definite integral measures the area between a curve and the x-axis. Area below the axis counts as negative.
Integration rules used
The power rule for integrals, for any n other than −1:
The fundamental theorem of calculus turns a definite integral into subtraction:
where F is any antiderivative of f.
How to use the integral calculator
- Type your function in the f(x) box, such as 6x^2 + 2x or 3x^2 + sin(2x).
- For an indefinite integral, leave both bound boxes empty.
- For a definite integral, fill in both bounds.
- For an approximation, choose a Riemann sum, the trapezoidal rule or Simpson's rule in the Method menu and set the number of subintervals.
- Read the antiderivative, then the final value.
- To check, differentiate your answer. You should get f(x) back.
Integral examples
Example 1: Indefinite
Find ∫ (6x² + 2x) dx.
- 6x² becomes 6x³ ÷ 3 = 2x³.
- 2x becomes 2x² ÷ 2 = x².
- Add the constant.
The result is 2x³ + x² + C. Differentiating gives 6x² + 2x, which matches.
Example 2: Definite
Find the integral of 2x + 1 from 1 to 3.
- Antiderivative: F(x) = x² + x.
- F(3) = 9 + 3 = 12 and F(1) = 1 + 1 = 2.
- Subtract: 12 − 2 = 10.
The integral equals 10, which is the area under the line between x = 1 and x = 3.
Example 3: A longer polynomial
Find the indefinite integral of 5x⁴ − 2x + 7.
- 5x⁴ becomes 5x⁵⁄5 = x⁵.
- −2x becomes −2x²⁄2 = −x².
- 7 becomes 7x.
- So the answer is x⁵ − x² + 7x + C.
Check by differentiating: 5x⁴ − 2x + 7. It matches.
Example 4: A definite integral
Find the integral of 2x + 1 from x = 1 to x = 3.
- An antiderivative is x² + x.
- At 3: 9 + 3 = 12.
- At 1: 1 + 1 = 2.
- Subtract: 12 − 2 = 10.
The signed area under the line between x = 1 and x = 3 is 10 square units.
Example 5: Area below the axis
Find the integral of x² − 4 from 0 to 2. An antiderivative is x³⁄3 − 4x. At 2 it is 8⁄3 − 8 = −16⁄3. At 0 it is 0. The result is −16⁄3, about −5.33. The negative sign shows that the graph lies below the x-axis on that interval. The total area, as a positive number, is 16⁄3.
Example 6: Trig, exponential and logarithm forms
- ∫ sin(2x + 1) dx = −(1/2)cos(2x + 1) + C. The factor 1⁄2 comes from the inside, 2x + 1, whose slope is 2.
- ∫ e^(2x) dx = (1/2)e^(2x) + C.
- ∫ 3⁄x dx = 3 ln|x| + C.
- ∫ from 0 to 1 of e^x dx = e − 1 ≈ 1.718282.
- ∫ from 0 to π⁄2 of cos(x) dx = sin(π⁄2) − sin(0) = 1.
Type π⁄2 as 1.5707963 for the upper bound, since bounds are numbers. The steps name the rule for each term.
Example 7: Parts and substitution
- ∫ x·sin(x) dx = −x·cos(x) + sin(x) + C. This is integration by parts with the tabular method.
- ∫ x·e^x dx = x·e^x − e^x + C.
- ∫ ln(x) dx = x·ln(x) − x + C.
- ∫ e^x·sin(x) dx = (1⁄2)e^x(sin x − cos x) + C. The integral returns after two rounds of parts, so the tool solves for it.
- ∫ 2x·e^(x²) dx = e^(x²) + C, using u = x².
- ∫ ln(x)⁄x dx = (1⁄2)(ln x)² + C, using u = ln x.
A quick rule summary
| Function | Antiderivative |
|---|---|
| A constant k | kx + C |
| xⁿ (n not −1) | xⁿ⁺¹⁄(n + 1) + C |
| c·f(x) | c times the antiderivative of f |
| f(x) + g(x) | Sum of the antiderivatives |
| sin(ax + b) | −cos(ax + b)⁄a + C |
| cos(ax + b) | sin(ax + b)⁄a + C |
| e^(ax + b) | e^(ax + b)⁄a + C |
| 1⁄x | ln|x| + C |
| ln(x) | x·ln(x) − x + C |
| x·sin(x) | −x·cos(x) + sin(x) + C |
Definite vs indefinite integrals
| Indefinite | Definite | |
|---|---|---|
| What you enter | f(x) only | f(x), a lower and an upper bound |
| What you get | a family of functions, F(x) + C | one number |
| Meaning | every antiderivative | signed area between the curve and the x-axis |
| Example | ∫ 2x dx = x² + C | ∫₀³ 2x dx = 9 − 0 = 9 |
The definite answer comes from the fundamental theorem of calculus: find F, then compute F(upper) − F(lower). The constant C cancels, so it does not appear.
What the calculator does not do
- Improper integrals. The bounds must be numbers. For an infinite bound, get F(x) here, then take the limit of F with the limit calculator.
- Double and triple integrals. Work from the inside out: integrate in one variable, treat the other as a constant, then integrate the result.
- Functions with no elementary antiderivative. Some, such as e^(−x²), have no closed form. Choose Simpson's rule or the trapezoidal rule in the Method menu to approximate them instead.
For the ideas behind these steps, read the introduction to integrals.
Tips for typing integrals
- Leave the limits blank for an indefinite integral. Enter both limits for a definite integral.
- Coefficients may appear as fractions, such as 1⁄2 x², because dividing by the new exponent often leaves a fraction.
- Products such as x·sin(x) are solved by integration by parts, and the steps name the method. If a product of sums can be multiplied out, such as x(x + 1), the tool does that for you.
- The tool tries u-substitution when it sees a function and its derivative together, such as 2x·e^(x²) or ln(x)/x.
- A definite integral across a point where the function blows up, such as 1⁄x from −1 to 1, is rejected with a message.
- Always compare the sign of a definite integral with the graph. A negative result means the area is below the axis.
- For a gentle start, read an introduction to integrals. For the link with slopes, read what is a derivative.
Common integration mistakes
- Forgetting + C on an indefinite integral.
- Dividing by the old exponent. You divide by the new one.
- Including C in a definite integral. It cancels, so leave it out.
- Swapping the bounds. Subtract lower from upper. Swapping flips the sign.
- Reading a negative answer as an error. It can be correct when the curve is below the axis.
Real-life uses of integrals
Integrals give total distance from a speed, total water in a tank from a flow rate, total cost from a rate of cost, and the area or volume of curved shapes. The volume formulas for a cone and a sphere come from integrals. Physics and engineering rely on them throughout. Use the derivative calculator to check your answer in reverse, and read the power rule guide for more.
Riemann sums, trapezoids and Simpson's rule
A definite integral is the limit of sums of thin rectangles. Pick a method other than Exact in the Method menu, enter both bounds and the number of subintervals n, and the calculator adds the strips for you, lists each f(x) it used, and compares the total with the exact integral when it can find one.
With Δx = (b − a) ÷ n and xᵢ = a + iΔx:
| Method | Where f is evaluated | Sum |
|---|---|---|
| Left Riemann sum | left end of each strip, x₀ to xₙ₋₁ | Δx × [f(x₀) + f(x₁) + … + f(xₙ₋₁)] |
| Right Riemann sum | right end, x₁ to xₙ | Δx × [f(x₁) + f(x₂) + … + f(xₙ)] |
| Midpoint sum | middle of each strip | Δx × [f(m₁) + … + f(mₙ)] |
| Trapezoidal rule | both ends, joined by a straight line | (Δx ÷ 2) × [f(x₀) + 2f(x₁) + … + 2f(xₙ₋₁) + f(xₙ)] |
| Simpson's rule (n even) | ends and middle of each pair, joined by a parabola | (Δx ÷ 3) × [f(x₀) + 4f(x₁) + 2f(x₂) + … + 4f(xₙ₋₁) + f(xₙ)] |
Example: x² from 0 to 2
The exact area is 8/3 ≈ 2.666667. Here is what each method gives as n grows:
| n | Left | Right | Midpoint | Trapezoid | Simpson |
|---|---|---|---|---|---|
| 4 | 1.75 | 3.75 | 2.625 | 2.75 | 2.666667 |
| 10 | 2.28 | 3.08 | 2.66 | 2.68 | 2.666667 |
| 100 | 2.6268 | 2.7068 | 2.6666 | 2.6668 | 2.666667 |
| 1,000 | 2.662668 | 2.670668 | 2.666666 | 2.666668 | 2.666667 |
Three patterns show up in homework again and again:
- Left and right sums bracket the answer for a function that only rises or only falls. x² rises on [0, 2], so the left sum is too low and the right sum too high. Their average is the trapezoidal rule.
- Midpoint beats trapezoid. For a curve that bends one way, the midpoint error is about half the trapezoid error and on the other side, as the n = 4 row shows (−0.042 against +0.083).
- Simpson's rule is exact for any polynomial up to degree 3, because the parabolas it fits can match a cubic's area exactly. For other functions it still converges much faster than the rectangle sums.
Example: a function with no formula
∫ from 0 to 1 of e^(−x²) dx has no elementary antiderivative, so the Exact method cannot do it. Choose Simpson's rule with n = 10: the calculator returns 0.746825, and with n = 100 the value settles at 0.746824, which is the accepted value to six places.