Proofwell
Menu

Derivative and Integral Calculator

Differentiate or integrate a function and see the rule used at each step, including the product rule, the chain rule, substitution, integration by parts and partial fractions. Every antiderivative is checked by differentiating it back, and every definite integral is cross-checked numerically.

Mathematics · CalculusUpdated Sources cited

What do you want to find?
Use ^ for powers and brackets for function arguments: x^2 sin(x), e^(3x), sqrt(1 - x^2). ln is the natural log; log is base 10.
Examples:

Result

First derivative

ddx[x2sin⁡(x)]=x2cos⁡(x)+2xsin⁡(x)\frac{d}{dx}\left[x^{2}\sin\left(x\right)\right] = x^{2}\cos\left(x\right) + 2x\sin\left(x\right)
Assumptions behind this result
  • ln is the natural logarithm and log is base 10. Angles in trigonometric functions are in radians.

Step-by-step solution

Every step is the rule actually applied
  1. Step 1: Use the product rule

    For a product u·w, the derivative is u′w + uw′.

    ddx[x2sin⁡(x)]=ddx[x2]⋅sin⁡(x)+x2⋅ddx[sin⁡(x)]\frac{d}{dx}\left[x^{2}\sin\left(x\right)\right] = \frac{d}{dx}\left[x^{2}\right] \cdot \sin\left(x\right) + x^{2} \cdot \frac{d}{dx}\left[\sin\left(x\right)\right]
  2. Step 2: Use the power rule

    The derivative of xⁿ is nxⁿ⁻¹, here with n = 2.

    ddx[x2]=2x\frac{d}{dx}\left[x^{2}\right] = 2x
  3. Step 3: Differentiate sin

    The derivative of sin is cos.

    ddx[sin⁡(x)]=cos⁡(x)\frac{d}{dx}\left[\sin\left(x\right)\right] = \cos\left(x\right)
  4. Step 4: Simplify

    Collect like terms and tidy the result.

    ddx=x2cos⁡(x)+2xsin⁡(x)\frac{d}{d x} = x^{2}\cos\left(x\right) + 2x\sin\left(x\right)

What the calculator does

Choose one of three modes:

  • Derivative. First to fifth derivatives, including partial derivatives when the expression has several variables.
  • Indefinite integral. An antiderivative plus the constant C, with the method shown.
  • Definite integral. The exact value from the Fundamental Theorem of Calculus where possible, otherwise an accurate numerical value, labelled as such.

How to enter functions

Write Meaning
x^3, x^(1/2) powers
2x, 3(x + 1), x sin(x) multiplication (the * sign is optional)
sqrt(x), abs(x) square root, absolute value
sin(x), cos(x), tan(x), sec(x), asin(x), atan(x) trigonometric functions, in radians
e^x, exp(x), ln(x), log(x) exponential, natural log, log base 10
pi, e the constants π and e
sin^2(x) (sin x)²

Differentiation rules

ddxxn=nxn−1ddx[fg]=f′g+fg′ddxex=exddx[fg]=f′g−fg′g2ddxln⁡x=1xddxf(g(x))=f′(g(x)) g′(x)ddxsin⁡x=cos⁡xddxcos⁡x=−sin⁡x\begin{aligned} \frac{d}{dx}x^n &= nx^{n-1} & \frac{d}{dx}\left[f g\right] &= f'g + fg' \\ \frac{d}{dx}e^x &= e^x & \frac{d}{dx}\left[\frac{f}{g}\right] &= \frac{f'g - fg'}{g^2} \\ \frac{d}{dx}\ln x &= \frac{1}{x} & \frac{d}{dx}f(g(x)) &= f'(g(x))\,g'(x) \\ \frac{d}{dx}\sin x &= \cos x & \frac{d}{dx}\cos x &= -\sin x \end{aligned}

The calculator applies these from the outside in. It names the rule for the outermost operation, differentiates each part, then simplifies.

Integration methods

  1. Standard integrals, such as ∫xⁿ dx = xⁿ⁺¹/(n + 1), ∫1/x dx = ln|x| and ∫eˣ dx = eˣ. These also apply to a linear inside function: ∫cos(3x) dx = sin(3x)/3.
  2. Substitution. If the integrand has the form g(u(x))·u′(x), set u = u(x) and integrate g(u) du.
  3. Integration by parts, ∫u dv = uv − ∫v du, for products like x·eˣ, x²·sin x, ln x and arctan x.
  4. Partial fractions for rational functions. Factor the denominator, split the fraction into simpler ones, and integrate each.
  5. Trigonometric identities, such as sin²x = (1 − cos 2x)/2, and rewriting odd powers of sin and cos.

The Fundamental Theorem of Calculus

If F′ = f and f is continuous on [a, b], then

∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a)

The calculator first checks that the integrand has no singularity in the interval. If it does, the integral is improper and the theorem does not apply directly. Integrals like ∫ from −1 to 1 of 1/x dx are reported as improper rather than given a misleading value.

Worked examples

Derivative. For x² sin x, the product rule gives (x²)′ sin x + x² (sin x)′. The power rule and the derivative of sin then give

ddx[x2sin⁡x]=x2cos⁡(x)+2xsin⁡(x)\frac{d}{dx}\left[x^2\sin x\right] = x^{2}\cos\left(x\right) + 2x\sin\left(x\right)

Indefinite integral. For ∫x eˣ dx, choose u = x and dv = eˣ dx, so du = dx and v = eˣ. Then ∫x eˣ dx = x eˣ − ∫eˣ dx, which gives

∫xex dx=x ex−ex+C\int x e^x\,dx = x\,e^{x} - e^{x} + C

Definite integral. Since (arctan x)′ = 1/(1 + x²),

∫0111+x2 dx=arctan⁡1−arctan⁡0=π4\int_0^1 \frac{1}{1 + x^2}\,dx = \arctan 1 - \arctan 0 = \frac{\pi}{4}

Common mistakes

  • Forgetting the chain rule. The derivative of sin(3x) is 3cos(3x), not cos(3x).
  • Dropping the absolute value. ∫1/x dx = ln|x| + C, which is valid for negative x as well.
  • Forgetting + C on an indefinite integral.
  • Using degrees. Calculus formulas for trigonometric functions assume radians.
  • Applying F(b) − F(a) across a singularity. ∫ from −1 to 1 of 1/x² dx is not −2: the integrand is unbounded at 0.

Practical applications

  • Physics. Velocity is the derivative of position, and displacement is the integral of velocity.
  • Optimisation. Maximum and minimum values occur where the derivative is zero.
  • Economics. Marginal cost and revenue are derivatives; totals are integrals.
  • Probability. Probabilities for continuous distributions are areas under density curves.
  • Engineering. Work, centres of mass and fluid pressure are computed with definite integrals.

Assumptions and limitations

Trigonometric functions use radians. Integrals are found with the methods listed above. Some integrals that need other techniques are not found, and those with no elementary antiderivative cannot be found by any method. In both cases the calculator says so, and a definite integral can still be computed numerically. Improper integrals, including those with infinite limits, are not evaluated.

Frequently asked questions

How does the calculator know its integral is right?

Every antiderivative is differentiated again and compared with the original function at several points. If they do not match, the result is not shown. Definite integrals are also computed numerically and compared with the exact value.

Why does ∫ 1/x dx give ln|x| and not ln x?

The absolute value makes the answer correct for negative x as well as positive x. The derivative of ln|x| is 1/x for every x ≠ 0, while ln x is only defined for x > 0.

Why can't it integrate e^(x²)?

Some functions have no antiderivative that can be written with elementary functions such as polynomials, exponentials, logarithms and trigonometric functions. e^(x²), sin(x)/x and 1/ln(x) are well-known examples. Their definite integrals can still be computed numerically, which the calculator does.

What does "+ C" mean?

An indefinite integral is a family of functions that differ by a constant, because the derivative of any constant is zero. C stands for that arbitrary constant.

How do I enter a partial derivative?

Type an expression with several letters, such as x^2 y + sin(y), and choose the variable to differentiate with respect to. The other letters are treated as constants.

References

  1. Stewart, J., Clegg, D. & Watson, S. (2020). Calculus (9th ed.). Cengage.
  2. Spivak, M. (2008). Calculus (4th ed.). Publish or Perish.
  3. Piessens, R., de Doncker-Kapenga, E., Überhuber, C. W. & Kahaner, D. K. (1983). QUADPACK: A Subroutine Package for Automatic Integration. Springer. Source of the Gauss–Kronrod rule used for numerical checks.
  4. Weisstein, E. W. Elementary Function. MathWorld, Wolfram Research. On integrals with no elementary antiderivative.