Structure preview

Partial derivatives, gradient and tangent plane: understanding the linear model

From trace slopes to differentiability: definitions, worked calculations, gradient, directional derivatives, tangent planes and counterexamples. Twelve exercises and a 3D lab.

Section: Calculus Updated:

Lab: partials, gradient and tangent plane

Learning-path index

Articles /derivate-parziali-gradiente-piano-tangente
Partial derivatives, gradient and tangent plane: understanding the linear model

42 min

The previous stage taught us to control all nearby paths. Now ask more: can a plane replace the surface with error small relative to traveled distance? Partials measure two slopes, the gradient collects them, and differentiability guarantees one linear model in every direction. These are not equivalent statements.

Lab: partials, gradient and tangent plane · Learning-path index

1. Partials: vary one coordinate at a time

fₓ(a,b)=lim_h→0 [f(a+h,b)−f(a,b)]/h
fᵧ(a,b)=lim_k→0 [f(a,b+k)−f(a,b)]/k

Work at an interior domain point so small positive and negative increments are allowed. For fₓ hold y=b fixed; for fᵧ hold x=a fixed. These are ordinary derivatives of traces, not simultaneous variation of all inputs.

Symbol ∂ reminds us that other variables stay fixed. At a boundary, two-sided derivatives may be undefined: do not silently replace them with one-sided derivatives.

Explore

2. A complete calculation: x²+xy+2y²

f(x,y)=x²+xy+2y²
fₓ=2x+y; fᵧ=x+4y
f(1,1)=4; fₓ(1,1)=3; fᵧ(1,1)=5

With respect to x, x² gives 2x, xy gives y because y is fixed, and 2y² gives zero. With respect to y the terms give zero, x and 4y. At P=(1,1) the two trace slopes differ.

[f(a+h,b)−f(a,b)]/h=2a+b+h→2a+b
[f(a,b+k)−f(a,b)]/k=a+4b+2k→a+4b

The final lines verify the result directly from the definition. Terms involving h or k vanish in the limit; do not set the increment to zero before simplifying the quotient.

Explore

3. Two trace tangents are not enough for a surface

vₓ=(1,0,fₓ(P)); vᵧ=(0,1,fᵧ(P))
ℓₓ(t)=(a+t,b,f(P)+t fₓ(P))
ℓᵧ(t)=(a,b+t,f(P)+t fᵧ(P))

Vertical-trace tangents have three components and are generally not parallel to horizontal axes: height changes with slope. They determine a candidate plane, but behavior on two traces does not control every planar displacement.

This is the same obstacle as for limits: tests in a few directions do not automatically control all increments. Differentiability is the missing property.

Explore

4. Differentiability: error must be smaller-order than distance

r=√(h²+k²)
f(a+h,b+k)=f(a,b)+Ah+Bk+R(h,k)
lim_(h,k)→(0,0) R(h,k)/r=0
A=fₓ(a,b); B=fᵧ(a,b)

One linear part must describe every small displacement. R→0 alone merely gives small absolute error; we need R=o(r). Differentiability implies continuity, existence of partials and uniqueness of the linear model. Partials alone do not imply differentiability.

A practical sufficient condition: partials existing and continuous on a neighborhood imply differentiability. Split the increment into horizontal and vertical steps and apply the mean value theorem.

R=[fₓ(a+ξh,b+k)−fₓ(a,b)]h
+[fᵧ(a,b+ηk)−fᵧ(a,b)]k; 0<ξ,η<1
|R|/r≤|fₓ(a+ξh,b+k)−fₓ(P)|+|fᵧ(a,b+ηk)−fᵧ(P)|→0

Continuity of partials is sufficient, not necessary. For example x²sin(1/x), set to zero on x=0 and independent of y, is differentiable at the origin since |f|≤r²; its x-partial off the axis contains −cos(1/x) and is not continuous there.

Explore

5. Continuous with both partials, yet not differentiable

f(x,y)=xy/√(x²+y²), (x,y)≠(0,0); f(0,0)=0
|xy|≤(x²+y²)/2 ⇒ |f|≤r/2→0
fₓ(0,0)=fᵧ(0,0)=0
f(t,t)=|t|/√2
|f(t,t)−0|/√(t²+t²)=1/2

Both axes give zero, hence both origin partials are zero. The bound also proves continuity. But the candidate linear map is zero and diagonal relative error stays 1/2: differentiability fails.

‖u‖=1; f(tu)=|t|u₁u₂
lim_t→0⁺ f(tu)/t=u₁u₂
lim_t→0⁻ f(tu)/t=−u₁u₂

If u₁u₂≠0, even the two-sided directional derivative fails. A symmetric central difference would give zero for every h, hiding the cusp. The lab displays right and left quotients separately.

Explore

6. Even all directional derivatives may be insufficient

g(x,y)=x³/(x²+y²), (x,y)≠(0,0); g(0,0)=0
|g|≤|x|≤r ⇒ g→0
gₓ(0,0)=1; gᵧ(0,0)=0
‖u‖=1 ⇒ g(tu)=t u₁³ ⇒ Dᵤg(0,0)=u₁³

All two-sided directional derivatives exist, but are not linear in direction. Dotting the partial vector with u gives u₁, not u₁³. The dot-product theorem requires differentiability; it cannot assume its own hypothesis.

u=(1/√2,1/√2)
Dᵤg=1/(2√2)≠1/√2=∇g·u
L(h,k)=h
|g(t,t)−t|/√(t²+t²)=1/(2√2)

The final relative error does not tend to zero, proving nondifferentiability at the origin. The lab does not draw a tangent plane merely because partials can be computed.

Explore

7. Tangent plane and normal vector

P=(a,b)
T(x,y)=f(a,b)+fₓ(a,b)(x−a)+fᵧ(a,b)(y−b)
N=(−fₓ(P),−fᵧ(P),1)
N·(x−a,y−b,z−f(P))=0

The formula is the differentiability model written in graph coordinates. N is orthogonal to (1,0,fₓ) and (0,1,fᵧ): both dot products vanish. Gradient (fₓ,fᵧ) lives in the input plane; the graph normal has three components. They are different vectors.

f=x²+xy+2y²; P=(1,1)
T=4+3(x−1)+5(y−1)=3x+5y−4
N=(−3,−5,1)

The plane passes through (1,1,4) and contains both trace tangents. It is genuinely tangent because the polynomial is differentiable; the same formal construction was unjustified in the counterexamples.

Explore

8. Gradient and steepest increase

If f is differentiable at P, change in a unit direction is given by the following dot product. This hypothesis is essential, as the counterexamples show.

∇f(P)=(fₓ(P),fᵧ(P))
‖u‖=1; Dᵤf(P)=lim_t→0 [f(P+tu)−f(P)]/t
Dᵤf(P)=∇f(P)·u

Substitute (h,k)=tu in the differentiability expansion. Remainder o(|t|), divided by t, tends to zero from both sides. Direction must be unit length: using a longer vector v scales the derivative with respect to t by its length.

g=∇f(P)≠0
Dᵤf=g·u≤‖g‖‖u‖=‖g‖
u_max=g/‖g‖; u_min=−g/‖g‖
max Dᵤf=‖g‖; min Dᵤf=−‖g‖

Cauchy–Schwarz gives steepest increase along the gradient and decrease opposite it. For x²+xy+2y² at (1,1), g=(3,5), norm √34 and maximizing direction (3,5)/√34. If g=0 and f is differentiable, every directional derivative is zero: no preferred first-order direction.

This comparison uses Euclidean distance and comparably scaled coordinates. Changing units or coordinate scales changes unit displacement and the numerical steepest-growth direction.

Explore

9. Why the gradient is normal to level curves

f(γ(t))=c
0=(d/dt)f(γ(t))=∇f(γ(t))·γ′(t)

Height is constant along a level curve. For a regular parameterization γ, the chain rule makes the gradient orthogonal to tangent γ′. If f is C¹ and the gradient nonzero, the level is locally a regular curve and the gradient is a normal.

f=x²+y²; ∇f=(2x,2y)
f=c>0 ⇒ x²+y²=c
(2x,2y)·(−y,x)=0

On circles the gradient is radial and (−y,x) tangential. At the origin the gradient vanishes and level zero is a point, with no preferred normal. Zero gradient alone does not distinguish bowl, hill and saddle.

Explore

10. Chain rule: when both variables move

z(t)=f(x(t),y(t))
dz/dt=fₓ(x(t),y(t))x′(t)+fᵧ(x(t),y(t))y′(t)

This is not a partial derivative: x and y vary together. The formula requires differentiable f and a differentiable curve. It dots the gradient with curve velocity, which need not have unit length.

f=x²+xy+2y²; x=t; y=t²
f(t,t²)=t²+t³+2t⁴
z′(1)=2+3+8=13
∇f(1,1)·(1,2)=(3,5)·(1,2)=13

Direct differentiation and the chain rule agree. Holding y fixed would give only fₓ=3 and miss the contribution from y’s motion in the input plane.

Explore

11. Differential, changes and measurement errors

df=fₓ(P)dx+fᵧ(P)dy
Δf=df+o(√(dx²+dy²))
|df|≤|fₓ(P)|εₓ+|fᵧ(P)|εᵧ

When |dx|≤εₓ and |dy|≤εᵧ the final bound controls the linear error. It does not automatically bound actual error for finite increments: include the remainder or state that it is first order.

f=x²+xy+2y²; P=(1,1)
df=3dx+5dy
εₓ=0.02; εᵧ=0.01 ⇒ |df|≤0.11
R=dx²+dx·dy+2dy²
|R|≤0.0004+0.0002+0.0002=0.0008
|Δf|≤0.1108

Here the polynomial remainder is exact, giving a finite-error guarantee too. Number 0.11 alone was only the linear estimate. Units of fₓ are output units divided by x units, and likewise for fᵧ.

Explore

12. Second partials and derivative order

fₓₓ=∂ₓ(fₓ); fₓᵧ=∂ᵧ(fₓ)
fᵧₓ=∂ₓ(fᵧ); fᵧᵧ=∂ᵧ(fᵧ)
f=x²+xy+2y² ⇒ fₓₓ=2; fₓᵧ=fᵧₓ=1; fᵧᵧ=4

Our convention: fₓᵧ differentiates first in x, then y. Continuous second derivatives on a neighborhood give equality of mixed partials by Schwarz’s theorem. Existence of the two mixed partials only at a point is insufficient.

q(x,y)=xy(x²−y²)/(x²+y²), (x,y)≠(0,0); q(0,0)=0
qₓ(0,y)=−y; qᵧ(x,0)=x
qₓᵧ(0,0)=−1; qᵧₓ(0,0)=1

The two restrictions follow from difference quotients; differentiating once more gives different values. Schwarz is not contradicted: its second-derivative continuity hypotheses fail. This additional example is theoretical; the lab’s eight cases are listed in its selector.

Explore

13. Full approximation and remainder example

f=x²+xy+2y²; P=(1,1); Q=(1.02,0.99)
h=0.02; k=−0.01
f(P)=4; ∇f(P)=(3,5)
L(Q)=4+3·0.02+5·(−0.01)=4.01
f(Q)=1.0404+1.0098+1.9602=4.0104
f(Q)−L(Q)=0.0004

The plane predicts first-order change, not the exact value. For any (h,k), remainder is h²+hk+2k². Halving both increments quarters the remainder and halves the remainder-to-distance ratio.

|h²+hk+2k²|≤(5/2)(h²+k²)
|R|/√(h²+k²)≤(5/2)√(h²+k²)→0

The final bound holds in every direction and therefore proves differentiability. An error plot on just one line would not be such a proof.

Explore

14. The lab: what to observe, what not to infer

Choose eight models, point P and unit direction u. Compare exact partials, ∇f·u and the analytical directional derivative. The gradient button selects maximal growth only for differentiable models with nonzero gradient; the perpendicular button gives zero first-order slope.

Reduce h and read quotients toward P+hu and P−hu separately. Central differences are numerical estimates, not alternative definitions: they can give zero at a cusp. Differentiability requires |f(Q)−L(Q)|/h to vanish in every direction, not just the chosen one.

At the origin of the counterexamples no plane is drawn; only the candidate linear form appears in error values. Away from the origin they are smooth and the plane becomes available. Surfaces and levels are sampled; classifications are mathematical. Next: extrema, including constraints.

Explore

Exercises: try before revealing

1. Find partials of x³y²+sin y.

Show the explained answer

Hold y fixed: fₓ=3x²y². Hold x fixed: fᵧ=2x³y+cos y. sin y contributes only to the second.

2. Verify fₓ(1,1) by definition for x²+xy+2y².

Show the explained answer

f(1+h,1)=4+3h+h². Subtract 4 and divide by h≠0 to get 3+h→3.

Explore

3. Which gradient and graph normal at (1,1)?

Show the explained answer

For f=x²+xy+2y², ∇f=(3,5) lies in ℝ². A graph normal is N=(−3,−5,1) in ℝ³. These are different vectors.

Explore

4. Write the tangent plane to x²+xy+2y² at (1,1).

Show the explained answer

The polynomial is differentiable. f=4, fₓ=3,fᵧ=5: T=4+3(x−1)+5(y−1)=3x+5y−4. At (1,1) it gives 4.

Explore

5. With ∇f=(3,5), find Dᵤf for u=(3/5,4/5).

Show the explained answer

Assuming differentiability, ‖u‖=1 and Dᵤf=3·3/5+5·4/5=29/5=5.8. Do not merely add the partials.

6. Why does v=(3,4) give 29 rather than 5.8?

Show the explained answer

Curve P+tv has speed 5. Its t-derivative is ∇f·v=29; per unit distance divide by 5, normalizing v to u=v/5.

7. Steepest increase and zero-slope direction for g=(3,5)?

Show the explained answer

For differentiable f, u_max=(3,5)/√34 and maximum √34. Perpendicular (−5,3)/√34 gives dot product 0: zero slope is first-order information.

Explore

8. Does zero gradient imply an extremum?

Show the explained answer

No. For x²−y² at the origin ∇f=0, yet x-axis values are positive and y-axis values negative. It is a saddle, only a candidate requiring further study.

Explore

9. For xy/r at the origin, does a central difference prove zero directional derivative?

Show the explained answer

No. At 45°, f(tu)=|t|/2: right quotient 1/2, left −1/2. No two-sided directional derivative, although every central difference is 0.

Explore

10. All directionals of x³/r² exist: does that imply differentiability?

Show the explained answer

No. At origin Dᵤf=u₁³ but candidate ∇f·u=u₁. For u=(1/√2,1/√2) these give 1/(2√2) and 1/√2: nonlinear directional dependence and nonvanishing relative remainder.

Explore

11. Approximate f(1.02,0.99) for f=x²+xy+2y² and find the error.

Show the explained answer

From P=(1,1), Δx=0.02,Δy=−0.01. L=4+3·0.02−5·0.01=4.01. Exact value 4.0104; error 0.0004=Δx²+ΔxΔy+2Δy².

12. For x=t,y=t², find d/dt of x²+xy+2y² at t=1.

Show the explained answer

Velocity (1,2), gradient (3,5): 3·1+5·2=13. Directly t²+t³+2t⁴ has derivative 2t+3t²+8t³, equal to 13 at 1.

Before: multivariable limits and continuity · Learning-path index

Further reading