WhatsApp us
University Maths18 Nov 2026

Partial Derivatives, the Gradient and Directional Derivatives: Worked Examples

How to find partial derivatives, use the multivariable chain rule, build the gradient and compute directional derivatives, with six graded worked examples, a method table, common mistakes and a practice set with answers.

Partial Derivatives, the Gradient and Directional Derivatives: Worked Examples

A partial derivative measures how a function of several variables changes when you move one variable and hold all the others fixed. You find ∂f/∂x by differentiating with respect to x and treating y, z and every other variable as constants. The gradient ∇f collects all the first partials into one vector, and the directional derivative ∇f · u tells you the rate of change in any unit direction u.

That is the whole idea, but exam and problem-set questions combine it in several ways: chain rules through intermediate variables, implicit surfaces, tangent planes and "find the direction in which..." questions. This guide works through each type with full steps.

What the notation means

For f(x, y), the partial derivative with respect to x is

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

Only x moves. Geometrically, slice the surface z = f(x, y) with the plane y = constant and take the slope of the curve you get. You will also see f_x, ∂_x f and D₁f for the same thing.

Second partials come in four kinds for a function of two variables: f_xx, f_yy and the mixed ones f_xy and f_yx. For the functions met in a first multivariable course (continuous second partials), Clairaut's theorem says f_xy = f_yx, which is a free check on your algebra.

The gradient of f(x, y, z) is

∇f = (f_x, f_y, f_z)

It points in the direction of fastest increase, its length is that fastest rate, and it is perpendicular to the level curve or level surface through the point. Our advanced calculus tutoring page explains how online sessions with Ajay Vatsyayan cover this and the rest of a Calculus III / Multivariable Calculus course.

Which tool does the question want?

The question asks forToolWhat to compute
Rate of change in x (or y) onlyPartial derivativeDifferentiate, others held constant
Rate of change in a given directionDirectional derivative∇f · u, with u a unit vector
Direction of fastest increaseGradient∇f (unit form ∇f / ‖∇f‖)
Largest rate of changeGradient length‖∇f‖
Derivative through intermediate variablesMultivariable chain ruleSum over every path in the tree
∂z/∂x when z is defined by F(x, y, z) = 0Implicit partials−F_x / F_z
Tangent plane to z = f(x, y)Linearisationz = f + f_x(x − a) + f_y(y − b)
Tangent plane to F(x, y, z) = cGradient as normal∇F · (x − x₀, y − y₀, z − z₀) = 0

Six worked examples, easiest first

Example 1: first and mixed partials

Let f(x, y) = x³y² − 5xy + y·e^(2x). Find f_x, f_y, check f_xy = f_yx, and evaluate the first partials at (0, 1).

For f_x, y is a constant, so y·e^(2x) differentiates to 2y·e^(2x):

f_x = 3x²y² − 5y + 2y·e^(2x)

For f_y, x is a constant, so e^(2x) is just a coefficient of y:

f_y = 2x³y − 5x + e^(2x)

Mixed partials: differentiate f_x with respect to y, and f_y with respect to x.

f_xy = 6x²y − 5 + 2e^(2x)

f_yx = 6x²y − 5 + 2e^(2x)

They agree, as Clairaut's theorem predicts. At (0, 1): f_x = 0 − 5 + 2 = −3 and f_y = 0 − 0 + 1 = 1.

Example 2: the chain rule with a tree diagram

Let z = x²y + y³ where x = st and y = s + t². Find ∂z/∂t when s = 2, t = 1.

Draw the tree: z branches to x and y, and each of x and y branches to s and t. Every path from z down to t contributes one product:

∂z/∂t = (∂z/∂x)(∂x/∂t) + (∂z/∂y)(∂y/∂t)

The pieces: ∂z/∂x = 2xy, ∂z/∂y = x² + 3y², ∂x/∂t = s, ∂y/∂t = 2t.

At s = 2, t = 1 we first find the point in xy terms: x = 2, y = 2 + 1 = 3. So ∂z/∂x = 12, ∂z/∂y = 4 + 27 = 31, ∂x/∂t = 2, ∂y/∂t = 2.

∂z/∂t = 12 × 2 + 31 × 2 = 86

Substituting first and differentiating gives the same 86, which is a good check when the algebra is short. This is the same chain rule you met in related rates problems, with one product per path instead of one product in total.

Example 3: gradient, directional derivative and maximum rate

Let f(x, y, z) = x²y + yz² − 3xz. At P(1, 2, −1), find the rate of change of f in the direction from P towards Q(3, 4, 0), and the largest possible rate of change.

Gradient:

∇f = (2xy − 3z, x² + z², 2yz − 3x)

At P: ∇f = (4 + 3, 1 + 1, −4 − 3) = (7, 2, −7).

Direction: the vector from P to Q is Q − P = (2, 2, 1). Its length is √(4 + 4 + 1) = 3, so u = (2/3, 2/3, 1/3).

D_u f = (7)(2/3) + (2)(2/3) + (−7)(1/3) = (14 + 4 − 7)/3 = 11/3

Largest rate of change: ‖∇f‖ = √(49 + 4 + 49) = √102 ≈ 10.10, in the direction (7, 2, −7)/√102.

Example 4: tangent plane and linear approximation

Let f(x, y) = √(x² + 3y). Find the tangent plane at (2, 4) and use it to estimate f(2.1, 3.9).

f(2, 4) = √16 = 4.

f_x = x / √(x² + 3y), so f_x(2, 4) = 2/4 = 1/2.

f_y = 3 / (2√(x² + 3y)), so f_y(2, 4) = 3/8.

Tangent plane:

z = 4 + ½(x − 2) + (3/8)(y − 4)

At (2.1, 3.9): z ≈ 4 + ½(0.1) + (3/8)(−0.1) = 4 + 0.05 − 0.0375 = 4.0125. The exact value is √16.11 ≈ 4.01373, so the estimate is off by about 0.0012.

Example 5: implicit partials and a tangent plane to a surface

The surface x²z + yz³ + xy = 5 passes through (1, 2, 1). Find ∂z/∂x and ∂z/∂y there, and the tangent plane.

Write F(x, y, z) = x²z + yz³ + xy − 5. Check the point: 1 + 2 + 2 − 5 = 0.

F_x = 2xz + y = 4, F_y = z³ + x = 2, F_z = x² + 3yz² = 1 + 6 = 7.

∂z/∂x = −F_x / F_z = −4/7

∂z/∂y = −F_y / F_z = −2/7

The gradient (4, 2, 7) is normal to the surface, so the tangent plane is

4(x − 1) + 2(y − 2) + 7(z − 1) = 0, that is 4x + 2y + 7z = 15.

The formula needs F_z ≠ 0 at the point. If F_z = 0, z is not locally a function of x and y there.

Example 6: find every direction with a given rate

Let f(x, y) = x² − xy + 2y². At (1, 1), find the unit vectors u for which D_u f = 0, and those for which D_u f = 1.

∇f = (2x − y, −x + 4y), so ∇f(1, 1) = (1, 3) and ‖∇f‖ = √10.

D_u f = 0 means u is perpendicular to (1, 3), so u = (3, −1)/√10 or u = (−3, 1)/√10. These are the two directions along the level curve.

For D_u f = 1, write u = (cos θ, sin θ):

cos θ + 3 sin θ = 1

Using t = tan(θ/2), cos θ = (1 − t²)/(1 + t²) and sin θ = 2t/(1 + t²), which gives 1 − t² + 6t = 1 + t², so 2t² − 6t = 0 and t = 0 or t = 3. That gives u = (1, 0) and u = (−4/5, 3/5). Check the second: −4/5 + 9/5 = 1.

Before solving, check the target value is possible: a rate of 1 exists because 1 ≤ √10. A question asking for D_u f = 4 here has no solution.

Partial derivatives existing is not enough

Take g(x, y) = xy / (x² + y²) with g(0, 0) = 0. Along both axes g is 0, so g_x(0, 0) = 0 and g_y(0, 0) = 0. But along y = x, g = ½ everywhere except the origin, so g is not even continuous at (0, 0). The formula D_u f = ∇f · u needs f to be differentiable, and a safe sufficient condition is that the first partials are continuous near the point. Proof-based courses test this distinction; computational courses usually assume it.

Where students lose marks

  • Using a direction that is not a unit vector. In Example 3, using (2, 2, 1) instead of (2, 2, 1)/3 gives 11 instead of 11/3. Always divide by the length first.
  • Confusing a point with a direction. "Towards Q" means Q − P, not Q itself. Write the vector out before you normalise it.
  • Dropping a branch of the chain rule. If x and y both depend on t, there are two terms. Draw the tree and count the paths before writing anything.
  • Evaluating at the wrong point. In Example 2, ∂z/∂x = 2xy must be evaluated at (x, y) = (2, 3), not at (s, t) = (2, 1). Convert the point first.
  • Losing the minus sign in implicit partials. It is −F_x / F_z. Check against a simple case such as x + z = 0, where ∂z/∂x must be −1.
  • Treating a constant as a variable. In ∂/∂y of y·e^(2x), e^(2x) is a constant, so the answer is e^(2x), not 2y·e^(2x).
  • Writing the gradient as a number. ∇f is a vector. The directional derivative and ‖∇f‖ are numbers. Mixing them up costs method marks.

Practice set with answers

  1. f(x, y) = x² sin y + y³. Find f_x, f_y and f_xy.
  2. z = e^(xy) with x = r cos θ, y = r sin θ. Find ∂z/∂θ.
  3. f(x, y, z) = xyz + z². Find the directional derivative at (2, −1, 1) in the direction of (1, 2, 2).
  4. f(x, y) = ln(x² + y²). Find the largest rate of change at (1, 2) and its direction.
  5. Find the tangent plane to xy + yz + zx = 11 at (1, 2, 3).

Answers:

  1. f_x = 2x sin y, f_y = x² cos y + 3y², f_xy = 2x cos y.
  2. ∂z/∂θ = r² cos 2θ · e^(½ r² sin 2θ).
  3. ∇f = (−1, 2, 0), u = (1, 2, 2)/3, so D_u f = 1.
  4. ∇f = (2/5, 4/5), largest rate 2/√5 ≈ 0.894, direction (1, 2)/√5.
  5. Normal (5, 4, 3), plane 5x + 4y + 3z = 22.

Where this leads next

Partial derivatives are the language of the rest of multivariable calculus. Setting ∇f = 0 finds critical points, and the second-derivative test uses the Hessian matrix of second partials, which is where the eigenvalue ideas from linear algebra courses reappear. Constrained optimisation uses the gradient condition ∇f = λ∇g. Conservative vector fields are gradients of a potential, which leads to line integrals and the big integral theorems in our guide to Green's, Stokes' and the divergence theorem. Exact differential equations rest on the test M_y = N_x, covered in our first-order differential equations guide. Engineering students meet partials again in heat flow, fluid mechanics and error estimates, which our engineering mathematics support covers. If you are planning which course comes when, our post on the US college maths sequence shows where multivariable calculus sits.

How Maths Bodhi helps

Students we teach often find the computations fine but lose marks on set-up: the wrong direction vector, a missing chain-rule branch or a sign in an implicit derivative. Sessions work through your own course's problems and review your attempts line by line. We explain and practise; we don't complete graded assignments or exams. See our university maths tutoring overview for the courses we support.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team (November 2026).

Frequently asked questions

How do you find a partial derivative?
Differentiate with respect to one variable and treat every other variable as a constant.
What is the difference between the gradient and the directional derivative?
The gradient is a vector of all first partials; the directional derivative is the number ∇f · u for a chosen unit vector u.
How does the chain rule work for partial derivatives?
Add one product of derivatives for every path from the output variable down to the variable you are differentiating by.
Why must the direction be a unit vector?
Otherwise the answer is scaled by the vector's length and no longer measures the rate of change per unit distance.
Is f_xy always equal to f_yx?
Yes when the second partials are continuous near the point (Clairaut's theorem), which covers almost every function in a first course.
Does the gradient point in the direction of fastest increase?
Yes, and its length ‖∇f‖ is that fastest rate of increase.
partial derivativesgradientdirectional derivativemultivariable calculuscalculus 3

Related guides

Keep exploring this maths topic

University Maths2 Nov 2026

Green's, Stokes' and the Divergence Theorem: Which One to Use, With Worked Examples

How Green's theorem, Stokes' theorem and the divergence theorem connect, a decision table for choosing one, six graded worked examples with every step, orientation rules, common mistakes and practice questions with answers.

vector calculusGreen's theoremStokes' theoremdivergence theorem

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

First Order Differential Equations: Separable, Linear and Exact, with Practice Problems

How to recognise and solve the three main types of first order differential equations (separable, linear and exact), with six graded worked examples, a method-choice table, common mark-losing slips and practice problems with answers.

differential equationsfirst order ODEintegrating factorexact equations

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

How to Clear an Engineering Maths Back Paper (M1, M2 or M3)

A realistic plan for B.Tech students re-taking Engineering Mathematics M1, M2 or M3: confirm your scheme, map past papers, revise unit by unit, and master the high-yield question types through seven worked examples and a practice set with answers.

engineering maths back paperM1 back paperM2 back paperM3 back paper

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

From JEE to IIT First-Year Maths: What Changes, with Worked Examples

Why strong JEE students often struggle in first-year maths at an IIT, what the current IIT courses contain, six worked examples showing exactly what changes (ε-δ, proofs, abstract linear algebra, several variables), a first-semester plan, common mistakes and practice with answers.

IIT first year mathsJEE to IIT mathsB.Tech mathslinear algebra

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Related Rates Problems, Step by Step (With Solutions)

A six-step method for related rates problems in Calculus I, six graded worked solutions (balloon, ladder, cone, cars, shadow, rocket camera), a table of the equations that link the variables, common traps and practice with answers.

related ratesCalculus Iimplicit differentiationchain rule

By Maths Bodhi Team

Read guide

University Maths2 Nov 2026

The US College Math Sequence: Calculus I to III, Linear Algebra and Differential Equations

How the usual US college math sequence runs from Calculus I to Calculus III, linear algebra and differential equations, how four real universities number and bundle it, what AP credit changes, and the maths that trips students up at each step, with worked examples and practice.

college math sequenceCalculus IIIlinear algebradifferential equations

By Maths Bodhi Team

Read guide