Math
Integral calculator
Enter a function to integrate. The calculator finds the antiderivative and names the method it used, checks it by differentiating, and for a definite integral gives both the exact value and an independent numerical one.
Use ^ for powers. ln is the natural log; sqrt, abs, sin, cos, tan, asin, e and pi work. Type "inf" for ∞ in the limits.
┄ shaded: the signed area ━ f(x) = x·sin(x)
Show the working, step by step
Integration by parts. Integrate by parts with u = x (differentiate it until it reaches 0) and dv = sin(x) dx (integrate it repeatedly). The tabular method multiplies each entry in the u column by the next entry in the dv column, with alternating signs:
Sign u and its derivatives dv and its integrals + x −cos(x) − 1 −sin(x) Add the diagonal products.
∫ x·sin(x) dx = −x·cos(x) + sin(x) = sin(x) − x·cos(x)
Collect the terms and add the constant of integration.
∫ x·sin(x) dx = sin(x) − x·cos(x) + C
Check by differentiating: the derivative of the answer should be the integrand. It matches f at 10 test points (largest relative difference 0.0e+0).
d/dx [sin(x) − x·cos(x)] = x·sin(x)
Evaluate F at the limits (the fundamental theorem of calculus).
F(pi) − F(0) = 3.141592654 − 0 = π
Numerical check with adaptive Gauss–Kronrod quadrature.
≈ 3.141592654 (estimated error 2.8e-12)
Area below the axis counts as negative.
The fundamental theorem of calculus
∫ₐᵇ f(x) dx = F(b) − F(a), where F′(x) = f(x)
To find the area under f from a to b, find any antiderivative F and subtract its values at the ends. The hard part is F. Some integrands match a standard form directly; most need one of the techniques below first.
Methods the calculator uses
| Method | When it applies | Example |
|---|---|---|
| Power rule | Polynomials and xⁿ, n ≠ −1 | ∫x³ dx = x⁴/4 |
| Reciprocal rule | 1/x | ∫1/x dx = ln|x| |
| Integration by parts | Polynomial × sin, cos or eˣ | ∫x·eˣ dx = eˣ(x − 1) |
| Parts twice | eᵃˣ × sin or cos | ∫eˣcos x dx = eˣ(cos x + sin x)/2 |
| u-substitution | A function times the derivative of its inside | ∫cos x·e^(sin x) dx = e^(sin x) |
| Product-to-sum | sin(ax)·cos(bx) | ∫sin 3x cos 2x dx = −cos(x)/2 − cos(5x)/10 |
| Completing the square | 1/(ax² + bx + c) with no real roots | ∫1/(x² + 2x + 5) dx = ½·atan((x + 1)/2) |
| Partial fractions and tables | Rational functions, standard forms | ∫x/(x² + 3x + 2) dx = 2ln(x + 2) − ln(x + 1) |
A worked example
The default is the definite integral of x·sin(x) from 0 to π.
- Integrate by parts with u = x and dv = sin(x) dx, so du = dx and v = −cos(x).
- ∫x·sin(x) dx = −x·cos(x) − ∫(−cos x) dx = sin(x) − x·cos(x) + C.
- Check: the derivative of sin(x) − x·cos(x) is cos x − cos x + x·sin x = x·sin x.
- F(π) = sin π − π·cos π = 0 − π·(−1) = π. F(0) = 0 − 0 = 0.
- So the integral is π ≈ 3.14159, and the numerical quadrature agrees to 10 figures.
Signed area
A definite integral counts area below the x-axis as negative. ∫ from 0 to 2π of sin x dx is 0, because the positive arch cancels the negative one. For the total area between the curve and the axis, split the interval where f changes sign and add the absolute values of the pieces. Swapping the limits changes the sign: ∫ from 3 to 0 of x² dx is −9.
Improper integrals
An integral is improper when a limit is infinite or f is unbounded on the interval. It converges if the area is finite. The benchmarks: ∫ from 1 to ∞ of 1/xᵖ dx converges only for p > 1 (to 1/(p − 1)), and ∫ from 0 to 1 of 1/xᵖ dx converges only for p < 1. So 1/√x has finite area on [0, 1] (it is 2) while 1/x does not.
Common mistakes
- Forgetting + C on an indefinite integral.
- Using F(b) − F(a) across a point where f is infinite. ∫ from −1 to 1 of 1/x² dx is not −2; it diverges.
- Treating ∫1/x dx as x⁰/0: the power rule fails at n = −1, which is where ln|x| comes in.
- Dropping the chain factor when substituting: ∫cos(3x) dx is sin(3x)/3, not sin(3x).
Common questions
What is the difference between a definite and an indefinite integral?
An indefinite integral is a family of functions: every F with F′ = f, written F(x) + C. A definite integral is a number, the signed area under f between two limits, found as F(b) − F(a). The constant C cancels in that subtraction, which is why definite integrals do not carry one.
How is the answer checked?
By differentiating it. If F is right, F′ must equal the integrand at every point. The calculator differentiates its antiderivative and compares with f at ten test points, and for definite integrals it also computes the value numerically with adaptive Gauss–Kronrod quadrature, independently of the antiderivative.
Why does it say no closed form was found?
Some integrals have no antiderivative made of ordinary functions. ∫e^(−x²) dx needs the error function erf, and ∫sin(x)/x dx and ∫1/ln(x) dx cannot be written with elementary functions at all. Others exist but are beyond this solver. In either case a definite integral still has a numerical value, which the calculator gives.
Can it do improper integrals, such as from 1 to infinity?
Yes. Type inf or -inf as a limit. The infinite range is mapped onto a finite one for the numerical value, and the antiderivative’s limit is used for the exact value. ∫ from 1 to ∞ of 1/x² dx is 1, but ∫ from 1 to ∞ of 1/x dx diverges, and the calculator reports that. An integrand that blows up inside the interval, like 1/x² on [−1, 1], is split at the problem point and checked for divergence too.
Why is ln(x) given instead of ln|x|?
∫1/x dx is ln|x| + C: the absolute value makes it valid for negative x as well. Computer algebra usually drops the bars, so read any ln(u) in an antiderivative as ln|u| when u can be negative. The calculator’s own reciprocal rule keeps the bars.
Related calculators
-
Derivative
Differentiate step by step, the reverse of integration.
-
Double integrals
Integrate f(x, y) over a rectangle, plus gradients and critical points.
-
Infinite series
Convergence tests and sums, including the integral comparison.
-
Differential equations
Solve y′ = f(x, y) numerically, and linear equations exactly.
-
Limit
Limits with L’Hôpital’s rule and a table of values.