0.2 Calculus and Linear Algebra
Calculus describes rates, sensitivities, and accumulated quantities. Linear algebra provides the language for systems with many states, inputs, outputs, and design variables. Together, they support nearly every CCD formulation and numerical method in this course.
Derivatives and partial derivatives¶
Single-variable derivatives¶
The derivative of a scalar function is written
It measures the rate at which changes when changes. In optimization, a derivative indicates how an objective or constraint responds to a small adjustment in a decision variable.
If
then
The second derivative,
measures how the slope changes and provides information about curvature.
Partial derivatives¶
When a function depends on several variables, a partial derivative describes its sensitivity to one variable while the others are held fixed:
For
the partial derivatives are
Gradient¶
The gradient collects the first partial derivatives of a scalar function into a vector:
For the function ,

Derivatives and gradients provide the change information used by many optimization algorithms.
Chain rule¶
If one variable depends on another,
the chain rule propagates derivatives through the nested relationship:
This idea is fundamental to sensitivity analysis and automatic differentiation.
Jacobian and Hessian¶
For a vector-valued function
the Jacobian is the matrix of first derivatives:
The Hessian of a scalar function is the matrix of its second partial derivatives. Jacobians describe the local sensitivity of vector equations; Hessians describe the local curvature of scalar objectives or constraints.
Example: gradient of a design objective¶
Let
Then
so
This calculation is the basic language of gradient-based optimization.
Integration and numerical integration¶
Definite integrals as accumulated quantities¶
A definite integral accumulates a quantity over an interval:
In engineering, integrals can represent accumulated energy, work, fuel, tracking error, or control effort. For example,
is a common measure of control effort.

A definite integral measures accumulated area; numerical methods approximate it using sampled values.
Numerical integration¶
When time is discretized at , a left-rectangle approximation is
where and .
The trapezoidal rule uses both endpoints of each interval:
For the control-effort objective,
the trapezoidal approximation is
This form appears later in direct-transcription methods.
Linear algebra¶
Vectors, matrices, and dimensions¶
A vector is an ordered list of numbers; a matrix is a rectangular array:
If , then has rows and columns. The product is defined only when the number of columns in equals the number of components in .
Important operations include vector and matrix addition, scalar multiplication, matrix multiplication, transpose , and—when it exists—the inverse .
Identity matrices and linear systems¶
The identity matrix satisfies
A linear system has the form
If is square and nonsingular, the mathematical solution can be written . In computation, however, one normally uses a linear-system solver rather than forming the inverse explicitly.
Norms¶
A norm measures vector size. The Euclidean norm is
Norms appear in convergence tests, regularization terms, error measures, and engineering-performance metrics.
Eigenvalues and eigenvectors¶
An eigenvalue–eigenvector pair satisfies
In state-space models, eigenvalues help characterize dynamic behavior and stability.
Positive definiteness¶
A symmetric matrix is positive definite if
Positive-definite matrices occur frequently in quadratic objectives and Lyapunov analysis.
Activity 0.1: Composite Engineering Functions, Gradients, and Hessians¶
Activity 0.1: Composite Engineering Functions, Gradients, and Hessians
For a mass-spring-damper system, define
Consider the dimensionless design objective
where
Derive
Derive
Use the chain rule to derive the complete gradient .
Evaluate and at
Let
Compute the directional derivative
Derive the Hessian matrix .
Evaluate the eigenvalues of the Hessian at the stated design and determine whether is locally convex there.
Verify the analytical gradient using central finite differences with step sizes
Activity 0.2: Numerical Integration and Observed Convergence Order¶
Activity 0.2: Numerical Integration and Observed Convergence Order
Consider
and define
Evaluate analytically.
Approximate using:
the left-rectangle rule;
the midpoint rule;
the composite trapezoidal rule; and
composite Simpson’s rule.
Use
equal subintervals.
For each method, compute the absolute error
Estimate the observed convergence order using
Compare the observed orders with the theoretical orders of the four methods.
Derive the composite trapezoidal approximation in matrix form:
where is the quadrature-weight vector.
Explain why a highly accurate state trajectory does not automatically guarantee a highly accurate integral performance measure if the quadrature rule is inconsistent with the trajectory approximation.
Activity 0.3: Linear Algebra, Modal Coordinates, and Positive Definiteness¶
Activity 0.3: Linear Algebra, Modal Coordinates, and Positive Definiteness
Consider the undamped two-degree-of-freedom mechanical system
where
Verify that and are symmetric positive definite.
Solve the generalized eigenvalue problem
Compute the two natural frequencies.
Normalize the mode shapes so that
Verify that
Introduce modal coordinates and derive the decoupled equations of motion.
For
compute the initial modal coordinates.
Derive the exact displacement response .
Compute the total mechanical energy
and prove that it is constant.
Explain why positive definiteness of and matters physically and mathematically.