Skip to content

Multivariable function differentiation ​

Partial differentiation ​

Given a function f(x,y), the partial derivative of f with respect to x at a point a is denoted by ∂xf(a) or ∂1f(a) is defined as the derivative of teh function Fx at point 0, provided that the derivative exists, i.e.

∂xf(a)=∂1f(a):=Fx′(0)==limt→0Fx(t)−Fx(0)t=limt→0f(a1+h,a2)−f(a1,a2)t

Fx′(0) represents the slope of the tangent line to the intersection curve at the point P(a,f(a)).

The partial derivative with respect to y is defined similarly: Fy(t):=f(a1,a2+t), and

∂yf(a)=∂2f(a):=Fy′(0)==limt→0Fy(t)−Fy(0)t=limt→0f(a1,a2+h)−f(a1,a2)t

General approach ​

To compute the partial derivative of a function f∈R2→R with respect to the variable x, we fix the variable y as a constant, and differentiate the expression as a real-valued function which depends only on x (if it is differentiable).

We proceed in a similar way for computing the partial derivative with respect to the variable y, but now we consider x a constant and differentiate the expression with respect to y.

Totally differentiable functions ​

A function f:R2→R is totally differentiable at a point a∈intDf (denoted as f∈D{a}) if

∃A∈R1×2:limh→0|f(a+h)−f(a)−A⋅h|||h||=0

In this case, f′(a)=A is the derivative matrix of f at the point a.

If f∈D{a}, then the derivative matrix f′(a) is uniquely determined.

Construction of the derivative matrix ​

Let f:R2→R be a function, a∈intDf. If f∈D{a}, then ∃∂1f(a),∂2f(a), and

f′(a)=[∂1f(a)∂2f(a)]

is so-called Jacobian matrix of f at the point a.

The existence of the partial derivatives at a point a does not imply that the function is totally differentiable at that point. However, if we assume slightly more about the function, then the existence of the partial derivatives, we can guarantee the total differentiability of the function.

Sufficient condition for total differentiability ​

Let f:R2→R be a function, a∈intDf. Assume that there exists a neighborhood K(a)⊂Df of the point a such that the following conditions hold:

  1. ∃∂1f(x,y) and ∃∂2f(x,y) for all (x,y)∈K(a)
  2. the partial derivative functions ∂1f(x,y) and ∂2f(x,y) are continuous at the point a

Then, the function f is totally differentiable at the point a.

Continuously differentiable functions ​

A function f:R2→R is continuously differentiable at a point a∈intDf (denoted as f∈C1{a}) if

  1. There exists a neighborhood K(a)⊂Df such that f∈D(K(a))
  2. every partial derivative is continuous at the point a

Partial derivatives of second order ​

Let f:R2→R be a function, a∈intDf. If for a fixed i=1,2, the partial derivative ∂if exists in a neighborhood of the point a, and the partial derivative of the function ∂if with respect to the j-th variable (j=1,2) exists at the point a, then the number

∂ijf(a):=∂i∂jf(a):=∂j(∂if)(a)

is called the partial derivative of the second order of the function f at the point a with respect to ij.

Twice differentiable functions ​

The function f:R2→R is twice differentiable at a point a∈intDf (denoted as f∈D2{a}) if

  1. There exists a neighborhood K(a)⊂Df such that f∈Dx at every point x∈K(a)
  2. ∀i=1,2,…,n the partial derivative ∂if is differentiable at the point a

Then the matrix

f″(a)=[∂11f(a)∂12f(a)∂21f(a)∂22f(a)]

is called the Hessian matrix of the function f at the point a.

Young's theorem ​

If f∈R2→R and f∈D2{a}, then the Hessian matrix f″(a) is symmetric.

∂12f(a)=∂21f(a)

Twice continuously differentiable functions ​

A function f:R2→R is twice continuously differentiable at a point a∈intDf (denoted as f∈C2{a}) if

  1. There exists a neighborhood K(a)⊂Df such that f∈D2(K(a))
  2. Every partial derivative of second order is continuous at the point a

Local extrema of R2→R functions ​

We say that a function f:R2→R has a local maximum at a point a∈intDf (or equivalently, f has a local minimum at the point a) if there exists a neighborhood K(a)⊂Df of the point a such that

∀x∈K(a):f(x)≤f(a)

In this case, the point a is called a local maximum of the function f.

Similarly, the notions of local minimum point and local minimum of the function f are defined analogously.

Necessary condition for local extrema ​

Assume that f∈R2→R and a∈intDf. Additionally

  • f∈D{a}
  • the function f has a local extremum at the point a

Then f′(a)=0, i.e., f′(a)=[∂1f(a)∂2f(a)]=[00].

Sufficient condition for local extrema ​

Let f∈R2→R, a∈intDf and f∈C2{a}. Assume that

∂1f(a)=0and∂2f(a)=0

Define the discriminant

D(a):=det[∂11f(a)∂12f(a)∂21f(a)∂22f(a)]

Then

  • If D(a)>0 and ∂11f(a)<0, then f has a local maximum at the point a
  • If D(a)>0 and ∂11f(a)>0, then f has a local minimum at the point a
  • If D(a)<0, then f has no local extremum at the point a (saddle point)
  • If D(a)=0, then the test is inconclusive

Global extrema of R2→R functions on compact sets ​

Weierstrass theorem ​

Assume that H is a bounded and closed set in R2 and f:H→R is a continuous function. Then f has a global maximum and a global minimum on the set H.

  • ∃x1∈H, ∀x∈H:f(x)≤f(x1) (global maximum)
  • ∃x2∈H, ∀x∈H:f(x)≥f(x2) (global minimum)

Let H⊂R2 be a compact set and f:H→R be a continuous function, and f is differentiable on the interior of the set H.

Then f attains its largest (smallest) value either on the boundary of the set H or at an stationary point a (∂1f(a)=0 and ∂2f(a)=0) in the interior of the set H.

Example 1 (partial derivatives) ​

Find the partial derivatives of the following function:

f(x,y)=ln⁡(xy2)−x3y2cos⁡(x2+y2)(x>0,y≠0)

Solution ​

The partial derivative of f with respect to x is

∂x(x,y)=y2xy2−3x2y2cos⁡(x2+y2)+x3y2sin⁡(x2+y2)⋅2x=1x−3x2y2cos⁡(x2+y2)+2x4y2sin⁡(x2+y2)

The partial derivative of f with respect to y is

∂y(x,y)=2xyxy2−x3⋅2ycos⁡(x2+y2)+x3y2sin⁡(x2+y2)⋅2y=2y−2x3ycos⁡(x2+y2)+2x3y3sin⁡(x2+y2)

Example 2 (partial derivatives) ​

Find the partial derivatives of the following function:

f(x,y)=arctan⁡(yx)(x≠0,y∈R)

Solution ​

The partial derivative of f with respect to x is

∂x(x,y)=11+(yx)2⋅(yx)x′=11+(yx)2⋅(−yx2)=−yx2+y2

The partial derivative of f with respect to y is

∂y(x,y)=11+(yx)2⋅(yx)y′=11+(yx)2⋅1x=xx2+y2

Example 3 (local extrema) ​

Find the local extreme values and their points of the following function:

f(x,y)=x2−4xy+y3+4y((x,y)∈R2)

Solution ​

The partial derivatives of the function f are

∂xf(x,y)=2x−4y∂yf(x,y)=−4x+3y2+4

Necessary condition for local extrema is

∂xf(x,y)=0∂yf(x,y)=0

Solving the system of equations, we get

2x−4y=0−4x+3y2+4=0

From the first equation, we get x=2y. Substituting this into the second equation, we get

−4⋅2y+3y2+4=0⟹3y2−8y+4=0

The solutions of the quadratic equation are y1=2 and y2=23.

For y=2, we get x=4, and for y=23, we get x=43.

Therefore, possible points of local extrema

P1(4,2)andP2(43,23)

Sufficient condition for local extrema

∂11f(x,y)=2∂12f(x,y)=−4∂21f(x,y)=−4∂22f(x,y)=6y

The Hessian matrix of the function f is

f″(x,y)=[∂11f(x,y)∂12f(x,y)∂21f(x,y)∂22f(x,y)]=[2−4−46y]

The discriminant of the Hessian matrix is

D(x,y)=det[2−4−46y]=12y−16

For the point P1(4,2), we get D(4,2)=8>0 and ∂11f(4,2)=2>0. Therefore, the function f has a local minimum at the point P1(4,2). Minimum value of the function is f(4,2)=42−4⋅4⋅2+23+4⋅2=0.

For the point P2(43,23), we get D(43,23)=−8<0. Therefore, the function f has no local extremum at the point P2(43,23).

Example 4 (local extrema) ​

Find the local extreme values and their points of the following function:

f(x,y)=x4−4xy+y4((x,y)∈R2)

Solution ​

The partial derivatives of the function f are

∂xf(x,y)=4x3−4y∂yf(x,y)=−4x+4y3

Necessary condition for local extrema is

∂xf(x,y)=0∂yf(x,y)=0

Solving the system of equations, we get

4x3−4y=0−4x+4y3=0

From the first equation, we get x3=y. Substituting this into the second equation, we get

−4⋅x+4⋅x9=0⟹x(1−x8)=0⟹x=0orx=±1

For x=0, we get y=0, for x=1, we get y=1, and for x=−1, we get y=−1.

Therefore, possible points of local extrema

P1(0,0),P2(1,1),P3(−1,−1)

Sufficient condition for local extrema

∂11f(x,y)=12x2∂12f(x,y)=−4∂21f(x,y)=−4∂22f(x,y)=12y2

The Hessian matrix of the function f is

f″(x,y)=[∂11f(x,y)∂12f(x,y)∂21f(x,y)∂22f(x,y)]=[12x2−4−412y2]

The discriminant of the Hessian matrix is

D(x,y)=det[12x2−4−412y2]=144x2y2−16

For the point P1(0,0), we get D(0,0)=−16<0. Therefore, the function f has no local extremum at the point P1(0,0).

For the point P2(1,1), we get D(1,1)=128>0 and ∂11f(1,1)=12>0. Therefore, the function f has a local minimum at the point P2(1,1). Minimum value of the function is f(1,1)=14−4⋅1⋅1+14=−2.

For the point P3(−1,−1), we get D(−1,−1)=128>0 and ∂11f(−1,−1)=12>0. Therefore, the function f has a local minimum at the point P3(−1,−1). Minimum value of the function is f(−1,−1)=(−1)4−4⋅(−1)⋅(−1)+(−1)4=−2.

Example 5 (global extrema) ​

Find the global extreme values and their points of the following function:

f(x,y)=2xy−3yH={(x,y)∈R2∣0≤x≤2,0≤y≤x2}

Solution ​

The function f is continuous on the set H. The set H is a compact set. Therefore, the function f attains its largest and smallest values on the boundary of the set H or at the stationary points in the interior of the set H.

Boundary of the set H

We can see that at x=0 y can only be 0, an as x increases, the range of y increases.

Therefore, the set H has triangle like shape, but with the top part of the triangle being a parabola.

Function of the parabola is y=x2.

We are interested in vertices, namely A(0,0), B(2,0), and C(2,4).

  1. Checking segment AB:
g1(x):=f(x,0)=2x⋅0−3⋅0=0(x∈[0,2])

is constant, therefore, global extremum may occur at any point in the segment AB.

  1. Checking segment BC:
g2(y):=f(2,y)=2⋅2⋅y−3y=y(y∈[0,4])

is increasing, therefore, global extremum may occur at the points B or C.

  1. Checking segment AC:
g3(x):=f(x,x2)=2x⋅x2−3x2=2x3−3x2(x∈[0,2])g3′(x)=6x2−6x=6x(x−1)

So global extremum may occur at the point A or at point D(1,1). We also need consider boundaries of the interval [0,2], but both points A and C are already considered.

Determine potential stationary points

The partial derivatives of the function f are

∂xf(x,y)=2y∂yf(x,y)=2x−3

Necessary condition for local extrema is

∂xf(x,y)=0∂yf(x,y)=0

Solving the system of equations, we get

2y=02x−3=0

Simple solution y=0, x=32.

Therefore, possible points of local extrema

P1(32,0)

However, the point P1 is on the boundary of the set H. Therefore, there are no stationary points in the interior of the set H.

Determine global extrema

Totally, we have 4 points to check: A(0,0), B(2,0), C(2,4), and D(1,1).

f(0,0)=2⋅0⋅0−3⋅0=0f(2,0)=2⋅2⋅0−3⋅0=0f(2,4)=2⋅2⋅4−3⋅4=16f(1,1)=2⋅1⋅1−3⋅1=−1

Therefore, the global maximum of the function f is f(2,4)=16 at the point C(2,4), and the global minimum of the function f is f(1,1)=−1 at the point D(1,1).

Example 6 (global extrema) ​

Find the global extreme values and their points of the following function:

f(x,y)=x3−12x+y3−3y((x,y)∈R2)H={(x,y)∈R2∣−2≤x≤3,−x≤y≤2}

Solution ​

The function f is continuous on the set H. The set H is a compact set. Therefore, the function f attains its largest and smallest values on the boundary of the set H or at the stationary points in the interior of the set H.

Boundary of the set H

We can see that on set H at x=−2 y can only be 2, an as x increases, the range of y increases.

Therefore, the set H has triangle shape, with line y=−x as one of the boundaries.

Vertices of the triangle are A(−2,2), B(3,2), and C(3,−3).

  1. Checking segment AB:
g1(x):=f(x,2)=x3−12x+23−3⋅2=x3−12x+8−6==x3−12x+2(x∈[−2,3])g1′(x)=3x2−12=3(x2−4)=3(x−2)(x+2)

We need to consider point D(2,2), and also boundaries of the interval [−2,3], points A and B.

  1. Checking segment BC:
g2(y):=f(3,y)=33−12⋅3+y3−3y=27−36+y3−3y==y3−3y−9(y∈[−3,2])g2′(y)=3y2−3=3(y2−1)=3(y−1)(y+1)

We need to consider point E(3,1), F(3,−1), and also boundaries of the interval [−3,2], points B and C.

  1. Checking segment AC:
g3(x):=f(x,−x)=x3−12x+(−x)3−3⋅(−x)==x3−12x−x3+3x=−9x(x∈[−2,3])g3′(x)=−9

Function is strictly decreasing, therefore, global extremum may occur at the point A and C, which are already considered.

Determine potential stationary points

The partial derivatives of the function f are

∂xf(x,y)=3x2−12∂yf(x,y)=3y2−3

Necessary condition for local extrema is

∂xf(x,y)=0∂yf(x,y)=0

Solving the system of equations, we get

3x2−12=03y2−3=0

Simple solution x=±2, y=±1.

Therefore, possible points of local extrema

P1(2,1),P2(2,−1),P3(−2,1),P4(−2,−1)

However, only points P1 and P2 are in the interior of the set H.

Determine global extrema

Totally, we have 8 points to check: A(−2,2), B(3,2), C(3,−3), D(2,2), E(3,1), F(3,−1), and P1(2,1), P2(2,−1).

f(A)=(−2)3−12⋅(−2)+23−3⋅2=−8+24+8−6=18f(B)=33−12⋅3+23−3⋅2=27−36+8−6=−7f(C)=33−12⋅3+(−3)3−3⋅(−3)=27−36−27+9=−27f(D)=23−12⋅2+23−3⋅2=8−24+8−6=−14f(E)=33−12⋅3+13−3⋅1=27−36+1−3=−11f(F)=33−12⋅3+(−1)3−3⋅(−1)=27−36−1+3=−7f(P1)=23−12⋅2+13−3⋅1=8−24+1−3=−18f(P2)=23−12⋅2+(−1)3−3⋅(−1)=8−24−1+3=−14

Therefore, the global maximum of the function f is f(A)=18 at the point A(−2,2), and the global minimum of the function f is f(C)=−27 at the point C(3,−3).