liveBook · Manning

Second derivative

As explained in Geometry for Programmers

A second derivative is the derivative of a first derivative and measures the rate of change of a function's slope or tangent direction.

A second derivative is the derivative of a first derivative: it measures how a function’s rate of change is itself changing. It turns an intuitive question—whether a graph is bending more, less, or differently—into a quantity that can guide geometric code. Differentiation can continue recursively whenever the preceding derivative exists. section 5.0 section 5.6

For a parametric curve, first derivatives describe tangent direction, while second derivatives are closely tied to how that direction changes. That makes them useful for assessing curvature: a point and tangent alone cannot distinguish a line from circles with different radii. Continuous curvature requires continuous second derivatives, commonly described as C2 smoothness. section 5.2.3 section 5.6

>>> diff(a*x**2 + b*x + c, x, x)   #1
2*a

SymPy can differentiate a polynomial twice by naming the same variable twice. For a quadratic ax² + bx + c, the result is 2a: the second derivative is constant, so its curvature-related behavior cannot vary with x. section 5.1.4

Second derivatives support practical curve design in several ways:

  • Check whether joined curve pieces can have continuous curvature, rather than merely sharing a point or tangent. section 5.2.3 section 5.6
  • Add a curvature-related constraint to a polynomial by differentiating it twice and setting its value at a chosen point. section 7.1.1
  • Choose constraints carefully: each prescribed derivative consumes polynomial coefficients and adds work to the equation system. section 7.1.1

Why a round road corner is not automatically smooth

A circular arc can meet a straight segment with matching position and tangent, yet their curvatures cannot match: a line has zero curvature and a circle has constant nonzero curvature. For a twisty road, avoiding that curvature discontinuity matters when the goal is a smooth change in turning behavior. section 5.2.3

Second-derivative constraints also generalize. A statement such as P⁽ᵐ⁾(xᵢ) = dᵢ becomes a linear equation for polynomial coefficients, provided the polynomial has enough degree to supply the needed coefficients. This is the basis for spending polynomial flexibility on specified shape behavior at selected points. section 7.1.1

How Geometry for Programmers covers it

How deep it goes
Explains repeated symbolic differentiation, curvature continuity, and polynomial constraints without deriving the curvature formula.
Examples
Uses SymPy differentiation of a quadratic, road corners, lines and circles, and constrained polynomial graphs.
What it assumes
Builds from intuitive growth, bending, and smoothness while using symbolic functions and derivatives.
What you can do after
Apply it via SymPy and polynomial equations to inspect curvature-related behavior and impose derivative constraints.
How it connects
Relates derivatives to tangent vectors, curvature, C2 smoothness, parametric curves, splines, and polynomial constraints.

Also explained in

Compare how 3 books explain second derivative →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.