Integral calculator

Free calculator for a primitive, an integral from a to b, the area under a curve and the mean value, step by step, with integration by parts.

What you are looking for

Examples: x², 1/x, x·e^x, 2x/(x²+1), sin(x), √x, ln(x). x is the variable; e and π are understood.

A number, a fraction (1/2), pi or e: for example 0, 1/2, pi, e.

Recognised: polynomials, √, ln, exp, sin, cos, tan and the forms u′/u, u′uⁿ, u′eᵘ, plus integration by parts (x·eˣ, ln x, x·ln x, x·sin x, x·cos x). Exact values are checked with Simpson's method; otherwise only an estimate is given.

CALCULATION RECEIPT- / - / -
Integral x·eˣ dx = 1

∫_0^1 x·eˣ dx = 1 (integration by parts).

00.20.40.60.8100.511.522.5
What you are looking forIntegral from a to b
f(x)x·eˣ
Lower bound a0
Upper bound b1
Methodintegration by parts
Primitive used F(x)F(x) = x·eˣ − eˣ
Bracket [F(x)][x·eˣ − eˣ]_0^1 = 1
Check (Simpson)≈ 1
Mean value μ1
PDF: receipt, chart and detailed table.

Step-by-step solution

  1. f is continuous on [0 ; 1], so the integral exists and a primitive of f can be used.

  2. We look for a primitive F of the function f given by f(x) = x·eˣ.

  3. Integration by parts: let u = x and v′ = eˣ. Then u′ = 1 and v = eˣ.

  4. ∫ u v′ dx = uv − ∫ u′v dx = x·eˣ − ∫ (eˣ) dx.

  5. Let u = x; then u′ = 1.

  6. Form u′eᵘ: ∫ u′eᵘ dx = eᵘ.

  7. A primitive of f is F(x) = x·eˣ − eˣ. All the primitives of f are F(x) + C, with C ∈ ℝ.

  8. For the integral, the formula reads ∫_0^1 u v′ dx = [uv]_0^1 − ∫_0^1 u′v dx; we compute it with the primitive found.

  9. ∫_0^1 x·eˣ dx = [F(x)]_0^1 = F(1) − F(0), with F(x) = x·eˣ − eˣ.

  10. F(1) = 0 and F(0) = −1.

  11. ∫_0^1 x·eˣ dx = 1.

  12. Numeric check (Simpson's method): ≈ 1.

What does this tool do?

This calculator gives a primitive (antiderivative) of a function, the value of an integral from a to b, the area under a curve and the mean value, and writes the solution the way a 2nd-year Bac notebook does. It covers polynomials, √, ln, exp, sin, cos and the forms of the course: u′/u, u′uⁿ, u′eᵘ, plus integration by parts for x·eˣ, ln x, x·ln x, x·sin x and x·cos x.

Every primitive is checked by differentiating it and comparing with f, and every integral is compared with Simpson's method. If a check fails, no exact result is shown. When no method of the course applies, for example for e^(x²), the calculator only gives a numeric value marked as an estimate, never an invented primitive.

It suits students of Sciences Maths and Sciences Expérimentales who want to check an exercise before writing it up. To differentiate a function, use the derivative calculator.

How to use it

  1. Type the function with x as the variable, for example x·e^x, 2x/(x²+1) or sin(x), or tap an example.
  2. Choose Primitive, Integral from a to b or Area, then enter the bounds a and b (numbers, fractions, pi or e).
  3. Read the exact result and its decimal value, the graph with the shaded area and the detailed solution, then copy it or download the PDF.

Bounds accept numbers, fractions such as 1/2, and pi and e. The Area mode needs a < b. The exact result is written with the bracket [F(x)] and its bounds, and the ≈ sign only appears for a rounded value. The Share button copies a link with the same function and bounds.

Calculation method

f(x)Primitive F(x)
kkx
xⁿ (n ≠ −1)xⁿ⁺¹/(n + 1)
1/xln|x|
eˣeˣ
cos xsin x
sin x−cos x
u′uⁿ (n ≠ −1)uⁿ⁺¹/(n + 1)
u′/uln|u|
u′/√u2√u
u′eᵘeᵘ

∫ u v′ dx = [uv] − ∫ u′v dx  ·  ∫ab f(x) dx = [F(x)]ab = F(b) − F(a)
Area: 𝒜 = ∫ab |f(x)| dx in square units  ·  Mean value: μ = (1/(b − a)) ∫ab f(x) dx

A primitive of f is a function F with F′ = f. It is not unique: a constant C can always be added. To compute an integral from a to b, take any primitive and compute F(b) − F(a), written [F(x)] with the bounds a and b.

To spot the form u′uⁿ, u′/u or u′eᵘ, set u, compute u′, then compare. The calculator accepts a constant factor: x·e^(x²) is half of 2x·e^(x²), so a primitive is ½e^(x²). For u′/u we write ln|u|, or ln(u) when u > 0.

Integration by parts is for a product. Choose u and v′, compute u′ and v, then ∫ u v′ = [uv] − ∫ u′v. For ln x, take u = ln x and v′ = 1. The area between the curve and the x axis uses |f|: split where f changes sign.

Worked example

Example 1: the integral from 0 to 1 of x·eˣ dx (by parts)

  1. Let u = x and v′ = eˣ. Then u′ = 1 and v = eˣ.
  2. ∫ u v′ dx = uv − ∫ u′v dx = x·eˣ − ∫ eˣ dx, so F(x) = x·eˣ − eˣ.
  3. [F(x)] from 0 to 1 is F(1) − F(0), with F(1) = e − e = 0 and F(0) = 0 − 1 = −1.
  4. The integral is 0 − (−1) = 1. Simpson's method also gives 1.

The integral from 0 to 1 of x·eˣ dx = 1 (exact value).

Another scenario: the area of f(x) = x² − 1 on [0 ; 2]

  1. f(x) = 0 at x = 1: f ≤ 0 on [0 ; 1] and f ≥ 0 on [1 ; 2]. Split at 1.
  2. A primitive is F(x) = x³/3 − x.
  3. On [0 ; 1]: F(1) − F(0) = −2/3 − 0 = −2/3, so the area is 2/3.
  4. On [1 ; 2]: F(2) − F(1) = 2/3 − (−2/3) = 4/3. In total 2/3 + 4/3 = 2.

𝒜 = 2 square units (while the integral of f from 0 to 2 is 2/3: you must split).

Understanding the results

Primitive and the constant C

If F is a primitive of f, then F + C is one too, for any real C. Two primitives of the same function on an interval differ by a constant. The calculator shows F(x) + C in Primitive mode.

The bracket [F(x)] and the integral

The bracket [F(x)] with the bounds a and b means F(b) − F(a). The result does not depend on the primitive chosen, since the constant cancels in the difference. An integral exists if f is continuous on [a ; b].

Area and square units

If f is positive, the area under the curve is the integral. If f changes sign, split and take the absolute value of each piece. The square unit (u.a.) is the area of the rectangle formed by the units of the two axes.

Mean value

The mean value of f on [a ; b] is μ = (1/(b − a)) ∫ f. For x² on [0 ; 3] the integral is 9 and μ = 9/3 = 3. It is the height of the rectangle with the same area.

Tips and limitations

  • Write powers with ^ or ², for example (2x+1)^5, and use brackets for fractions: 2x/(x²+1).
  • For a variation table, the function study calculator completes this page.
  • Check the statement: the integral from −1 to 1 of 1/x does not exist, because 1/x is not defined at 0.
  • A value marked “estimate” is not a proof: in an exam you must find the primitive.

Mistakes to avoid

  • Forgetting the minus sign in the primitive of sin x, which is −cos x.
  • Writing ln(x) instead of ln|x| when x can be negative.
  • Computing F(a) − F(b) instead of F(b) − F(a).
  • Not splitting the area where f changes sign, so the pieces cancel.

Frequently asked questions

How do I calculate an integral?

Find a primitive F of f, then the integral of f(x) from a to b is F(b) − F(a). For f(x) = x² from 0 to 1: F(x) = x³/3, so the integral is 1/3 − 0 = 1/3.

When do I use integration by parts?

For a product such as x·eˣ, or for ln x. Let u = x and v′ = eˣ, then ∫ u v′ = [uv] − ∫ u′v. Here the integral of x·eˣ from 0 to 1 is [x·eˣ − eˣ] = 1.

How do I get an area in square units?

The area between the curve and the x axis is ∫ |f(x)| dx, split where f changes sign. For x² − 1 on [0 ; 2], cut at 1 and the area is 2 square units.

How do I recognise u′/u?

The numerator is the derivative of the denominator, up to a constant factor. For 2x/(x² + 1), u = x² + 1 and u′ = 2x, so a primitive is ln(x² + 1). The integral from 0 to 1 is ln 2.

Why do some integrals only get an estimate?

Functions such as e^(x²) have no primitive with the formulas of the course. The calculator then gives Simpson's value, about 1.4627 from 0 to 1, marked as an estimate.

Can I integrate (2x + 1)⁵?

Yes: it is the form u′uⁿ up to the factor 1/2. A primitive is (2x + 1)⁶/12, and the integral from 0 to 1 is 182/3.