Derivative & Integral Explorer

Derivatives, definite integrals, tangent lines and limits — computed numerically for any function you can type, and drawn so you can see what the number means.

Instant answers Works offline once loaded Nothing you type is sent anywhere Derivative and integral Area shaded on the graph Two-sided limits
f(x) =

Use ^ for powers, pi and e for the constants, and the usual functions: sin cos tan ln log sqrt abs exp. Trigonometry is in radians on this page, as calculus requires.

Expressions are allowed, so pi/4 works.

f′(x) at that point

f(x) at that point
Tangent line
Normal line
Second derivative f″(x)
f(x) f′(x) tangent area under f
Drag to pan, scroll to zoom.
Instructions

How to use this calculator

Step by step

  1. Type your function in the f(x) = box at the top. It is used by all three tools below, and the graph updates as you type.
  2. On the Derivative tab, give an x value. You get f′(x) there, the equation of the tangent and normal lines, and the second derivative — with the tangent drawn on the graph.
  3. On the Integral tab, set the limits a and b and pick a method. The shaded region on the graph is exactly the quantity being reported.
  4. Drag the subdivisions slider down to 8 or 10 and switch between the methods to watch the rough rules disagree — then push it back up and watch them converge.
  5. On the Limit tab, give the value x is approaching. The table shows f closing in from each side so you can see the limit forming rather than just being told it.
  6. Drag the graph to pan and scroll to zoom. Reset view returns to the starting window.

Good to know

  • Trigonometry on this page is in radians, because the derivative of sin x is cos x only in radians. Type pi/4 rather than 45.
  • Simpson's rule is exact for any polynomial up to degree three, which is why it beats the other methods so comfortably on smooth functions.
  • If your function has a vertical asymptote between a and b, the integral reported is not trustworthy — split it at the asymptote and treat each piece separately.
  • A zero derivative marks a flat point. The second derivative tells you which kind: positive for a minimum, negative for a maximum, zero and the test is inconclusive.
  • The average value of f on [a, b] is the height of the rectangle with the same area — a genuinely useful reading of a definite integral.
  • Try sin(x)/x as x → 0. The function is undefined at zero but the limit is 1, which is the cleanest example of a removable discontinuity you will find.

The maths behind it

  • Derivative (central difference) f′(x) ≈ [f(x + h) − f(x − h)] ÷ 2h More accurate than the one-sided version for the same h.
  • Second derivative f″(x) ≈ [f(x + h) − 2f(x) + f(x − h)] ÷ h² Positive means concave up, negative means concave down.
  • Tangent line y = f(a) + f′(a)(x − a) The straight line matching the curve in both position and slope at a.
  • Normal line y = f(a) − (x − a) ÷ f′(a) Perpendicular to the tangent at the same point.
  • Simpson's rule ∫ ≈ (h/3)[f₀ + 4f₁ + 2f₂ + 4f₃ + … + fₙ] Needs an even number of subdivisions; fits a parabola to each pair.
  • Trapezoidal rule ∫ ≈ h[f₀/2 + f₁ + f₂ + … + fₙ/2] Joins consecutive points with straight lines.
  • Average value f̄ = (1 ÷ (b − a)) ∫ₐᵇ f(x) dx The mean height of the function across the interval.
Does this do symbolic calculus — can it tell me the derivative as a formula?

No. Every result here is a number computed from samples of your function, not an algebraic manipulation. That is a deliberate trade: it means anything you can type can be differentiated and integrated, including functions with no closed-form antiderivative, and the answers are accurate to several decimal places. If you need the symbolic rule, this page will confirm your answer numerically — plot your candidate f′ and compare it against the blue curve.

How accurate are the numbers?

The derivative is typically good to around eight significant figures on well-behaved functions, less near kinks or asymptotes. The integral quotes a high-accuracy reference alongside your chosen method precisely so you can see the size of the error for yourself. Where the two agree to ten figures, the answer is solid.

Why does the derivative curve go wild in places?

Because a central difference near a vertical asymptote or a sharp corner subtracts two large, nearly equal numbers, and the result is dominated by rounding. It is a real limitation of numerical differentiation, not a display bug. The value is genuinely undefined at those points.

Can I integrate to infinity?

Not directly — the limits must be finite numbers. For a convergent improper integral, put in a large bound and increase it: if the answer settles down, that is the value it converges to. If it keeps growing, the integral diverges.

Why does my limit say "does not exist" when I expect infinity?

Because a limit of infinity is a statement that the function grows without bound, not a value it reaches. The table underneath shows exactly that behaviour — the samples racing off in one direction. Read the one-sided rows to see which way each side goes.