The Gradient and Local Prediction
Which unit input direction increases Q fastest near (1, 1)? This chapter represents the scalar derivative by a gradient and checks the prediction against the exact output.
- Gradient: The vector of partial derivatives that represents the linear part of local change for a differentiable scalar function.
Package the partial derivatives
With standard Euclidean coordinates, the gradient of a differentiable scalar function is the column vector of partial derivatives. It represents the derivative by a dot product:
For , . With , the linear change is , giving prediction . The exact output is , so the error is .
Choose the fastest unit direction
Cauchy–Schwarz gives for . For a nonzero gradient, equality occurs at . Here the maximum rate is , attained along . The negative direction gives the fastest decrease. If the gradient is zero, every first-order directional derivative is zero and higher-order terms decide the behavior.
Relate the gradient to level sets
If a differentiable curve stays in a level set, differentiating gives . At a regular point where the gradient is nonzero, the gradient is normal to the level set. For at , a tangent direction is .
The derivative is a linear functional independently of coordinates. Its gradient representation uses an inner product. Changing units or weights changes what a unit direction means; in a weighted metric with matrix , the gradient vector is times the Euclidean gradient. Do not compare raw rates from incompatible input units without a stated scaling.
Basic practice
Prepare
Reuse Q, a, h and the directional results. Use the Euclidean inner product and dimensionless coordinates.
Record assumed inputs, predictions, and exact calculations separately. If you use software, label rounded outputs; no physical measurement is implied.
Predict
Will the tangent-plane prediction be exact for a quadratic?
Execute
- Compute the gradient and its unit direction at a.
- Calculate the predicted and exact output at a + h.
- Check that (1, -1) is perpendicular to the gradient and find its first-order response.
Observe and record
| Case or quantity | Prediction | Exact result or argument | Error or software check |
|---|---|---|---|
| Gradient and fastest direction | |||
| Prediction versus exact output | |||
| Level tangent direction |
Check after working: The gradient is (3, 3), maximum unit rate is 3√2, prediction is 3.15, and exact output is 3.1575. The tangent direction has zero dot product but can still have a quadratic change.
Optional extension
Recompute the steepest direction when input lengths use diag(1, 4) as a metric. Explain which notion of a unit vector changed.
Keep and continue
Keep the gradient prediction and residual. Next, represent derivatives of vector-valued functions by matrices.
Previous: Partial and Directional Derivatives