Differentiation
Differentiation measures the instantaneous rate of change of a function. It is the central tool for optimization, physics, and machine learning.
Key Points
- The derivative is defined as the limit of a difference quotient.
- Differentiability implies continuity, but not vice versa.
- The chain rule enables derivatives of composite functions.
Formulas
Derivative definition
$$f'(x) = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h}$$
Chain rule
$$\frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x)$$
Product rule
$$\frac{d}{dx} [u(x)v(x)] = u'(x)v(x) + u(x)v'(x)$$
Code Example
import jax.numpy as jnp
from jax import grad
def f(x):
return jnp.sin(x) ** 2
df = grad(f)
print(df(1.0)) # derivative at x=1