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
