Integrate a function
What an integral measures
An indefinite integral, written ∫f(x) dx, asks for an antiderivative: a function F whose derivative is f. Because the derivative of any constant is zero, there is a whole family of answers, F(x) + C. A definite integral, written ∫ₐᵇ f(x) dx, is a single number. It adds up f(x) across the interval from a to b, counting area above the x-axis as positive and area below it as negative.
The Fundamental Theorem of Calculus ties the two together: if F is any antiderivative of a continuous function f, then ∫ₐᵇ f(x) dx = F(b) − F(a). That is why finding antiderivatives matters even when you only want a number.
How the calculator chooses a method
Integration is less mechanical than differentiation; there is no single rule that always works. The engine tries these techniques in order, the same order most courses teach them:
- Linearity: split sums apart and move constant factors outside the integral.
- Power rule: ∫xⁿ dx = xⁿ⁺¹/(n+1) for n ≠ −1, and ∫(1/x) dx = ln|x|.
- Standard table: exponentials, sine and cosine, sec², sec·tan, the arctangent and arcsine forms, each also with a linear inside such as e^(3x) or cos(2x − 1).
- Identities: sin²(x), cos²(x) and tan²(x) are rewritten with power-reducing or Pythagorean identities first.
- u-substitution: look for an inner function whose derivative also appears as a factor, like x·e^(x²) or ln(x)/x.
- Integration by parts: for a polynomial times e^x, sin(x) or cos(x), and for powers of x times ln(x), repeated with the tabular method when needed.
Worked examples
Example 1: ∫(3x² + 2x − 5) dx
Answer: x³ + x² − 5x + C
- Integrate term by term (sum rule).
- Power rule: 3x² → 3·x³/3 = x³, and 2x → x².
- The constant −5 integrates to −5x. Add + C.
Example 2: ∫x·e^(x²) dx
Answer: e^(x²)/2 + C
- Let u = x², so du = 2x dx and x dx = du/2.
- The integral becomes ½∫e^u du = ½e^u.
- Substitute back: e^(x²)/2 + C.
Example 3: ∫x·cos(x) dx
Answer: x·sin(x) + cos(x) + C
- Integration by parts with u = x and dv = cos(x) dx.
- Then du = dx and v = sin(x), so the integral is x·sin(x) − ∫sin(x) dx.
- −∫sin(x) dx = cos(x). Add + C.
Example 4: ∫₀^π sin(x) dx
Answer: 2
- An antiderivative is F(x) = −cos(x).
- F(π) − F(0) = −cos(π) − (−cos(0)) = 1 + 1.
- The area under one arch of the sine curve is exactly 2.
Common mistakes
The most common error is dropping the + C on an indefinite integral. A close second is forgetting the inner coefficient: ∫cos(2x) dx is sin(2x)/2, not sin(2x), because differentiating sin(2x) produces an extra factor of 2 that has to be cancelled. Students also write ln(x) instead of ln|x| for ∫dx/x; the absolute value keeps the answer valid for negative x.
Integrals of products cannot be split factor by factor. ∫x·cos(x) dx is not (x²/2)·sin(x); differentiate that guess and the product rule produces extra terms. Products call for substitution or integration by parts. With a definite integral and a substitution, either change the bounds to the new variable or substitute back before plugging in the original bounds, not a mixture of both.
How to verify an answer
Differentiate your antiderivative. If you get the integrand back, your answer is correct, whatever it looks like. For a definite integral, sketch the graph: the sign and rough size of the area should match the number. A quick check with a few rectangles, or with the midpoint rule, catches most arithmetic slips. Use the derivative calculator to differentiate an answer you worked out by hand.
Related calculators
Questions about integrals
Why does every indefinite integral end in + C?
Differentiating a constant gives zero, so if F(x) is an antiderivative then F(x) + 5, F(x) − 2 and every other F(x) + C are too. The + C stands for that whole family. A definite integral has no + C because the constant cancels in F(b) − F(a).
Why do some integrals show only a decimal?
Some functions, such as e^(x²) and sin(x)/x, have no antiderivative that can be written with ordinary functions. For those, the calculator still evaluates a definite integral numerically with adaptive Simpson's rule, which is accurate to about nine digits on a smooth interval.
How do I know the answer is right?
Differentiate it. If the derivative of your answer equals the integrand, the antiderivative is correct. The calculator does exactly this at several sample points before it shows a result, and it rejects any candidate that fails.
My textbook answer looks different. Is one of them wrong?
Not necessarily. Two antiderivatives of the same function can differ by a constant, and identities can make equal answers look different. For example, sin²(x)/2 and −cos²(x)/2 differ by exactly 1/2, so both are correct answers to ∫sin(x)cos(x) dx.
Editorial standard: formulas and methods are checked against OpenStax Calculus Volume 1, Chapter 5 (Integration), and Volume 2, Chapter 3 (Techniques of Integration). Content is written and maintained by SilverCodeLabs. Report a correction with the exact integral and the expected result.