What an antiderivative is, and why it comes with a constant
An antiderivative of f is any function F whose derivative is f. Differentiation destroys constants — the derivative of 7 is zero, exactly like the derivative of −13 — so reversing the operation cannot recover which constant was there. Every antiderivative of 2x has the form x² + C, and the + C is not decoration; it is the honest statement that the problem has infinitely many answers differing only by a vertical shift.
That single fact drives the difference between this calculator and the definite integral calculator. A definite integral subtracts F(b) − F(a), and the constant cancels, so you get one number. An indefinite integral is a whole family of functions, and it is what you need when the integral is an intermediate step — solving a differential equation, recovering a position from a velocity, or building a potential from a force.
Antidifferentiation is genuinely harder than differentiation, and the asymmetry is structural rather than a matter of practice. Differentiation rules compose: knowing how to differentiate f and g tells you how to differentiate their product, quotient and composition. Integration rules do not. There is no product rule for integrals, no quotient rule, no chain rule — only substitution and by parts, which are the product and chain rules read backwards and which only work when the integrand happens to have the right shape.
Worse, some perfectly ordinary functions have no elementary antiderivative at all. e^(−x²), sin(x)/x and 1/ln x are the standard examples. Liouville proved in the 1830s that this is a theorem, not a gap in anyone's technique.
How this calculator finds the antiderivative
It splits the integrand into terms. The sum rule says the integral of a sum is the sum of the integrals, and constant multiples pull straight out. So the first step is to flatten your expression into a list of terms, each with its numeric coefficient peeled off, which is exactly what appears in the term-by-term table.
Each term is matched against a pattern. The list is the standard one you would use by hand: the power rule for x^n, the logarithm rule for 1/x, the exponential rule, the standard trigonometric integrals, the arctangent and arcsine forms, and integration by parts for the three cases x·e^(kx), x·sin(kx) and x·cos(kx). Every one of these also accepts a linear inner function, so sin(3x + 1) is handled by dividing through by the 3 that the chain rule would have produced.
It then verifies its own answer. The antiderivative is differentiated symbolically and compared against your integrand at nine sample points. The largest relative gap is reported as the verification residual, and on a correct answer it comes out at the level of floating-point noise. This is the check every calculus student is told to do and almost nobody does.
Where no pattern matches, it says so. That covers two very different situations: an integrand that needs a technique outside the list, such as partial fractions or a trigonometric substitution, and an integrand with no elementary antiderivative at all. The calculator cannot distinguish between them, and it does not pretend to.
Worked example: ∫ (3x² + 2 sin 2x) dx
This is the default integrand. Take it one term at a time.
- Split the sum.
∫(3x² + 2 sin 2x) dx = ∫3x² dx + ∫2 sin 2x dx. - Pull out the constants.
= 3∫x² dx + 2∫sin 2x dx. - First integral, power rule.
∫x² dx = x³/3, so the term contributes3 · x³/3 = x³. - Second integral, substitution. Let
u = 2x, sodu = 2 dxanddx = du/2. Then∫sin 2x dx = (1/2)∫sin u du = −cos(u)/2 = −cos(2x)/2. The term contributes2 · (−cos(2x)/2) = −cos(2x). - Add and attach the constant.
F(x) = x³ − cos(2x) + C.
Now check it by differentiating. d/dx [x³] = 3x². d/dx [−cos(2x)] = +sin(2x)·2 = 2 sin 2x by the chain rule. Adding those gives 3x² + 2 sin 2x, the original integrand. The answer is right.
Evaluate at x = 1. With C = 0, F(1) = 1 − cos 2 = 1 − (−0.4161468) = 1.4161468. That is the number this page reports on first load, and it is one of its test vectors.
A by-parts case. For ∫x e^x dx, choose u = x and dv = e^x dx, so du = dx and v = e^x. Then ∫x e^x dx = x e^x − ∫e^x dx = x e^x − e^x + C = e^x(x − 1) + C. At x = 1 that is e·0 = 0. Differentiating back: e^x(x − 1) + e^x·1 = e^x·x, which is the integrand.
How to read the result and the verification figure
The verification residual is the number to look at first. It reports the worst relative disagreement between the derivative of the printed answer and your integrand, measured at nine points spread across the positive axis. On a correct answer it sits below 1e−12. Anything materially larger means the answer disagrees with the integrand somewhere and should not be trusted.
The residual can be blank without anything being wrong. If the sample points fall outside the domain of your function — an integrand defined only for negative x, say — there is nothing to compare and the check reports nothing. In that case verify by hand.
Your answer may look different from a textbook's and still be correct. Antiderivatives are unique only up to a constant, and algebraically equivalent forms abound. ∫2 sin x cos x dx can be written as sin²x, as −cos²x or as −cos(2x)/2, and all three differ from one another by constants. Differentiate both forms, or subtract them and check the difference is constant.
The absolute value in a logarithm matters. ∫dx/x = ln|x| + C, not ln x + C. Dropping the bars restricts the answer to positive x and silently loses half the domain. The calculator keeps them.
The term table shows where a mistake would be. If the total answer looks wrong, compare each row against your own work: it names the term, its antiderivative and the rule applied, so an error localises to a single line.
Integration rules this calculator applies
| Integrand | Antiderivative | Rule |
|---|---|---|
x^n, n ≠ −1 | x^(n+1)/(n+1) | Power rule |
1/x | ln|x| | Logarithm rule |
e^(kx) | e^(kx)/k | Exponential rule |
a^x | a^x/ln a | Exponential rule |
sin(kx) | −cos(kx)/k | Substitution |
cos(kx) | sin(kx)/k | Substitution |
tan(kx) | −ln|cos(kx)|/k | Substitution |
sec²(kx) | tan(kx)/k | Standard form |
1/(1 + x²) | arctan x | Arctangent form |
1/sqrt(1 − x²) | arcsin x | Arcsine form |
ln x | x·ln x − x | By parts |
x·e^(kx) | e^(kx)(kx − 1)/k² | By parts |
x·sin(kx) | (sin(kx) − kx·cos(kx))/k² | By parts |
x·cos(kx) | (cos(kx) + kx·sin(kx))/k² | By parts |
sqrt(kx + b) | 2(kx + b)^1.5/(3k) | Power rule after substitution |
Anything outside this list is reported as not found rather than guessed. Partial fractions, trigonometric substitution and repeated integration by parts are not implemented.
Mistakes that make an antiderivative wrong
- Forgetting the constant of integration. An indefinite integral without
+ Cnames one member of a family and calls it the whole family. It matters the moment you use the result in a differential equation. - Applying the power rule at n = −1.
x^0/0is undefined; the answer isln|x|. This is the one exception to the power rule and it is the one every course tests. - Losing the factor from the chain rule.
∫sin(3x) dx = −cos(3x)/3. Substitution puts the reciprocal of the inner slope out front, and dropping it is the most common substitution error. - Inventing a product rule.
∫fg dxis not(∫f)(∫g). Test it on∫x·x dx: the true answer isx³/3, while the invented rule givesx⁴/4. - Dropping the absolute value in a logarithm.
ln|x|, notln x. Without the bars the antiderivative is undefined on the negative half of the domain where the integrand is perfectly well behaved. - Assuming an antiderivative exists in elementary form. It often does not. If the calculator finds nothing, it may be telling you that no formula exists rather than that it failed.
When to use a different tool
If you only need a number between two limits, go straight to the definite integral calculator. It works for every integrand, including the ones with no elementary antiderivative, because it evaluates the accumulation numerically rather than searching for a formula.
If you are being asked to demonstrate a specific numerical rule, Simpson's rule and the trapezoidal rule show the node table and the coefficient pattern that a homework answer needs.
If the integral is the area between two curves, use the area between curves calculator, which finds the intersections and splits the integral for you.
To check any answer you obtained by hand, differentiate it with the derivative calculator and compare against your integrand. That is a complete proof of correctness up to the constant, and it works even for antiderivatives this calculator could not find.
For techniques not implemented here, the usual next steps are partial fractions for a rational function whose denominator factors, trigonometric substitution for expressions containing sqrt(a² − x²) or sqrt(x² + a²), and repeated integration by parts for x^n against an exponential or trigonometric factor. Each is a mechanical procedure once you recognise the shape.
