Skip to content

Integral Calculator

This integral calculator finds antiderivatives and definite integrals with the working shown. Type f(x), then leave the bounds empty for an indefinite integral plus C, or enter a lower and upper bound to get the signed area. It applies the power rule and standard forms, and uses integration by parts or u-substitution when needed. It also works out left, right and midpoint Riemann sums, the trapezoidal rule and Simpson's rule.

Last updated November 18, 2026 · Topic: Calculus

Use x, ^, sin, cos, tan, e^x, ln, abs, sqrt. Example: x*sin(x)

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:

∫c xn dx=c xn+1n+1+C\int c\,x^{n}\,dx = \frac{c\,x^{n+1}}{n+1} + C

The fundamental theorem of calculus turns a definite integral into subtraction:

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

where F is any antiderivative of f.

How to use the integral calculator

  1. Type your function in the f(x) box, such as 6x^2 + 2x or 3x^2 + sin(2x).
  2. For an indefinite integral, leave both bound boxes empty.
  3. For a definite integral, fill in both bounds.
  4. For an approximation, choose a Riemann sum, the trapezoidal rule or Simpson's rule in the Method menu and set the number of subintervals.
  5. Read the antiderivative, then the final value.
  6. 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.

  1. An antiderivative is x² + x.
  2. At 3: 9 + 3 = 12.
  3. At 1: 1 + 1 = 2.
  4. 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

FunctionAntiderivative
A constant kkx + 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⁄xln|x| + C
ln(x)x·ln(x) − x + C
x·sin(x)−x·cos(x) + sin(x) + C

Definite vs indefinite integrals

IndefiniteDefinite
What you enterf(x) onlyf(x), a lower and an upper bound
What you geta family of functions, F(x) + Cone number
Meaningevery antiderivativesigned 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:

MethodWhere f is evaluatedSum
Left Riemann sumleft end of each strip, x₀ to xₙ₋₁Δx × [f(x₀) + f(x₁) + … + f(xₙ₋₁)]
Right Riemann sumright end, x₁ to xₙΔx × [f(x₁) + f(x₂) + … + f(xₙ)]
Midpoint summiddle of each stripΔx × [f(m₁) + … + f(mₙ)]
Trapezoidal ruleboth 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:

nLeftRightMidpointTrapezoidSimpson
41.753.752.6252.752.666667
102.283.082.662.682.666667
1002.62682.70682.66662.66682.666667
1,0002.6626682.6706682.6666662.6666682.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.

FAQ

Frequently asked questions

01What is an integral?

An integral is the reverse of a derivative. The indefinite integral gives a family of functions whose derivative is your function. The definite integral, with bounds, gives a single number, which is the signed area between the graph and the x-axis from one bound to the other.

02Why do I add a constant C?

Many functions have the same derivative. For example, x² + 1 and x² + 7 both have the derivative 2x. The constant C stands for any number that disappears when you differentiate, so it shows that you found a whole family of answers, not just one.

03What is the power rule for integrals?

To integrate c·xⁿ, add one to the exponent and divide by the new exponent: c·xⁿ⁺¹ ÷ (n + 1). For 6x², that gives 6x³ ÷ 3, which is 2x³. The rule works for every power except n = −1, where the integral is ln|x|. The tool handles that case too.

04How do I evaluate a definite integral?

Find the antiderivative F(x), then compute F(upper) − F(lower). The constant C cancels, so you leave it out. For 3x² from 0 to 2, F(x) = x³, and 8 − 0 = 8. The calculator carries out both steps.

05Does this tool integrate trig, exponential or log functions?

Yes. It integrates sin, cos, tan, e^x, ln and abs, with a linear inside, such as sin(2x + 1) or ln(2x + 1). It also does products such as x·sin(x) or x·e^x by parts, and substitutions such as 2x·e^(x²). It tells you clearly when a form is not supported.

06How can I check an integral?

Differentiate your answer. If you get the original function back, the integral is right. The constant C disappears when you differentiate. For the answer x³ + C, the derivative is 3x², which matches the function you started with. The derivative calculator can do the check.

07What is the difference between definite and indefinite integrals?

An indefinite integral is a family of functions, written F(x) + C. A definite integral uses two bounds and gives one number, F(b) − F(a), which is the signed area under the curve. Leave the bounds empty in the calculator for the first and fill them in for the second.

08How do I do integration by parts?

Use ∫ u dv = uv − ∫ v du. Pick u as the part that gets simpler when you differentiate it, such as x in x·e^x. Then du = dx and v = e^x, so the integral is x·e^x − e^x + C. The calculator names the method when it uses it.

09How do I calculate a left Riemann sum?

Split [a, b] into n equal subintervals of width Δx = (b − a) ÷ n, evaluate f at the left end of each one, add those heights and multiply by Δx. For f(x) = x² on [0, 2] with n = 4, Δx = 0.5 and the left ends are 0, 0.5, 1 and 1.5, so the sum is 0.5 × (0 + 0.25 + 1 + 2.25) = 1.75. Choose Left Riemann sum in the Method menu to get the same working.