Calculus Calculator: Derivative, Integral and Root of a Function

Type a function of x. Get its value, its slope, the area under it or a root, worked out numerically.

Calculated from standard textbook formulas, with every step shown. The formulas are fixed, so the working does not need checking: what matters is the numbers you type in. Use these calculators only if you are competent to choose the inputs (loads, material strength, dimensions, supports) and check your units and assumptions. For learning and checking your own working: design and sign-off are for a qualified engineer. Drafting Central does not store the numbers you type.

How this calculator works

Type a function such as x^3 - 2*x + sin(x). The calculator reads it with its own safe parser, so you can use x, the operators + - * / ^, brackets, the constants pi and e, and the functions sin, cos, tan, sqrt, exp, ln, log and abs. Angles are in radians.

The derivative is found by central differences with Richardson extrapolation, which is accurate to about eight figures for a smooth function. The definite integral uses adaptive Simpson's rule, which refines the intervals where the function changes quickly. A root is found with Newton's method from your starting guess. These are numerical answers: they give numbers, not a formula for the derivative or the antiderivative.

Formulas used

  • f'(x) \approx \frac{f(x+h) - f(x-h)}{2h}
  • \int_a^b f(x)\,dx \approx \text{adaptive Simpson}
  • x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}

Worked example

With the default numbers in the calculator above:

  1. Value of the function at x: 1.372495
  2. Slope by central differences (step h): 4.8207394
  3. Improved with Richardson extrapolation: 4.8207372

Change the numbers in the calculator to see the full working, every step, for your own case.

Common questions

Does it give the formula for the derivative?

No. It gives the value of the slope at a point. For the formula, ask the engineering question tool, which explains the steps of the differentiation.

Why did it not find a root?

Newton's method can fail near a flat spot or if the start is far from a root. Try a starting value closer to where the curve crosses zero.

Can I use degrees?

The functions use radians. Multiply an angle in degrees by pi/180.

Related calculators

Further reading: Stewart, Calculus; Kreyszig, Advanced Engineering Mathematics.

Need a calculator we do not have?

Tell us what you would like to calculate. We read every request and build the most asked-for ones.

We store your request (and your email if you give it) to decide what to build. We do not store the numbers you type into calculators.

Embed this calculator on your own page

Copy this code into your page. The calculator runs inside the frame and links back to Drafting Central.

Need this drawn, designed or checked?

Drafting Central is a mechanical engineering and drafting business in Burleigh Waters on the Gold Coast. A calculator gives you the numbers; we can turn them into drawings and designs.

Need help with a real project?

Talk to Drafting Central →

← All engineering calculators