KTU S1

Partial Derivatives

By the end you should be able to: Compute first and higher-order partial derivatives, interpret them as rates of change in one variable with the others fixed, and state the equality of mixed partials.

A surface has no single slope. Standing on a hillside you can face uphill, downhill, or along the contour — the steepness depends where you look.

Partial derivatives pin this down by asking a narrower question: what is the slope if I move parallel to one axis?

The definition

∂f∂x=lim⁡h→0f(x+h,y)−f(x,y)h\frac{\partial f}{\partial x} = \lim_{h\to 0}\frac{f(x+h,y)-f(x,y)}{h} ∂f∂y=lim⁡h→0f(x,y+h)−f(x,y)h\frac{\partial f}{\partial y} = \lim_{h\to 0}\frac{f(x,y+h)-f(x,y)}{h}

Compare with the single-variable definition: identical, except only one input moves. The other is frozen.

How to compute them

Treat the other variable as a constant, then differentiate normally. Every rule you already know still applies.

For f(x,y)=x3y2+2xf(x,y) = x^3y^2 + 2x:

∂f∂x=3x2y2+2(y2 rode along as a constant)\frac{\partial f}{\partial x} = 3x^2y^2 + 2 \qquad \text{($y^2$ rode along as a constant)} ∂f∂y=2x3y(x3 was a constant; 2x vanished)\frac{\partial f}{\partial y} = 2x^3y \qquad \text{($x^3$ was a constant; $2x$ vanished)}

At the point (1,2)(1,2):

fx(1,2)=3(1)(4)+2=14,fy(1,2)=2(1)(2)=4f_x(1,2) = 3(1)(4) + 2 = 14, \qquad f_y(1,2) = 2(1)(2) = 4

Read that: at (1,2)(1,2) the surface climbs at 14 per unit east, and 4 per unit north. Steeper in xx than in yy, by a factor of three and a half.

Notation

∂f∂x=fx=∂xf\frac{\partial f}{\partial x} = f_x = \partial_x f

The curly ∂\partial rather than dd signals that other variables are present and being held fixed.

Geometric reading

fx(a,b)f_x(a,b) is the slope of the curve formed by slicing the surface with the vertical plane y=by = b. The slice is a one-variable curve, and fxf_x is its ordinary derivative.

Higher-order partials

Differentiate again, and you may choose which variable each time:

fxx=∂2f∂x2,fyy=∂2f∂y2,fxy=∂2f∂y ∂x,fyx=∂2f∂x ∂yf_{xx} = \frac{\partial^2 f}{\partial x^2}, \qquad f_{yy} = \frac{\partial^2 f}{\partial y^2}, \qquad f_{xy} = \frac{\partial^2 f}{\partial y \, \partial x}, \qquad f_{yx} = \frac{\partial^2 f}{\partial x \, \partial y}

The last two are the mixed partials: differentiate by xx then yy, or by yy then xx.

Clairaut's theorem

If fxyf_{xy} and fyxf_{yx} are both continuous near a point, then

fxy=fyxf_{xy} = f_{yx}

Order does not matter. For f=x3y2+2xf = x^3y^2+2x:

fx=3x2y2+2  ⟹  fxy=6x2yf_x = 3x^2y^2+2 \implies f_{xy} = 6x^2y fy=2x3y  ⟹  fyx=6x2yf_y = 2x^3y \implies f_{yx} = 6x^2y

Equal, as promised. In practice this halves the work, and it is a free check on your arithmetic: if your mixed partials disagree, you have made a mistake.

Where this leads

Second partials assemble into the Hessian matrix, which decides whether a critical point is a maximum, a minimum or a saddle — Module 3. Machine learning uses first partials of a loss with respect to millions of weights; that vector is the gradient, next module too.