Derivatives and integrals you can see and drag
Calculus asks two questions about a curve: how steep is it at a point, and how much area lies under it? Type a function and both answers appear as pictures. Drag x₀ along the curve and the tangent tilts with the slope f′(x₀), while the derivative is drawn underneath on the same x-axis. Let h shrink and the secant turns into the tangent: the limit definition of the derivative, animated. Fill [a, b] with rectangles, trapezoids or Simpson's parabolas and watch the sum close in on the integral as n doubles, then let the area function F(x) build up and see that its slope is f(x). Type a function of x under the picture (x^2, sin(x), e^x, |x|, sqrt(x), 1/x) or pick an example. Drag the orange point to move x₀: the tangent shows the slope f′(x₀), and the panel underneath draws f′(x) on the same x-axis. With Secant on, the pink line through x₀ and x₀ + h has the slope (f(x₀ + h) − f(x₀)) / h; press Play and h shrinks until the secant becomes the tangent. At a corner such as |x| at 0 the slopes from the left and the right disagree, so there is no derivative. Choose a Riemann sum to fill [a, b] with n strips (blue above the axis, orange below, which counts as negative), drag a and b on the axis and compare the sum with the integral; the error chart shows how fast each rule converges. F(x) draws the area from a to x, a curve whose slope is f(x). Play does what Animate says. Drag the background to pan, zoom with the wheel or a pinch, and double-click to fit the height. With Sound on, the pitch follows the slope. The pencil opens the picture in the photo editor with its parts as layers.
How it works
- Type f(x), such as x^3 - 3x, sin(x), e^x, |x| or sqrt(x), or pick an example; the derivative is found symbolically and written under the graph.
- Drag the point on the curve to move x₀ and read f(x₀) and the slope f′(x₀) in the tiles; switch on the secant and press Play to let h shrink to 0.
- Choose a Riemann sum, drag a and b on the axis and set n, then press Play to double n and watch the sum and its error close in on the integral.
- Switch on F(x) to see the area from a grow into a curve whose slope is f(x), then save the picture, record a video or edit it in the photo editor.
The derivative as the limit of secants
The secant through the points at x₀ and x₀ + h has the slope (f(x₀ + h) − f(x₀)) / h, the average rate of change over that step. As h shrinks the second point slides towards the first and the secant turns towards the tangent. The derivative f′(x₀) is the limit of that slope as h → 0, if it exists. For f(x) = x² at x₀ = 1 the quotient is 2 + h exactly, so it tends to 2: h = 0.1 gives 2.1, h = 0.001 gives 2.001.
Where the derivative does not exist
A derivative needs the slopes from the left and from the right to agree. The absolute value |x| has slope −1 to the left of 0 and +1 to the right, so at the corner x = 0 there is no tangent. √x and ∛x have a vertical tangent at 0, where the slope grows without bound, and a function that jumps has no derivative at the jump. The app checks both one-sided slopes at x₀ and says which case it is, drawing the two one-sided tangents at a corner.
Riemann sums and how fast they converge
Cut [a, b] into n strips of width h = (b − a)/n and add up the areas of rectangles (left, right or midpoint), trapezoids or, for Simpson's rule, parabolas through three points. Area below the axis counts as negative. As n grows every rule approaches the definite integral, but at different speeds: for a smooth function the error of a left or right sum falls like 1/n, the midpoint and trapezoid rules like 1/n² and Simpson's rule like 1/n⁴. Doubling n halves, quarters or divides the error by sixteen, which the log-log error chart shows as straight lines of slope −1, −2 and −4.
The Fundamental Theorem of Calculus
The area function F(x) = ∫ₐˣ f(t) dt grows at the rate f(x): moving x a little to the right adds a thin strip of height f(x). So F′(x) = f(x), and F is an antiderivative of f. That is the Fundamental Theorem, and it turns areas into differences: ∫ₐᵇ f(x) dx = F(b) − F(a) for any antiderivative F. Under 1/x from 1, the area is ln x, which reaches 1 at x = e; under sin x from 0, the area is 1 − cos x, which returns to 0 after a full period because the negative half cancels the positive one.
Frequently asked questions
What is a derivative?
The derivative f′(x₀) is the slope of the curve at x₀: the limit of the secant slope (f(x₀ + h) − f(x₀)) / h as h → 0. It measures the instantaneous rate of change, such as speed when f is a position. Where f′ is positive the curve rises, where it is negative the curve falls, and where it is zero the tangent is horizontal.
How does the app find f′(x)?
It reads your formula with the site's safe parser and differentiates the formula itself with the sum, product, quotient, power and chain rules, then simplifies the result a little, so x³ − 3x gives 3x² − 3 and sin(2x) gives 2·cos(2x). Only for a formula the rules cannot take, such as a factorial, does it use central differences with Richardson extrapolation, accurate to about 10 digits, and the panel then says so.
How are maxima, minima and inflection points found?
The app scans f′ across the view for sign changes and pins each one down by bisection: from positive to negative is a local maximum, from negative to positive a local minimum. A corner like the bottom of |x| counts too, because f′ changes sign there without being zero. Inflection points are where f″ changes sign, so the curve switches between concave up and concave down; the strip along the bottom of the graph shows the concavity when f″ is on.
Which Riemann sum is the most accurate?
For a smooth function, Simpson's rule by far: its error falls like 1/n⁴, against 1/n² for the midpoint and trapezoid rules and 1/n for left and right sums. The midpoint rule is usually about twice as accurate as the trapezoid rule, with the opposite sign. The error chart shows all of them; a function with a kink or an infinite slope, such as √x at 0, slows every rule down.
How is the exact integral computed?
With adaptive Gauss–Kronrod quadrature: each piece of [a, b] is integrated with 7 Gauss points and 15 Kronrod points, the difference estimates the error, and the piece with the largest error is halved until the total is below about one part in 10¹². If f is undefined somewhere on [a, b], or the area grows without bound, as for 1/x across 0, the app says so instead of giving a number.
Can I use the picture?
Yes. Save gives a PNG at the size you choose, Record films the tangent, the shrinking secant, the doubling sums or the growing area with its sound, and the pencil opens the picture in the PictorX photo editor with the background grid, the area, the function, the derivative, the accumulation, the tangent and secant, the error chart, the points and the labels on layers of their own and the caption as editable text. In the editor itself it is under Apps ▸ Science ▸ Mathematics ▸ Derivative & Integral Visualiser. Everything runs in your browser.
Derivative & Integral Visualiser: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device. Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner. The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF. For the sound, choose the app's own sounds or one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Go to Editor