Engineering Mathematics II

Chapter 2
Multivariable Differential Calculus

Bachelor Program in Mechatronics Engineering
Engineering Mathematics II   •   Bachelor

Multivariable Differential Calculus

Introduction

Engineering systems rarely depend on a single variable. The temperature of a motor may depend on position and time; the displacement of a robot joint may depend on several angles; and the performance of a control system may depend on gains, load, and operating conditions. Multivariable differential calculus provides the mathematical tools for describing how such quantities change.

A scalar-valued function of two variables assigns a number to each point in a region of the plane:

z = f(x,y)

Here, x and y are independent variables and z is the dependent variable. In three dimensions, a function may be written as w=f(x,y,z). A vector-valued function maps several inputs to several outputs and is commonly represented by

𝐅(x,y,z) = [F₁(x,y,z), F₂(x,y,z), F₃(x,y,z)]ᵀ

This chapter develops limits, continuity, partial and directional derivatives, gradients, Jacobians, Hessians, total differentials, Taylor approximations, and constrained optimization. These ideas are central to robot kinematics, sensitivity analysis, system identification, numerical optimization, and mechatronic design.

Learning Objectives

By the end of this chapter, a student should be able to:

  1. Explain the limit and continuity of a multivariable function.
  2. Compute and interpret partial, directional, and total derivatives.
  3. Use gradients to determine directions of greatest increase and decrease.
  4. Construct and interpret Jacobian and Hessian matrices.
  5. Apply linearization and multivariable Taylor expansions.
  6. Classify stationary points using the Hessian.
  7. Solve equality-constrained extrema using Lagrange multipliers.
  8. Apply these tools to engineering sensitivity and design problems.

1. Multivariable Functions and Domains

The domain of f(x,y) is the set of all ordered pairs (x,y) for which the formula is defined. For example, the function

f(x,y) = √(9 − x² − y²)

has domain x²+y²≤9, because the expression under the square root must be nonnegative. Its graph is the upper hemisphere of radius 3.

A level curve of f is obtained by setting

f(x,y) = c

where c is a constant. Level curves are useful because they show points having equal output. In a temperature map, they are isotherms; in a potential field, they are equipotential curves.

For a vector-valued mapping from ℝⁿ to ℝᵐ,

𝐅: ℝⁿ → ℝᵐ

the input is an n-component vector and the output is an m-component vector. Such mappings describe coordinate transformations, sensor models, and robot forward kinematics.

2. Limits and Continuity

The limit of f(x,y) as (x,y) approaches (a,b) is L if the function values approach L along every possible path of approach:

lim(x,y)→(a,b) f(x,y) = L

The requirement that every path produce the same value is essential. Checking only the coordinate axes or a few convenient paths cannot prove that a two-variable limit exists. However, finding two paths with different limiting values proves that the limit does not exist.

A function is continuous at (a,b) when:

lim(x,y)→(a,b) f(x,y) = f(a,b)

Continuity requires that the function be defined at the point, that the limit exist, and that the two values agree. Polynomials, exponential functions, and trigonometric functions are continuous everywhere in their domains. Quotients are continuous where their denominators are nonzero.

Example 1: A path test

Consider

f(x,y) = (x² − y²)/(x² + y²)

near (0,0). Along y=0,

f(x,0) = 1

whereas along x=0,

f(0,y) = −1

Since the values differ, the limit at the origin does not exist. Consequently, assigning any value to f(0,0) cannot make the function continuous there.

For more rigorous estimates, polar coordinates are useful:

x = r cos θ, y = r sin θ

As (x,y)→(0,0), r→0. If an expression can be bounded by a quantity tending to zero independently of θ, the limit is zero.

3. Partial Derivatives

The partial derivative with respect to x holds y constant:

fx(x,y) = ∂f/∂x = limh→0 [f(x+h,y)−f(x,y)]/h

Similarly,

fy(x,y) = ∂f/∂y = limh→0 [f(x,y+h)−f(x,y)]/h

These derivatives measure local sensitivity to one variable while all other independent variables are fixed. Their units are the units of the output divided by the units of the corresponding input.

Example 2: Partial derivatives of a motor-temperature model

Suppose the steady temperature rise of a motor is approximated by

T(I,ω) = 20 + 0.8I² + 0.002ω²

where T is in °C, current I is in A, and angular speed ω is in rad/s. Then

TI = 1.6I, T_ω = 0.004ω

At I=5 A and ω=100 rad/s,

TI = 8 °C/A, T_ω = 0.4 °C/(rad/s)

Thus, near this operating point, a one-ampere increase has a much larger local temperature effect than a one-radian-per-second increase. This comparison is meaningful only when the engineering ranges and units are considered.

Second-order partial derivatives include fxx, fxy, fyx, and fyy. If the mixed partial derivatives are continuous in a neighborhood, Clairaut’s theorem gives

fxy = fyx

The continuity condition matters; without suitable regularity, equality cannot be assumed automatically.

4. Directional Derivatives and the Gradient

A unit direction vector in the plane is

𝐮 = [u₁,u₂]ᵀ, ||𝐮|| = 1

The directional derivative of f at (a,b) in direction 𝐮 is

D_𝐮f(a,b) = limh→0 [f(a+hu₁,b+hu₂)−f(a,b)]/h

If f is differentiable, then

D_𝐮f = ∇f · 𝐮

where the gradient is

∇f = [fx,fy]ᵀ

The gradient points in the direction of greatest local increase. The maximum directional derivative is ||∇f||, attained when 𝐮=∇f/||∇f||. The direction of greatest decrease is the negative gradient direction. A direction tangent to a level curve is perpendicular to the gradient.

Example 3: Directional rate of change

Let

f(x,y) = x² + 3xy + y²

At (1,2),

∇f = [2x+3y, 3x+2y]ᵀ = [8,7]ᵀ

For the direction from (1,2) to (4,6), the direction vector is (3,4), whose unit vector is 𝐮=(3/5,4/5). Therefore,

D_𝐮f = [8,7]·[3/5,4/5] = 52/5 = 10.4

The function increases at 10.4 output units per unit distance in that direction. The maximum rate is √(8²+7²)=√113≈10.63.

5. Differentiability and Total Differentials

Partial derivatives may exist even when a function is not differentiable. Differentiability is a stronger local property: near a point, the function must be well approximated by a linear mapping. For a differentiable scalar function,

df = fx dx + fy dy

This is the total differential. For small changes,

∆f ≈ df = fx∆x + fy∆y

The approximation neglects second- and higher-order terms. In engineering, this is the basis of sensitivity analysis and uncertainty propagation.

For f(x₁,…,xₙ),

df = ∑ᵢ₌₁ⁿ (∂f/∂xᵢ)dxᵢ

The vector form is

df = ∇fᵀd𝐱

where d𝐱 is the vector of small input changes.

If independent measurement errors have standard deviations σxᵢ and are uncorrelated, a first-order estimate of output variance is

σf² ≈ ∑ᵢ₌₁ⁿ (∂f/∂xᵢ)² σxᵢ²

This formula assumes small errors and local linearity. Correlated inputs require covariance terms.

6. Jacobian Matrices and the Chain Rule

For a mapping 𝐅:ℝⁿ→ℝᵐ, the Jacobian matrix is

J_𝐅(𝐱) = [∂Fᵢ/∂xⱼ]m×n

It is the best local linear approximation of the mapping:

∆𝐅 ≈ J_𝐅(𝐱)∆𝐱

For a scalar function, the Jacobian is a row vector, while the gradient is conventionally a column vector. Both contain the same first derivatives but use different orientations.

If 𝐲=𝐠(𝐱) and 𝐳=𝐅(𝐲), the multivariable chain rule is

J𝐅∘𝐠(𝐱) = J_𝐅(𝐠(𝐱))J_𝐠(𝐱)

The dimensions must be compatible. In robotics, the Jacobian relates joint rates to end-effector velocity:

𝐯 = J(𝐪)𝐪̇

where 𝐪 is the joint-coordinate vector, 𝐪̇ is joint velocity, and 𝐯 is Cartesian velocity. The model is local and may become singular when the Jacobian loses rank.

Example 4: Two-link planar arm

For a planar arm with link lengths l₁,l₂ and joint angles θ₁,θ₂,

x = l₁cosθ₁ + l₂cos(θ₁+θ₂)
y = l₁sinθ₁ + l₂sin(θ₁+θ₂)

The position Jacobian is

J = [−l₁sinθ₁−l₂sin(θ₁+θ₂), −l₂sin(θ₁+θ₂);
l₁cosθ₁+l₂cos(θ₁+θ₂), l₂cos(θ₁+θ₂)]

Its determinant is l₁l₂sinθ₂. Thus, when θ₂=0 or π modulo 2π, the arm is singular: some Cartesian velocity directions cannot be produced by finite, independent joint velocities.

7. Hessians and Second-Order Behavior

The Hessian matrix of a scalar function of two variables is

Hf = [fxx, fxy; fyx, fyy]

When the mixed derivatives are continuous, the Hessian is symmetric. The quadratic form

𝐯ᵀHf𝐯

describes curvature in direction 𝐯. Positive curvature indicates local convexity in that direction; negative curvature indicates concavity.

For a stationary point where ∇f=0, the second-derivative test uses

D = fxxfyy − (fxy)²

At the point:

  • If D>0 and fxx>0, there is a local minimum.
  • If D>0 and fxx<0, there is a local maximum.
  • If D<0, there is a saddle point.
  • If D=0, the test is inconclusive.

For more variables, a positive-definite Hessian indicates a strict local minimum, and a negative-definite Hessian indicates a strict local maximum. Eigenvalues provide a practical definiteness test for symmetric Hessians.

8. Taylor Expansions and Linearization

For a scalar function of two variables, the first-order Taylor approximation about (a,b) is

f(x,y) ≈ f(a,b) + ∇f(a,b)ᵀ[(x−a),(y−b)]ᵀ

The second-order approximation is

f(x,y) ≈ f(a,b) + ∇f(a,b)ᵀ∆𝐱 + ½∆𝐱ᵀHf(a,b)∆𝐱

where ∆𝐱=[x−a,y−b]ᵀ. The approximation is accurate near the expansion point when the required derivatives exist and higher-order terms are sufficiently small.

Example 5: Linearizing a sensor model

Let sensor output be

V(r,T) = 5e−0.02r(1+0.001T)

where r is distance in m, T is temperature in °C, and V is in V. At (r,T)=(10,20),

V₀ = 5e−0.2(1.02) ≈ 4.166 V

The derivatives are

Vr = −0.1e−0.02r(1+0.001T)
VT = 0.005e−0.02r

At the operating point, Vr≈−0.0833 V/m and VT≈0.004094 V/°C. Hence, for small changes ∆r and ∆T,

∆V ≈ −0.0833∆r + 0.004094∆T

This equation supports calibration, error budgeting, and local controller design.

9. Unconstrained Optimization

An interior local extremum of a differentiable function must satisfy

∇f(x,y) = 𝐽

where 𝐉 is the zero vector. These are necessary conditions, not sufficient conditions. Boundary points and points where derivatives fail to exist must also be examined when optimizing over a closed region.

Example 6: Classifying stationary points

Let

f(x,y) = x³ − 3x + y²

Then

∇f = [3x²−3, 2y]ᵀ

Stationary points are (1,0) and (−1,0). The Hessian is

H = [6x,0;0,2]

At (1,0), the Hessian is positive definite, so the point is a local minimum. At (−1,0), it is indefinite, so the point is a saddle point.

10. Constrained Extrema and Lagrange Multipliers

Suppose f(x,y) is optimized subject to

g(x,y) = c

At a regular constrained extremum, where ∇g≠0, the level curves of f and g are tangent. Therefore,

∇f = λ∇g

or equivalently,

∇f(x,y) = λ∇g(x,y), g(x,y)=c

The scalar λ is a Lagrange multiplier. It represents the local rate at which the optimal objective changes as the constraint value changes, subject to the stated regularity and sign conventions.

Example 7: Maximum area with fixed perimeter

For a rectangle with side lengths x and y, maximize

A = xy

subject to a fixed perimeter 2x+2y=20, or x+y=10. Let g=x+y. Then

∇A = [y,x]ᵀ, ∇g=[1,1]ᵀ

The multiplier equations give y=λ and x=λ, hence x=y. With the constraint, x=y=5, and the maximum area is 25 square units. Positivity and the endpoint behavior on the feasible line confirm the result.

For several constraints, multipliers are introduced for each constraint. In numerical engineering optimization, equality constraints may be combined with inequality constraints using Karush–Kuhn–Tucker conditions, but the Lagrange formulation is the essential foundation.

11. Applied Case: Calibration of a Two-Input Positioning System

Background

Consider an illustrative two-axis positioning stage. Its measured position error is modeled locally by

e(u,v) = 0.04u² + 0.02uv + 0.03v² − 0.6u − 0.4v + 2

where u and v are dimensionless calibration adjustments and e is error in mm.

Problem

Determine the adjustment that minimizes the local error model and assess whether the stationary point is a minimum.

Analysis

The gradient is

∇e = [0.08u + 0.02v − 0.6,
0.02u + 0.06v − 0.4]ᵀ

Set it equal to zero:

0.08u + 0.02v = 0.6
0.02u + 0.06v = 0.4

Multiplying the first equation by 3 gives 0.24u+0.06v=1.8. Subtracting the second equation gives 0.22u=1.4, so u=6.3636. Substitution yields v=4.5455.

The Hessian is

H = [0.08,0.02;0.02,0.06]

Its leading principal minors are 0.08>0 and 0.08×0.06−0.02²=0.0044>0. Therefore, it is positive definite and the stationary point is a strict local minimum. Because the quadratic model is globally convex, it is also the unique global minimum of the model.

The predicted error is approximately

e(6.3636,4.5455) ≈ 0.0909 mm

Engineering interpretation

The gradient identifies how calibration adjustments affect error, while the Hessian describes coupling and curvature. The nonzero off-diagonal entries show that the two axes are not independent: changing one adjustment changes the sensitivity to the other. In practice, the model must be validated experimentally, and actuator limits, quantization, noise, and model mismatch must be included before implementing the calculated settings.

12. Limitations, Best Practices, and Contemporary Use

Multivariable derivatives are local descriptions. A linearization can be inaccurate for large changes, near discontinuities, or near singular configurations. A stationary point may be physically infeasible, unstable, or outside the model’s valid operating range. Numerical derivatives may be corrupted by measurement noise and poor step-size selection.

Best practices include:

  • State domains, constraints, units, and operating ranges explicitly.
  • Check all feasible boundaries in optimization problems.
  • Scale variables when their magnitudes or units differ greatly.
  • Verify symbolic derivatives with numerical or automatic differentiation.
  • Inspect Jacobian rank and condition number near robot singularities.
  • Validate Taylor models against measurements away from the expansion point.
  • Use uncertainty propagation only when the small-error and local-linearity assumptions are reasonable.
  • Treat AI-generated symbolic or numerical results as candidates requiring independent verification.

Automatic differentiation and differentiable simulation are increasingly used in robotics, digital twins, machine learning, and model-based control. They calculate derivatives through computational graphs, but they do not correct an incorrect physical model or invalid assumptions. In safety-critical mechatronic systems, derivative-based optimization must remain subject to physical limits, verification, traceability, and human engineering judgment.

Chapter Summary

Multivariable differential calculus extends one-variable calculus to systems with several interacting inputs. Limits require path-independent behavior, and continuity connects limits with function values. Partial derivatives measure sensitivity to individual variables, while the gradient combines these sensitivities and identifies the direction of steepest increase. Directional derivatives quantify change along arbitrary unit directions.

The total differential and Jacobian provide local linear models. Jacobians are particularly important in coordinate transformations and robot velocity analysis. Hessians describe curvature and support the classification of stationary points. Taylor expansions provide first- and second-order approximations for sensing, calibration, uncertainty analysis, and control. Unconstrained extrema require stationary-point analysis together with boundary checks, whereas equality-constrained extrema can be found using Lagrange multipliers. Throughout engineering practice, domain validity, units, scaling, constraints, numerical conditioning, and experimental validation are essential.

Key Terms

Gradient: Vector of first partial derivatives of a scalar function.

Partial derivative: Derivative with respect to one variable while holding other independent variables constant.

Directional derivative: Rate of change in a specified unit direction.

Total differential: First-order change approximation using all independent-variable changes.

Differentiability: Existence of a valid local linear approximation.

Jacobian: Matrix of first derivatives of a vector-valued mapping.

Hessian: Matrix of second partial derivatives of a scalar function.

Level curve: Set of points where a scalar function has constant value.

Continuity: Property that the limit equals the function value at a point.

Linearization: First-order Taylor approximation near an operating point.

Taylor expansion: Polynomial approximation involving derivatives at a reference point.

Stationary point: Point at which the gradient is zero or, for constrained problems, satisfies the multiplier condition.

Local minimum: Function value no greater than nearby values.

Saddle point: Point with increasing and decreasing directions locally.

Positive-definite matrix: Symmetric matrix whose quadratic form is positive for every nonzero vector.

Lagrange multiplier: Scalar enforcing an equality constraint in an extremum problem.

Singularity: Configuration where a Jacobian loses rank.

Sensitivity: Change in an output per unit change in an input.

Review Questions

5 Short Answer Questions

  1. What condition must hold for a two-variable limit to exist?
  2. Define the gradient of a scalar function.
  3. What does a Jacobian represent locally?
  4. State the second-derivative test when D<0.
  5. Why is a unit vector required in the definition of a directional derivative?

5 Long Answer Questions

  1. Explain continuity and differentiability for a multivariable function, including their relationship.
  2. Derive the directional derivative formula D_𝐮f=∇f·𝐮 and interpret its maximum value.
  3. Explain how the Hessian classifies stationary points and why the inconclusive case requires another method.
  4. Describe the use of Jacobians in planar robot kinematics and explain the meaning of a singular configuration.
  5. Explain first- and second-order Taylor approximations and discuss their engineering limitations.

3 Analytical / Application Questions

  1. For f(x,y)=x²+4xy+5y², find the gradient and Hessian, classify the stationary point, and justify the classification.
  2. A sensor output depends on distance and temperature. Propose a first-order uncertainty-propagation model, identify the required derivatives and standard deviations, and state the assumptions needed.
  3. Minimize f(x,y)=x²+y² subject to x+2y=6 using Lagrange multipliers, and verify the result geometrically or by substitution.

Multiple Choice Questions with Answers

Question 1

For f(x,y)=x²+3xy+y², what is ∇f(1,2)?

A. [8,7]ᵀ

B. [5,8]ᵀ

C. [7,8]ᵀ

D. [2,3]ᵀ

Correct Answer: A. [8,7]ᵀ

Question 2

The maximum directional derivative of a differentiable scalar function at a point is:

A. The determinant of its Hessian

B. The norm of its gradient

C. The trace of its Jacobian

D. Always zero

Correct Answer: B. The norm of its gradient

Question 3

For f(x,y)=(x²−y²)/(x²+y²), what happens to the limit at the origin?

A. It equals 0

B. It equals 1

C. It equals −1

D. It does not exist

Correct Answer: D. It does not exist

Question 4

Which matrix contains the first partial derivatives of a vector-valued mapping?

A. Hessian

B. Covariance matrix

C. Jacobian

D. Identity matrix

Correct Answer: C. Jacobian

Question 5

For a stationary point of a two-variable function, D=fxxfyy−fxy²<0 indicates:

A. A local minimum

B. A local maximum

C. A saddle point

D. A guaranteed global minimum

Correct Answer: C. A saddle point

Question 6

The first-order approximation of f near 𝐚 is based on:

A. The gradient at 𝐚

B. Only the Hessian determinant

C. The function’s global maximum

D. The constraint multiplier only

Correct Answer: A. The gradient at 𝐚

Question 7

For an equality constraint g(x,y)=c, the Lagrange multiplier condition is:

A. ∇f=∇g

B. ∇f=λ∇g

C. f=λg

D. Hf=0

Correct Answer: B. ∇f=λ∇g

Question 8

In the two-link planar arm model, a singularity occurs when:

A. θ₂=π/2 only

B. l₁=0 only

C. sinθ₂=0

D. Both link lengths are equal

Correct Answer: C. sinθ₂=0

Question 9

At (1,2), the directional derivative of x²+3xy+y² toward (4,6) is:

A. 8

B. 10.4

C. 12

D. 52

Correct Answer: B. 10.4

Question 10

A positive-definite Hessian at a stationary point implies:

A. A strict local minimum

B. A strict local maximum

C. A saddle point

D. That no stationary point exists

Correct Answer: A. A strict local minimum

Engineering Mathematics II
Chapter 2 of 15