Calculus

Integral Calculator

This integral calculator finds antiderivatives step by step, naming each technique: power rule, u-substitution, integration by parts or partial fractions.

Try

Use x as the variable, for example sin(x), e^(-x^2) or 1/(1 + x^2). Trigonometric functions use radians.

A number or expression such as pi/2, or -inf. Leave both limits blank for the antiderivative.

Type inf for infinity (an improper integral).

Result

Integral of f(x) from 0 to 2: 14/3 ≈ 4.666666667

Integral of f(x) from 0 to 2

∫02(x2+1)dx=143≈4.666666667\int_{0}^{2} \left(x^{2} + 1\right) \, dx = \frac{14}{3} \approx 4.666666667

Exact value

Decimal value
4.666666667
Estimated errorFrom the Gauss–Kronrod error estimate over 1 subinterval
less than 10⁻¹⁵
Antiderivative F(x)
13x3+x+C\frac{1}{3}x^{3} + x + C
Subintervals used
1
Average value of f on the intervalThe integral divided by (b − a)
73≈2.333333333\frac{7}{3} \approx 2.333333333
Method
Exact antiderivative, checked with Gauss–Kronrod (G7–K15)

The integral of x² + 1 from 0 to 2 is exactly 14/3 ≈ 4.666666667. Since f(x) does not change sign here, this is the area between the curve and the x-axis.

Area under y = x² + 1 from x = 0 to 2
00.511.52xa = 0b = 2
Step-by-step working (5 steps)
  1. Find an antiderivative

    f(x) is a polynomial, so integrate term by term with the power rule ∫xndx=xn+1n+1\int x^n\,dx = \frac{x^{n+1}}{n+1}.

    F(x)=∫(x2+1)dx=13x3+x+CF(x) = \int \left(x^{2} + 1\right) dx = \frac{1}{3}x^{3} + x + C
  2. Evaluate F at the upper limit

    F(2)=143≈4.666666667F\left(2\right) = \frac{14}{3} \approx 4.666666667
  3. Evaluate F at the lower limit

    F(0)=0F\left(0\right) = 0
  4. Subtract (fundamental theorem of calculus)

    The constant C cancels, so any antiderivative gives the same answer.

    ∫02(x2+1)dx=F(2)−F(0)=143≈4.666666667\int_{0}^{2} \left(x^{2} + 1\right) \, dx = F\left(2\right) - F\left(0\right) = \frac{14}{3} \approx 4.666666667
  5. Check numerically

    Adaptive Gauss–Kronrod quadrature gives 4.666666667 with an estimated error of less than 10⁻¹⁵, using 1 subinterval.

Leave the limits blank for F(x) + C, or enter a and b for a definite or improper integral ∫abf(x)dx\int_a^b f(x)\,dx with a shaded area graph.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Type the integrand with x as the variable, for example x e^x, 2x cos(x^2), 1/(x^2 - 1) or e^(-x^2). Implicit multiplication such as 2x works; put function arguments in parentheses. Angles are in radians.
  2. For an indefinite integral (antiderivative), leave both limits blank. The answer is F(x) + C, with each rule shown and a check that differentiating it gives back f(x).
  3. To use it as a definite integral calculator, enter the lower limit a and the upper limit b. Numbers, fractions such as -1/2 and expressions such as pi/4 or sqrt(2) all work.
  4. For an improper integral over an infinite interval, type inf or -inf as a limit, as in ∫1∞1x2dx\int_1^{\infty}\frac{1}{x^2}\,dx.
  5. Read the answer at the top, then open the steps: the antiderivative, F(b) and F(a), the subtraction, and an independent numerical check with its error estimate.

Formulas

Fundamental theorem of calculus

∫abf(x)dx=F(b)−F(a),F′(x)=f(x)\int_a^b f(x)\,dx = F(b) - F(a), \quad F^{\prime}(x) = f(x)

Plain-text formula: ∫_a^b f(x) dx = F(b) − F(a), F′(x) = f(x)

If F is any antiderivative of f and f is continuous on [a, b], the definite integral is the change in F between the limits. The constant of integration cancels.

Power rule for integrals

∫xndx=xn+1n+1+C,n≠−1\int x^n\,dx = \frac{x^{n+1}}{n+1} + C, \quad n \ne -1

Plain-text formula: ∫x^n dx = x^(n + 1)/(n + 1) + C, n ≠ −1

Raise the power by one and divide by the new power. The case n = −1 gives ∫1xdx=ln|x|+C\int \frac{1}{x}\,dx = \ln|x| + C instead.

u-substitution

∫f(g(x))g′(x)dx=∫f(u)du,u=g(x)\int f\left(g(x)\right) g^{\prime}(x)\,dx = \int f(u)\,du, \quad u = g(x)

Plain-text formula: ∫f(g(x))g′(x) dx = ∫f(u) du, u = g(x)

The chain rule in reverse. It applies when the integrand contains an inner function and, up to a constant factor, its derivative.

Integration by parts

∫udv=uv−∫vdu\int u\,dv = uv - \int v\,du

Plain-text formula: ∫u dv = uv − ∫v du

The product rule in reverse. Choose u to be the factor that gets simpler when differentiated, such as a polynomial or ln x.

Improper integrals

∫a∞f(x)dx=limt→∞∫atf(x)dx\int_a^{\infty} f(x)\,dx = \lim_{t \to \infty} \int_a^{t} f(x)\,dx

Plain-text formula: ∫_a^∞ f(x) dx = lim_{t → ∞} ∫_a^t f(x) dx

The integral converges when this limit is finite. Numerically, the infinite interval is mapped onto (0, 1) with x=a+t1−tx = a + \frac{t}{1-t}.

Adaptive Gauss–Kronrod quadrature

∫abf(x)dx≈b−a2∑i=115wif(a+b2+b−a2xi)\int_a^b f(x)\,dx \approx \frac{b-a}{2}\sum_{i=1}^{15} w_i\, f\left(\frac{a+b}{2} + \frac{b-a}{2}x_i\right)

Plain-text formula: ∫_a^b f(x) dx ≈ ((b − a)/2)∑_{i = 1}^15 w_i f((a + b)/2 + ((b − a)/2)x_i)

The 15-point Kronrod rule samples f at fixed nodes xix_i with weights wiw_i. The difference from the embedded 7-point Gauss rule estimates the error, and the subinterval with the largest error is halved until the estimate is small enough.

Reading the result

An indefinite integral is a family of functions: ∫2xdx=x2+C\int 2x\,dx = x^2 + C means every function x2+Cx^2 + C has derivative 2x. Two correct answers can look different, such as sin2⁡x2\frac{\sin^2 x}{2} and −cos2⁡x2-\frac{\cos^2 x}{2}, because they differ by a constant. The check line differentiates the answer so you can see it returns f(x).

A definite integral is a number, the signed area between the curve and the x-axis: regions above the axis count as positive and regions below count as negative. That is why ∫02πsin⁡xdx=0\int_0^{2\pi}\sin x\,dx = 0 even though the curve encloses area. When f changes sign, the result also lists the total area ∫ab|f(x)|dx\int_a^b |f(x)|\,dx and the parts above and below the axis.

The error estimate comes from the numerical check. Values around 10−1210^{-12} mean every displayed digit can be trusted. If the calculator reports that the integrand is undefined or infinite, the integral may diverge (as ∫011xdx\int_0^1 \frac{1}{x}\,dx does) or there may be a vertical asymptote inside the interval, as with tan⁡x\tan x at x=π/2x = \pi/2.

How to calculate a definite integral

1. Find an antiderivative F(x), a function whose derivative is f(x). 2. Check that f is continuous on [a, b]; if it has a vertical asymptote there, the integral is improper and F(b) − F(a) does not apply directly. 3. Evaluate F at the upper limit and at the lower limit. 4. Subtract: ∫abf(x)dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a). You can leave out + C, because it cancels.

For example, ∫13(2x+1)dx\int_1^3 (2x + 1)\,dx: the antiderivative is F(x)=x2+xF(x) = x^2 + x, so F(3)=12F(3) = 12 and F(1)=2F(1) = 2, and the integral is 12−2=1012 - 2 = 10. The calculator shows these same four steps. When no elementary antiderivative exists, as for e−x2e^{-x^2}, it still gives the definite integral by numerical integration: ∫01e−x2dx≈0.7468241328\int_0^1 e^{-x^2}\,dx \approx 0.7468241328.

Integration by substitution (u-substitution)

Look for an inner function whose derivative also appears as a factor. In ∫2xcos(x2)dx\int 2x\cos(x^2)\,dx, the inner function is x2x^2 and its derivative 2x is the other factor. Let u=x2u = x^2, so du=2xdxdu = 2x\,dx, and the integral becomes ∫cos⁡udu=sin⁡u+C=sin(x2)+C\int \cos u\,du = \sin u + C = \sin(x^2) + C.

A constant factor that does not match is fine: in ∫xex2dx\int x e^{x^2}\,dx, du=2xdxdu = 2x\,dx, so xdx=12dux\,dx = \frac{1}{2}du and the answer is 12ex2+C\frac{1}{2}e^{x^2} + C. The same idea gives ∫f′(x)f(x)dx=ln|f(x)|+C\int \frac{f^{\prime}(x)}{f(x)}\,dx = \ln|f(x)| + C, for example ∫xx2+1dx=12ln(x2+1)+C\int \frac{x}{x^2 + 1}\,dx = \frac{1}{2}\ln(x^2 + 1) + C.

Integration by parts

Use ∫udv=uv−∫vdu\int u\,dv = uv - \int v\,du for a product where one factor becomes simpler when differentiated. For ∫xexdx\int x e^x\,dx, take u=xu = x and dv=exdxdv = e^x\,dx, so du=dxdu = dx and v=exv = e^x. Then ∫xexdx=xex−∫exdx=xex−ex+C\int x e^x\,dx = x e^x - \int e^x\,dx = x e^x - e^x + C.

A common way to choose u is LIATE: Logarithms, Inverse trig, Algebraic (powers of x), Trig, Exponentials, taking u from earlier in the list. That is why ∫ln⁡xdx\int \ln x\,dx uses u=ln⁡xu = \ln x, dv=dxdv = dx, giving xln⁡x−x+Cx\ln x - x + C. For x2sin⁡xx^2\sin x the calculator repeats parts twice with the tabular method, and for exsin⁡xe^x \sin x the original integral reappears, so it solves for it.

Partial fractions

A rational function P(x)/Q(x) is split into simpler fractions that each integrate to a logarithm or an arctangent. If the numerator’s degree is not less than the denominator’s, divide the polynomials first.

For ∫1x2−1dx\int \frac{1}{x^2 - 1}\,dx, factor x2−1=(x−1)(x+1)x^2 - 1 = (x - 1)(x + 1) and write 1x2−1=1/2x−1−1/2x+1\frac{1}{x^2 - 1} = \frac{1/2}{x - 1} - \frac{1/2}{x + 1}. Integrating each term gives 12ln|x−1|−12ln|x+1|+C\frac{1}{2}\ln|x - 1| - \frac{1}{2}\ln|x + 1| + C. A quadratic that does not factor, such as x2+2x+5=(x+1)2+4x^2 + 2x + 5 = (x + 1)^2 + 4, gives an arctangent: ∫dxx2+2x+5=12arctan⁡x+12+C\int \frac{dx}{x^2 + 2x + 5} = \frac{1}{2}\arctan\frac{x + 1}{2} + C.

Table of common integrals

Every result the calculator gives is built from these basic integrals and the techniques above. Add + C to each indefinite integral.

Common indefinite integrals
Function f(x)f(x)Integral ∫f(x)dx\int f(x)\,dx
xnx^n, n≠−1n \ne -1xn+1n+1\frac{x^{n+1}}{n+1}
1x\frac{1}{x}ln|x|\ln|x|
exe^xexe^x
axa^xaxln⁡a\frac{a^x}{\ln a}
sin⁡x\sin x−cos⁡x-\cos x
cos⁡x\cos xsin⁡x\sin x
tan⁡x\tan x−ln|cos⁡x|-\ln|\cos x|
sec2⁡x\sec^2 xtan⁡x\tan x
sec⁡xtan⁡x\sec x \tan xsec⁡x\sec x
sin2⁡x\sin^2 xx2−sin⁡2x4\frac{x}{2} - \frac{\sin 2x}{4}
ln⁡x\ln xxln⁡x−xx\ln x - x
11+x2\frac{1}{1 + x^2}arctan⁡x\arctan x
1x2+a2\frac{1}{x^2 + a^2}1aarctan⁡xa\frac{1}{a}\arctan\frac{x}{a}
11−x2\frac{1}{\sqrt{1 - x^2}}arcsin⁡x\arcsin x
f(ax+b)f(ax + b)1aF(ax+b)\frac{1}{a}F(ax + b)

Area under a curve and area between curves

To use this page as an area under the curve calculator, enter f(x) and the two x-values as limits. When f(x) ≥ 0 on the interval, the definite integral is the area and the graph shades it. When the curve dips below the x-axis, the integral subtracts that part; the result then also lists the total area ∫ab|f(x)|dx\int_a^b |f(x)|\,dx. For sin⁡x\sin x from 0 to 2π2\pi the integral is 0 but the total area is 4.

For the area between two curves, integrate the top curve minus the bottom one: enter f(x) - g(x). Between y=xy = x and y=x2y = x^2 from 0 to 1, enter x - x^2 to get 16\frac{1}{6}. To find where two curves cross, solve f(x) = g(x) with the equation solver or look at the graphing calculator.

Common mistakes when integrating

Most wrong answers come from one of these slips. Differentiating your answer, as the calculator does in its check step, catches all of the indefinite ones.

Integration mistakes and the correct result
MistakeWrongRight
Leaving out the constant of integration∫2xdx=x2\int 2x\,dx = x^2x2+Cx^2 + C
Not dividing by the inner coefficient∫cos⁡3xdx=sin⁡3x\int \cos 3x\,dx = \sin 3x13sin⁡3x+C\frac{1}{3}\sin 3x + C
Using the power rule on 1/x∫x−1dx=x00\int x^{-1}\,dx = \frac{x^0}{0}ln|x|+C\ln|x| + C
Integrating a product factor by factor∫xexdx=x22ex\int x e^x\,dx = \frac{x^2}{2}e^xxex−ex+Cx e^x - e^x + C (by parts)
Using F(b) − F(a) across an asymptote∫−11dxx2=−2\int_{-1}^{1}\frac{dx}{x^2} = -2Diverges (infinite area at x = 0)
Forgetting to substitute back after u-substitutionsin⁡u+C\sin u + Csin(x2)+C\sin(x^2) + C

Worked example

Integrate x² + 1 from 0 to 2

Find the exact value of ∫02(x2+1)dx\int_0^2 (x^2 + 1)\,dx, the area under the curve between x = 0 and x = 2.

  1. Antiderivative by the power rule: F(x)=x33+xF(x) = \frac{x^3}{3} + x.
  2. Upper limit: F(2)=83+2=143F(2) = \frac{8}{3} + 2 = \frac{14}{3}.
  3. Lower limit: F(0)=0F(0) = 0.
  4. Subtract: ∫02(x2+1)dx=143−0=143\int_0^2 (x^2 + 1)\,dx = \frac{14}{3} - 0 = \frac{14}{3}.

Answer: The integral equals exactly 14/3 ≈ 4.666666667. Because x² + 1 is positive, this is the area under the curve between x = 0 and x = 2.

Frequently asked questions

What is an integral?

An integral adds up infinitely many infinitely thin slices. The definite integral ∫abf(x)dx\int_a^b f(x)\,dx is the signed area between the graph of f and the x-axis from a to b. The indefinite integral ∫f(x)dx\int f(x)\,dx is the family of antiderivatives F(x) + C, the functions whose derivative is f. The fundamental theorem of calculus links the two.

Is this integral calculator free, and does it show the steps?

Yes. It is free with no sign-up and no daily limit, and it shows the full working: the technique used on each step, the antiderivative, the evaluation at both limits and a numerical check. It runs in your browser.

How do I find an integral without limits (the antiderivative)?

Leave both limit boxes blank. The calculator returns the indefinite integral F(x) + C, names each rule it used, and differentiates the answer to show it gives back f(x).

Why does it say no antiderivative was found?

Some functions have no antiderivative that can be written with elementary functions, for example e−x2e^{-x^2}, sin⁡xx\frac{\sin x}{x} and xxx^x. Others, such as odd powers like sin3⁡x\sin^3 x, need identities the calculator does not apply yet. In both cases, enter limits a and b: the definite integral is still computed accurately by numerical integration.

Why is my answer different from the one in my textbook?

Antiderivatives are only unique up to a constant, and the same function can be written in several forms. sin2⁡x2\frac{\sin^2 x}{2} and −cos2⁡x2-\frac{\cos^2 x}{2} differ by the constant 12\frac{1}{2}, so both are correct. Differentiate both answers, or compare a definite integral computed from each.

What does a negative integral mean?

More of the signed area lies below the x-axis than above it. For example, ∫−10(x3−x)dx=14\int_{-1}^{0}(x^3 - x)\,dx = \frac{1}{4} but ∫01(x3−x)dx=−14\int_{0}^{1}(x^3 - x)\,dx = -\frac{1}{4}. Swapping the limits also flips the sign.

How do I enter infinity?

Type inf for +∞ or -inf for −∞ in either limit (the ∞ symbol also works). The calculator then evaluates an improper integral, such as ∫1∞1x2dx=1\int_1^{\infty}\frac{1}{x^2}\,dx = 1, and says so if it diverges, as ∫1∞1xdx\int_1^{\infty}\frac{1}{x}\,dx does.

How accurate is the result?

Antiderivatives are exact and verified by differentiation. Definite integrals are confirmed by quadrature that aims for a relative error of about 10−1110^{-11}, and the estimated error is shown with every result. Functions with jumps, kinks or rapid oscillation need more subintervals and may be less accurate.

Can it do double or triple integrals?

No. It integrates functions of one variable, x. For a double integral over a rectangle, integrate the inner variable by hand and use the calculator for the outer integral, or for each slice numerically.

Why are trigonometric functions in radians?

Calculus formulas such as ∫cos⁡xdx=sin⁡x+C\int \cos x\,dx = \sin x + C hold only in radians. To integrate a function of an angle in degrees, write sin(pi x/180).

Derivative Calculator

First to fifth derivatives with rule-by-rule steps, f′(a), the tangent line and a graph.

Calculus

Limit Calculator

Two-sided, one-sided and infinite limits with steps, a table of values and the indeterminate form named.

Calculus

Summation Calculator

Sigma notation with steps: exact fractions, partial sums, closed forms and infinite-series tests.

Calculus

Function Table Calculator

Tables of values for one or two functions with exact fractions, roots, turning points, a graph and CSV.

Calculus

Graphing Calculator

Plot functions, equations, inequalities, parametric and polar curves; find roots and intersections.

Tools

Step-by-Step Math Solver

Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.

Tools

Learn more: For definite integrals inside the full calculator, read the calculus functions manual.

Sources and further reading

  1. Calculus Volume 1, Chapter 5: Integration (opens in a new tab), OpenStax, Rice University
  2. Calculus Volume 2, Chapter 3: Techniques of Integration (opens in a new tab), OpenStax, Rice University
  3. 18.01SC Single Variable Calculus, Unit 3: The Definite Integral and its Applications (opens in a new tab), MIT OpenCourseWare
  4. NIST Digital Library of Mathematical Functions, §3.5 Quadrature (opens in a new tab), National Institute of Standards and Technology
  5. QUADPACK: A Subroutine Package for Automatic Integration (Piessens, de Doncker-Kapenga, Überhuber, Kahaner), Springer, 1983

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?