liveBook · Manning

Analytical differentiation

As explained in Deep Learning with JAX

A differentiation method that derives an exact algebraic expression for a derivative before evaluating it.

Analytical differentiation derives an exact, closed-form expression for a derivative before evaluating it at a chosen point. You can obtain that expression manually from calculus rules or generate it symbolically with SymPy. section 4.1.1 section 4.1.2

From expression to value

For f(x) = x⁴ + 12x + 1/x, differentiation gives f′(x) = 4x³ + 12 − 1/x². Evaluating the resulting function at x = 11 produces the derivative value 5335.99173553719. section 4.1.1

Listing 4.2 A closed-form expression for a derivative calculated manually
def df(x):
    return 4*x**3 + 12 - 1/x**2              #1
  
x = 11.0
  
print(f(x))
  
>>> 14773.09090909091
  
print(df(x))
  
>>> 5335.99173553719

A short Python listing implements the closed-form derivative directly and evaluates it alongside the original function. section 4.1.1

Analytical differentiation is useful when:

  • You need an exact expression that can be evaluated repeatedly at different points. section 4.1.1
  • You want reliable symbolic calculation instead of manually expanding complicated products and compositions. section 4.1.2
  • You are studying derivative fundamentals before using JAX autodiff for algorithms with loops, branching, or recursion. section 4.1.1 section 4.4

How Deep Learning with JAX covers it

How deep it goes
Explains manual rules and symbolic generation with examples, but stops short of handling algorithmic control flow and expression swell.
Examples
Uses x⁴ + 12x + 1/x, a manually coded derivative, and a SymPy derivative evaluated at x = 11.
What it assumes
Assumes basic calculus rules while reinforcing derivatives of sums, powers, and reciprocal functions from first principles.
What you can do after
Evaluate exact derivative functions and recognize when symbolic or manual differentiation becomes impractical.
How it connects
Connects closed-form expressions, symbolic differentiation, numerical differentiation, autodiff, and JAX gradient transformations.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with JAX. The section links point to the parts of the book it draws on.