Part 3 - Higher partial derivatives

Introduction

In this part we’ll define higher partial derivatives and how we define if a function with several variables is differentiable.

Higher partial derivatives

In the last part we defined what partial derivatives were:

fx=limh0f(x+h,y)f(x,y)hf_x = \lim{h \to 0} \dfrac{f(x + h, y) - f(x, y)}{h}

We can now derive this function again:

fxx=limh0fx(x+h,y)fx(x,y)hf_{xx} = \lim{h \to 0} \dfrac{f_x(x + h, y) - f_x(x, y)}{h} fxy=limh0fx(x,y+h)fx(x,y)hf_{xy} = \lim{h \to 0} \dfrac{f_x(x, y + h) - f_x(x, y)}{h} fyx=limh0fy(x+h,y)fy(x,y)hf_{yx} = \lim{h \to 0} \dfrac{f_y(x + h, y) - f_y(x, y)}{h} fyy=limh0fy(x,y+h)fy(x,y)hf_{yy} = \lim{h \to 0} \dfrac{f_y(x, y + h) - f_y(x, y)}{h}
Example 1

Find all 2nd order partial derivatives of:

f(x,y)=xeyf(x, y) = x \cdot e^y

1st order:

fx(x,y)=eyf_x(x, y) = e^yfy(x,y)=xeyf_y(x, y) = x \cdot e^y

2nd order:

fxx(x,y)=0f_{xx}(x, y) = 0fxy(x,y)=eyf_{xy}(x, y) = e^yfyx(x,y)=eyf_{yx}(x, y) = e^yfyy(x,y)=xeyf_{yy}(x, y) = x \cdot e^y

As we see fxyf_{xy} and fyxf_{yx} are the same. This is often the case.

Theorem 1 (Clairaut’s theorem)

If fxyf_{xy} and fyxf_{yx} are continuous, then fxy=fyxf_{xy} = f_{yx}

We’ll save the actual proof for another day, but we can “explain” why this theorem holds:

Explanation

Suppose we have:

f(x,y)=xnymf(x, y) = x^n y^m

The 1st & 2nd order partial derivatives of this polynomial are:

fx(x,y)=nxn1ymf_x(x, y) = n \cdot x^{n - 1} y^mfy(x,y)=mxnym1f_y(x, y) = m \cdot x^n y^{m - 1}fxy(x,y)=mnxn1ym1f_{xy}(x, y) = m \cdot n \cdot x^{n - 1} y^{m - 1}fyx(x,y)=nmxn1ym1f_{yx}(x, y) = n \cdot m \cdot x^{n - 1} y^{m - 1}

We see that this holds true for polynomials. Since any function can be approximated by polynomials, it’s not surprising Clairaut’s theorem holds.

Remark 1

Suppose, ff, is a composition of sin(x)sin(x), cos(x)cos(x), polynomials and the exponential function. For example:

f(x,y)=ecos(xy3sin(xy))f(x, y) = e^{cos(xy - 3 \cdot sin(xy))}

Since all of these functions are differentiable any amount of times and all of these are continuous. This must mean that partial derivatives of any order must also be continuous.

This means we can easily use Clairaut’s theorem, since it only applies to functions that are continuous. Therefore we do not need to know if the partial derivatives are continuous ahead of time.

Example 2

Find fxyf_{xy}:

f(x,y)=sin(excos(x3))+xyf(x, y) = sin(e^{x \cdot cos(x - 3))} + xy

Trying to first compute fxf_x will prove to be quite tricky, but using Clairaut’s theorem this problem is trivial:

fy(x,y)=xf_y(x, y) = xfyx(x,y)=1\boxed{f_yx(x, y) = 1}

Notation

There are a lot of different notations for partial derivatives. We’ll mainly use fxf_x and fyf_y.

However, the most common notation is:

fx=fxf_x = \dfrac{\partial f}{\partial x} fy=fyf_y = \dfrac{\partial f}{\partial y}

In the case for higher order partial derivatives:

fxx=(fx )x=2fx2f_{xx} = \dfrac{\partial \left(\dfrac{\partial f}{\partial x}\ \right)}{\partial x} = \dfrac{\partial^2 f}{\partial x^2} fxy=(fx )y=2fxyf_{xy} = \dfrac{\partial \left(\dfrac{\partial f}{\partial x}\ \right)}{\partial y} = \dfrac{\partial^2 f}{\partial x \partial y} fyx=(fy )x=2fyxf_{yx} = \dfrac{\partial \left(\dfrac{\partial f}{\partial y}\ \right)}{\partial x} = \dfrac{\partial^2 f}{\partial y \partial x} fyy=(fy )y=2fy2f_{yy} = \dfrac{\partial \left(\dfrac{\partial f}{\partial y}\ \right)}{\partial y} = \dfrac{\partial^2 f}{\partial y^2}

N’th order partial derivatives

We can derive how many times we want, with how many variables we want:

fxxx,fxxy,fxyx,f_{xxx}, f_{xxy}, f_{xyx}, \ldots

This also includes Clairaut’s theorem.

Geometrical sense

Let’s try to understand what derivatives in two variables looks like geometricaly.

For one variable, it is: f(a)=f'(a) = the slope of the tangent line to the graph at (a,f(a))(a, f(a)). We could also say that this is the rate of change at point aa.

For two variables: fx(a,b)f_x(a, b) intersects the graph by the vertical plane, y=by = b. CC, is the curve of the intersection. In other words fx(a,b)f_x(a, b) = the slope of the tangent line TT.

We could also say:

Intuition

Rate of change in the direction of the variable (we are differentiating)

Differentiability

For one function, the following statement holds:

Note

ff is differentiable \Rightarrow ff has derivate at aa, meaning f(a)f'(a) exists.

When dealing with several variables, this becomes tricky. Let’s look at the definition and see what we can do:

f(a)=limx0f(x+h)f(x)hf'(a) = \lim_{x \to 0} \dfrac{f(x + h) - f(x)}{h}

This just means we have a small change in xx, so let’s say:

Δx=h\Delta x = h

Let’s define the small change in the function value as:

Δy:=f(a+Δx)f(a)\Delta y := f(a + \Delta x) - f(a)

Then, the derivate is:

f(a)=limΔx0ΔyΔxf'(a) = \lim_{\Delta x \to 0} \dfrac{\Delta y}{\Delta x}

Let’s move around the terms:

limΔx0ΔyΔxf(a)=0\lim_{\Delta x \to 0} \dfrac{\Delta y}{\Delta x} - f'(a) = 0

Let’s now call this for ε\varepsilon:

ε=ΔyΔxf(a)\varepsilon = \dfrac{\Delta y}{\Delta x} - f'(a)

We can define this as a function of Δx\Delta x:

ε=ε(Δx)\varepsilon = \varepsilon(\Delta x)

Which means:

εΔx=Δyf(a)Δx\varepsilon \Delta x = \Delta y - f'(a) \Delta x

Which finally means:

Δy=εΔx+f(a)Δx\boxed{\Delta y = \varepsilon \Delta x + f'(a) \Delta x}

And as Δx0\Delta x \to 0, ε0\varepsilon \to 0 as well.

For functions of two variables, we can now instead define Δz\Delta z:

Δz==fx(a,b)Δx+fy(a,b)Δy+ε1Δx+ε2Δy\Delta z = \ldots = \boxed{f_x(a, b)\Delta x + f_y(a, b)\Delta y + \varepsilon_1 \Delta x + \varepsilon_2 \Delta y}

Where:

ε1=ε1(Δx,Δy),ε2=ε2(Δx,Δy)\varepsilon_1 = \varepsilon_1(\Delta x, \Delta y), \varepsilon_2 = \varepsilon_2(\Delta x, \Delta y)