Derivatives and integrals explained

Calculus answers two old questions about curves: how steep is a curve at one point, and how much area does it enclose? The first leads to the derivative, the second to the integral, and the Fundamental Theorem of Calculus shows that each undoes the other. This page explains both from the picture up: secants that become tangents, strips that fill an area, and the numerical methods the visualiser uses to compute them.

The graph of x³ − 3x with the area under its hump shaded and the tangent touching the curve at a point
The graph of x³ − 3x with the area under its hump shaded and the tangent touching the curve at a point

From exhaustion to calculus

Archimedes found the area under a parabola in the 3rd century BC by filling it with ever smaller triangles, the method of exhaustion. In the 17th century Fermat found tangents and maxima by letting a small increment vanish, and Isaac Newton and Gottfried Wilhelm Leibniz, independently, turned these tricks into a calculus: Newton's fluxions described rates of change in motion, and Leibniz gave us the notation dy/dx and the integral sign ∫, a stretched S for summa. Their infinitesimals were put on a firm footing only in the 19th century, when Cauchy and Weierstrass defined limits with ε and δ and Riemann defined the integral as a limit of sums.

The derivative: a limit of secant slopes

Between x₀ and x₀ + h the curve rises by f(x₀ + h) − f(x₀), so the secant through those two points has the slope (f(x₀ + h) − f(x₀)) / h, the difference quotient. The derivative is its limit as h → 0: f′(x₀) = lim (f(x₀ + h) − f(x₀)) / h. Geometrically the secant pivots into the tangent line y = f(x₀) + f′(x₀)(x − x₀), the straight line that best fits the curve near x₀. For f(x) = x² the quotient simplifies to 2x₀ + h, so f′(x₀) = 2x₀; for sin x the limit sin(h)/h → 1 gives cos x, but only with the angle in radians.

The rules of differentiation

Nobody computes limits for every function: a few rules cover every formula built from the standard functions. The derivative of a sum is the sum of the derivatives; the power rule gives (xⁿ)′ = n xⁿ⁻¹; the product rule (uv)′ = u′v + uv′; the quotient rule (u/v)′ = (u′v − uv′)/v²; and the chain rule (f(g(x)))′ = f′(g(x)) · g′(x). With the derivatives of sin, cos, eˣ and ln x, these rules differentiate any formula mechanically, which is exactly what the visualiser does with the tree of your formula before simplifying the result.

Corners, cusps and vertical tangents

A function can be continuous and still have no derivative. At a corner the slopes from the left and from the right are different: |x| has slopes −1 and +1 at 0, and |x² − 1| has a corner at x = ±1. At a vertical tangent the difference quotient grows without bound, as for √x or ∛x at 0. At a jump the function itself is not continuous. Weierstrass even built a function that is continuous everywhere and differentiable nowhere. The visualiser tests both one-sided difference quotients at x₀, at two step sizes, to tell these cases apart.

What the derivative tells about the graph

Where f′ > 0 the function rises and where f′ < 0 it falls, so a local maximum or minimum sits where f′ changes sign: a critical point, usually with f′ = 0, sometimes at a corner. The second derivative measures how the slope changes: f″ > 0 means concave up, like a cup, and f″ < 0 concave down. An inflection point is where the concavity switches, as at x = 0 for x³ − 3x, whose derivative 3x² − 3 is zero at x = ±1, a maximum at −1 and a minimum at +1. Drawing f′ under f on the same x-axis makes these links visible: the zeros of f′ line up with the peaks and valleys of f.

Riemann sums and the definite integral

To find the area between a curve and the x-axis from a to b, cut [a, b] into n strips of width h = (b − a)/n and approximate each strip by a rectangle whose height is f at the left end, the right end or the midpoint. The total is a Riemann sum. Area below the axis counts as negative, so the result is a signed area: ∫₀^2π sin x dx = 0 because the two halves cancel. When the sums approach the same limit however the strips are chosen, as n → ∞, that limit is the definite integral ∫ₐᵇ f(x) dx. Continuous functions on a closed interval are always integrable in this sense.

How fast the sums converge

Better shapes converge faster. A left or right sum makes an error of about h · (f(b) − f(a))/2, which falls like 1/n. The trapezoid rule joins neighbouring points with straight lines and the midpoint rule samples the middle; both have errors proportional to h² f″, so doubling n divides the error by four. Simpson's rule fits a parabola through each three points and is exact for cubics; its error falls like h⁴, a factor of sixteen per doubling. On a log-log chart of error against n these are straight lines with slopes −1, −2 and −4, until rounding errors of about 10⁻¹⁵ take over. A kink or an infinite slope in [a, b] breaks the assumptions and slows every rule down.

The Fundamental Theorem and how the app works

Let F(x) = ∫ₐˣ f(t) dt be the area from a to x. Moving x by a little Δx adds a strip of area about f(x) Δx, so F′(x) = f(x): integration and differentiation undo each other. Hence ∫ₐᵇ f dx = G(b) − G(a) for any antiderivative G, which is how integrals are computed by hand. In the app the formula is read by the site's safe parser, differentiated symbolically, and evaluated in double precision. The reference integral uses adaptive Gauss–Kronrod quadrature (7 and 15 points, halving the worst piece until the estimated error is below 10⁻¹²), F(x) is built from 5-point Gauss–Legendre steps across the view, and a step whose halves disagree marks a singularity, where F stops. Extrema and inflection points are found by bisection on sign changes of f′ and f″.

Поширені запитання

Why does the derivative of sin x equal cos x only in radians?

Because the key limit sin(h)/h → 1 holds only when h is measured in radians, where the arc length on the unit circle equals the angle. In degrees the limit is π/180, so the derivative of sin x° is (π/180) cos x°.

Is a function with f′(x₀) = 0 always at a maximum or minimum?

No. f(x) = x³ has f′(0) = 0 but keeps rising through 0: the derivative touches zero without changing sign, and x = 0 is an inflection point. A local extremum needs f′ to change sign, or the second derivative to be non-zero there.

Why is the midpoint rule more accurate than the trapezoid rule?

On a strip where the curve bends, the tangent at the midpoint errs on one side by about h³ f″/24, while the chord of the trapezoid errs on the other side by about h³ f″/12, twice as much. That is also why Simpson's rule, a weighted average of two thirds midpoint and one third trapezoid, cancels the h² term.

What happens when the area is infinite?

Some integrals diverge: ∫₀¹ 1/x dx is infinite because ln x falls without bound near 0, while ∫₀¹ 1/√x dx = 2 is finite even though the curve is unbounded. The app's adaptive quadrature notices when the error estimate will not settle and reports that the integral diverges or that f is undefined on [a, b].

Готові спробувати?

Відкрийте PictorX у браузері — без встановлення і без кредитної картки.

Open the derivative and integral visualiser