Multivariable Calculus

Table of Contents

1 Function of Several Variables

1.1 Definition

The expression \(z = f(x, y)\) is a function of two variables if a unique value of \(z\) is obtained from each ordered pair of real numbers \((x, y)\). The variables \(x\) and \(y\) are independent variables, and \(z\) is the dependent variable. The set of all ordered pairs of real numbers \((x, y)\) such that \(f(x, y)\) exists is the domain of \(f\); the set of all values of \(f(x, y)\) is the range. Similar definitions could be given for functions of three, four, or more independent variables.

1.2 Example

  • \(f(x,y) = x + y + \frac{x}{y}\)
  • \(z = x^{2y} + e^{x^3-5y} - 6x +2y^2 - 3xy + 1\)

2 Partial Derivatives

2.1 Informal Definition

The partial derivative of \(f\) with respect to \(x\) is the derivative of \(f\) obtained by treating \(x\) as a variable and \(y\) as a constant.

The partial derivative of \(f\) with respect to \(y\) is the derivative of \(f\) obtained by treating \(y\) as a variable and \(x\) as a constant.

2.2 Formal Definition

Let \(z = f(x, y)\) be a function of two independent variables. Let all indicated limits exist. Then the partial derivative of \(f\) with respect to \(x\) is

\[ f_x(x, y) = \frac{\partial f}{\partial x} = \lim_{h\to 0} \frac{f(x + h, y) - f(x,y)}{h} \]

and the partial derivative of \(f\) with respect to \(y\) is

\[ f_y(x, y) = \frac{\partial f}{\partial y} = \lim_{h\to 0} \frac{f(x, y + h) - f(x,y)}{h} \]

You are not required to find partial derivatives by definition.

2.3 Remark

Generally, \(\frac{\partial f}{\partial x}\) and \(\frac{\partial f}{\partial y}\) are not equal.

2.4 Example

Find \(\frac{\partial f}{\partial x}\) and \(\frac{\partial f}{\partial y}\) if \(f(x, y) = x^3 + y^2 + x^2 y + e^{2x+y^3} + ln(\frac{x}{y})\).

Regarding \(y\) as a constant, we have

\(\frac{\partial f}{\partial x} = \frac{dx^3}{dx} + \frac{dy^2}{dx} + \frac{dx^2 y}{dx} + \frac{de^{2x + y^3}}{dx} + \frac{dln(\frac{x}{y})}{dx}\)

\(= 3x^2 + 0 + y \cdot 2x + e^{2x + y^3} \cdot \frac{d(2x+y^3)}{dx} + \frac{1}{\frac{x}{y}} \cdot \frac{d(\frac{1}{y}\cdot x)}{dx}\)

\(= 3x^2 + 2y \cdot x + e^{2x + y^3} \cdot 2 + \frac{y}{x} \cdot \frac{1}{y}\)

\(= 3x^2 + 2y \cdot x + 2e^{2x + y^3} + \frac{1}{x}\)

Regarding \(x\) as a constant, we have

\(\frac{\partial f}{\partial y} = \frac{dx^3}{dy} + \frac{dy^2}{dy} + \frac{dx^2 y}{dy} + \frac{e^{2x + y^3}}{dy} + \frac{dln(\frac{x}{y})}{dy}\)

\(= 0 + 2y + x^2 + e^{2x + y^3} \cdot \frac{d(2x+y^3)}{dy} + \frac{1}{\frac{x}{y}} \cdot \frac{d\frac{x}{y}}{dy}\)

\(= 0 + 2y + x^2 + e^{2x + y^3} \cdot 3y^2 + \frac{y}{x} \cdot \frac{d(xy^{-1})}{dy}\)

\(= 2y + x^2 + e^{2x + y^3} \cdot 3y^2 + \frac{y}{x} \cdot x \cdot (-1) y^{-2}\)

\(= 2y + x^2 + e^{2x + y^3} \cdot 3y^2 - y \cdot y^{-2}\)

\(= 2y + x^2 + e^{2x + y^3} \cdot 3y^2 - y^{-1}\)

As we see, generally, \(\frac{\partial f}{\partial x}\) and \(\frac{\partial f}{\partial y}\) are not the same.

3 Second-Order Partial Derivatives

3.1 Definitions

For a function \(f(x,y)\), if the indicated partial derivative exists, then

\[ \frac{\partial}{\partial x} \left( \frac{\partial f(x,y)}{\partial x} \right) = \frac{\partial^2 f(x,y)}{\partial x^2} = f_{xx} (x,y) \]

\[ \frac{\partial}{\partial y} \left( \frac{\partial f(x,y)}{\partial y} \right) = \frac{\partial^2 f(x,y)}{\partial y^2} = f_{yy} (x,y) \]

\[ \frac{\partial}{\partial y} \left( \frac{\partial f(x,y)}{\partial x} \right) = \frac{\partial^2 f(x,y)}{\partial y \partial x} = f_{xy} (x,y) \]

\[ \frac{\partial}{\partial x} \left( \frac{\partial f(x,y)}{\partial y} \right) = \frac{\partial^2 f(x,y)}{\partial x \partial y} = f_{yx} (x,y) \]

For all functions in this course, \(f_{xy}\) and \(f_{yx}\) are equal.

3.2 Remark

  • Note the order : \(\frac{\partial^2 f}{\partial y \partial x} = \frac{\partial}{\partial y} \left( \frac{\partial f}{\partial x} \right)\) means "the partial derivative of \(\frac{\partial f}{\partial x}\) with respect to \(y\)", so we should first find \(\frac{\partial f}{\partial x}\) and then find the partial derivative of the whole \(\frac{\partial f}{\partial x}\) with respect to \(y\). That is, the order of partial differentiation in \(\partial y \partial x\) is "from right to left". On the other hand, \(f_{xy}\) means "partial derivative with respect to \(x\) first, and then to \(y\)", so it is \(\frac{\partial^2 f}{\partial y \partial x}\), not \(\frac{\partial^2 f}{\partial x \partial y}\). That is, the order of partial differentiation in \(f_{xy}\) is "from left to right".
  • Identity: By definition, \(\frac{\partial^2 f}{\partial y \partial x}\) and \(\frac{\partial^2 f}{\partial x \partial y}\) should be calculated in different ways. However, for all functions that you will meet in the course, it holds that \[ \frac{\partial^2 f}{\partial y \partial x} = \frac{\partial^2 f}{\partial x \partial y} \]
  • Note the notation : \(\frac{\partial^2 f}{\partial x^2}\) is NOT "the derivative of \(f\) with respect to \(x^2\)"! Instead, it is \(\frac{\partial}{\partial x} \left( \frac{\partial f}{\partial x} \right)\).

3.3 Example

Find all second-order partial derivatives of \(f(x, y) = x^3 + y^2 + x^2 y + e^{2x+y^3} + ln(\frac{x}{y})\).

We already found that

\(f_x(x,y) = \frac{\partial f}{\partial x} = 3x^2 + y \cdot 2x + 2e^{2x + y^3} + \frac{1}{x}\)

and

\(f_y(x,y) = \frac{\partial f}{\partial y} = 2y + x^2 + e^{2x + y^3} \cdot 3y^2 - y^{-1}\)

so

\(f_{xx}(x,y) = \frac{\partial^2 f}{\partial x^2} = \frac{\partial}{\partial x} \left( 3x^2 + y \cdot 2x + 2e^{2x + y^3} + \frac{1}{x} \right)\)

\(= 6x + 2y + 2e^{2x + y^3} \cdot \frac{d(2x + y^3)}{dx} + (-1)x^{-2}\)

\(= 6x + 2y + 2e^{2x + y^3} \cdot 2 - x^{-2}\)

\(= 6x + 2y + 4e^{2x + y^3} - x^{-2}\)

and

\(f_{yy}(x,y) = \frac{\partial^2 f}{\partial y^2} = \frac{\partial}{\partial y} \left( 2y + x^2 + e^{2x + y^3} \cdot 3y^2 - y^{-1} \right)\)

\(= 2 + 0 + \frac{\partial (e^{2x + y^3} \cdot 3y^2)}{\partial y} - (-1) \cdot y^{-2}\)

\(= 2 + \left( \frac{de^{2x + y^3}}{dy} \cdot 3y^2 + e^{2x + y^3} \cdot \frac{d3y^2}{dy} \right) + y^{-2}\)

\(= 2 + \left( e^{2x+y^3} \cdot \frac{d(2x + y^3)}{dy} \cdot 3y^2 + e^{2x + y^3} \cdot 6y \right) + y^{-2}\)

\(= 2 + \left( e^{2x+y^3} \cdot 3y^2 \cdot 3y^2 + e^{2x + y^3} \cdot 6y \right) + y^{-2}\)

\(= 2 + e^{2x+y^3} \cdot 9y^4 + e^{2x + y^3} \cdot 6y + y^{-2}\)

Also, we have

\(f_{xy}(x,y) = \frac{\partial^2 f}{\partial y \partial x} = \frac{\partial}{\partial y} \left( 3x^2 + y \cdot 2x + 2e^{2x + y^3} + \frac{1}{x} \right)\)

\(= 0 + 2x + \frac{d(2e^{2x + y^3})}{dy} + 0\)

\(= 2x + 2e^{2x + y^3} \cdot \frac{d(2x+y^3)}{dy}\)

\(= 2x + 2e^{2x + y^3} \cdot 3y^2\)

\(= 2x + 6e^{2x + y^3} \cdot y^2\)

and

\(f_{yx}(x,y) = \frac{\partial^2 f}{\partial x \partial y} = \frac{\partial}{\partial x} \left( 2y + x^2 + e^{2x + y^3} \cdot 3y^2 - y^{-1} \right)\)

\(= 0 + 2x + \frac{d (e^{2x + y^3} \cdot 3y^2)} {dx} - 0\)

\(= 2x + 3y^2 \cdot \frac{d e^{2x + y^3}} {dx}\)

\(= 2x + 3y^2 \cdot e^{2x + y^3} \cdot \frac{d (2x + y^3)} {dx}\)

\(= 2x + 3y^2 \cdot e^{2x + y^3} \cdot 2\)

\(= 2x + 6y^2 \cdot e^{2x + y^3}\)

As we see, \(f_{xy} = f_{yx}\).

4 Maxima and Minima

4.1 Definition

Let \((a, b)\) be the center of a circular region contained in the \(xy\)-plane. Then, for a function \(z = f(x, y)\) defined for every \(f(x, y)\) in the region,

  • \(f(a, b)\) is a relative (or local) maximum if \(f(a, b) > f(x, y)\) for all points \((x, y)\) in the circular region
  • \(f(a, b)\) is a relative (or local) minimum if \(f(a, b) < f(x, y)\) for all points \((x, y)\) in the circular region

4.2 Critical Point

4.2.1 Definition

For a function \(f(x,y)\), the points \((a,b)\) such that \(f_x(a,b) = 0\) and \(f_y(a,b) = 0\) are called critical points.

4.2.2 Remark

AND condition: For a critical point \((a,b)\), \(f_x(a,b) = 0\) and \(f_y(a,b) = 0\) should hold at the same time.

4.2.3 How to find all critical points?

  1. Find all values of \(x\) such that \(f_x(x,y) = 0\) or \(f_y(x,y) = 0\), say \(x_1, x_2, \dots, x_m\)
  2. For \(x_1\)
    • put \(x=x_1\) into the equations \(f_x(x,y) = 0\) and \(f_y(x,y) = 0\), to get \(f_x(x_1,y) = 0\) and \(f_y(x_1,y) = 0\)
    • solve for all values of \(y\) such that \(f_x(x_1,y) = 0\) and \(f_y(x_1,y) = 0\), say \(y_{1},y_{2},\dots,y_{m}\)
    • then all \((x_1, y_{1}), (x_1, y_{2}), \dots, (x_1, y_{m})\) are critical points
  3. Repeat Step 2 for each \(x_2, \dots, x_n\), to get all the corresponding critical points.

See Example 4 for illustration.

4.3 Saddle Point

For a function \(f(x,y)\), a point on the graph is called a saddle point if it is a minimum when approached from one direction but a maximum when approached from another direction. A saddle point is neither a maximum nor a minimum.

10-6-53.gif

source of picture:
https://math.etsu.edu/multicalc/prealpha/Chap2/Chap2-8/10-6-53.gif

4.4 Test for Relative Extrema

For a function \(z = f(x,y)\), let \(f_{xx}\), \(f_{yy}\) and \(f_{xy}\) all exist in a circular region contained in the \(xy-\)plane with center \((a,b)\).

Suppose \((a,b)\) is a critical point of \(f(x,y)\), ie, \(f_x(a, b) = 0\) and \(f_y(a,b) = 0\).

Define the number \(D\), known as the discriminant, by \[ D(a,b) = f_{xx}(a,b) \cdot f_{yy}(a,b) - [f_{xy}(a,b)]^2 \]

Then

  • \(f(a,b)\) is a relative maximum if \(D(a,b) > 0\) and \(f_{xx}(a,b) < 0\)
  • \(f(a,b)\) is a relative minimum if \(D(a,b) > 0\) and \(f_{xx}(a,b) > 0\)
  • \(f(a,b)\) is a saddle point (neither a maximum nor a minimum) if \(D(a,b) < 0\)
  • if \(D(a,b) = 0\), the test gives no information

4.5 Example

4.5.1 Example 1

Find all relative minima, relative maxima or saddle points of \(f(x, y) = 8x^2 + 4xy + y^2 + 48x - 24y - 7\).

First, find all partial derivatives and second-order partial derivatives.

\(f_x(x,y) = 16x + 4y + 48\)

\(f_y(x,y) = 4x + 2y -24\)

\(f_{xx}(x,y) = 16\)

\(f_{yy}(x,y) = 2\)

\(f_{xy}(x,y) = f_{yx}(x,y) = 4\)

Second, find all critical points by letting \(f_x = 0\) and \(f_y = 0\), ie,

\(16x + 4y + 48 = 0\),

\(4x + 2y -24 = 0\).

which means \(x = -12\) and \(y = 36\). Hence \((-12, 36)\) is the only critical point of function \(f\).

Third, calculate the discriminant of \(f\) at the critical point \((-12, 36)\), ie,

\(D = f_{xx}(-12, 36) \cdot f_{yy}(-12, 36) - [f_{xy}(-12, 36)]^2 = 16 \cdot 2 - 4^2 = 16\)

Finally, since \(D > 0\) and \(f_{xx} > 0\), we know \((-12, 36)\) is a relative minimum of \(f\).

4.5.2 Example 2

Find all relative minima, relative maxima or saddle points of \(f(x, y) = -8x^2 + 8xy + y^2 + 48x - 24y - 7\).

First, find all partial derivatives and second-order partial derivatives.

\(f_x(x,y) = -16x + 8y + 48\)

\(f_y(x,y) = 8x + 2y -24\)

\(f_{xx}(x,y) = -16\)

\(f_{yy}(x,y) = 2\)

\(f_{xy}(x,y) = f_{yx}(x,y) = 8\)

Second, find all critical points by letting \(f_x = 0\) and \(f_y = 0\), ie,

\(-16x + 8y + 48 = 0\),

\(8x + 2y -24 = 0\).

which means \(x = 3\) and \(y = 0\). Hence \((3, 0)\) is the only critical point of function \(f\).

Third, calculate the discriminant of \(f\) at the critical point \((3, 0)\), ie,

\(D = f_{xx}(3, 0) \cdot f_{yy}(3, 0) - [f_{xy}(3, 0)]^2 = -16 \cdot 2 - 8^2 = -96\)

Finally, since \(D < 0\), we know \((3, 0)\) is a saddle point of \(f\).

4.5.3 Example 3

Find all relative minima, relative maxima or saddle points of \(f(x, y) = x^3 + 8y^3 - 48x - 24y - 7\).

First, find all partial derivatives and second-order partial derivatives.

\(f_x(x,y) = 3x^2 - 48 = 3(x^2 - 16) = 3(x + 4)(x - 4)\)

\(f_y(x,y) = 24y^2 -24 = 24(y^2 - 1) = 24(y + 1)(y - 1)\)

\(f_{xx}(x,y) = 6x\)

\(f_{yy}(x,y) = 48y\)

\(f_{xy}(x,y) = f_{yx}(x,y) = 0\)

Second, find all critical points by letting \(f_x = 0\) and \(f_y = 0\), ie,

\(3(x + 4)(x - 4) = 0\),

\(24(y + 1)(y - 1) = 0\).

We see that \(-4\) and \(4\) are the only two values of \(x\) such that \(f_x = 0\) or \(f_y = 0\).

  • When \(x = -4\), we have \(f_x(x,y) = 0\). A critical number should make both \(f_x = 0\) and \(f_y = 0\) hold at the same time. To have \(f_y = 0\), we need \(y = -1\) or \(y = 1\). Therefore, \((x,y) = (-4, -1)\) and \((x,y) = (-4, 1)\) are two critical points.
  • When \(x = 4\), we have \(f_x(x,y) = 0\). A critical number should make both \(f_x = 0\) and \(f_y = 0\) hold at the same time. To have \(f_y = 0\), we need \(y = -1\) or \(y = 1\). Therefore, \((x,y) = (4, -1)\) and \((x,y) = (4, 1)\) are two critical points.

Hence, there are 4 critical points in total : \((x,y) = (-4, -1), (-4, 1), (4, -1), (4, 1)\).

Third, calculate the discriminant of \(f\) at each critical point:

  • at \((x,y) = (-4,-1)\), \(D = f_{xx}(-4, -1) \cdot f_{yy}(-4, -1) - [f_{xy}(-4, -1)]^2 = 1152 > 0\). Since \(f_{xx}(-4, -1) < 0\), \((x,y) = (-4, -1)\) yields a relative maximum
  • at \((x,y) = (-4,1)\), \(D = f_{xx}(-4, 1) \cdot f_{yy}(-4, 1) - [f_{xy}(-4, 1)]^2 = -1152 < 0\), so \((x,y) = (-4, 1)\) yields a saddle point
  • at \((x,y) = (4,-1)\), \(D = f_{xx}(4, -1) \cdot f_{yy}(4, -1) - [f_{xy}(4, -1)]^2 = -1152 < 0\), so \((x,y) = (4, -1)\) yields a saddle point
  • at \((x,y) = (4,1)\), \(D = f_{xx}(4, 1) \cdot f_{yy}(4, 1) - [f_{xy}(4, 1)]^2 = 1152 > 0\). Since \(f_{xx}(4, 1) > 0\), \((x,y) = (4, 1)\) yields a relative minimum.

4.5.4 Example 4

Find all relative minima, relative maxima or saddle points of \(f(x, y) = (x^2 - 1)(y^2 - 9)\).

First, find all partial derivatives and second-order partial derivatives.

\(f_x(x,y) = (y^2 - 9) \cdot 2x = 2x(y+3)(y-3)\)

\(f_y(x,y) = (x^2 - 1) \cdot 2y = 2(x+1)(x-1)y\)

\(f_{xx}(x,y) = 2(y^2 - 9)\)

\(f_{yy}(x,y) = 2(x^2 - 1)\)

\(f_{xy}(x,y) = f_{yx}(x,y) = 4xy\)

Second, find all critical points by letting \(f_x = 0\) and \(f_y = 0\), ie,

\(2x(y+3)(y-3) = 0\),

\(2(x+1)(x-1)y = 0\).

We see that \(0, -1\) and \(1\) are the values of \(x\) such that \(f_x = 0\) or \(f_y = 0\).

  • When \(x = 0\), we have \(f_x(x,y) = 0\). A critical number should make both \(f_x = 0\) and \(f_y = 0\) hold at the same time. Hence let's see how to make \(f_y = 0\) hold. Putting \(x=0\) into the second equation, we get \(2(x+1)(x-1)y = 2\cdot(0+1)\cdot(0-1)\cdot y = -2y = 0\), which means \(y = 0\). Therefore \((x,y) = (0,0)\) is a critical point.
  • When \(x = -1\), we have \(f_y(x,y) = 0\). A critical number should make both \(f_x = 0\) and \(f_y = 0\) hold at the same time. Hence let's see how to make \(f_x = 0\) hold. Putting \(x=-1\) into the first equation, we get \(2\cdot(-1)\cdot(y+3)(y-3) = -2(y+3)(y-3) = 0\), which means \(y = -3\) or \(y = 3\). Therefore \((x,y) = (-1, -3)\) and \((x,y) = (-1, 3)\) are two critical points.
  • When \(x = 1\), we have \(f_y(x,y) = 0\). A critical number should make both \(f_x = 0\) and \(f_y = 0\) hold at the same time. Hence let's see how to make \(f_x = 0\) hold. Putting \(x=1\) into the first equation, we get \(2\cdot 1\cdot(y+3)(y-3) = 2(y+3)(y-3) = 0\), which means \(y = -3\) or \(y = 3\). Therefore \((x,y) = (1, -3)\) and \((x,y) = (1, 3)\) are two critical points.

Hence, there are 5 critical points in total : \((x,y) = (0,0), (-1, -3), (-1, 3), (1, -3), (1, 3)\).

Third, calculate the discriminant of \(f\) at each critical point:

  • at \((x,y) = (0, 0)\), \(D = f_{xx}(0, 0) \cdot f_{yy}(0, 0) - [f_{xy}(0, 0)]^2 = 36 > 0\). Since \(f_{xx}(0, 0) = -18 < 0\), \((x,y) = (0, 0)\) yields a relative maximum
  • at \((x,y) = (-1,-3)\), \(D = f_{xx}(-1, -3) \cdot f_{yy}(-1, -3) - [f_{xy}(-1, -3)]^2 = -144 < 0\), so \((x,y) = (-1, -3)\) yields a saddle point
  • at \((x,y) = (-1, 3)\), \(D = f_{xx}(-1, 3) \cdot f_{yy}(-1, 3) - [f_{xy}(-1, 3)]^2 = -144 < 0\), so \((x,y) = (-1, 3)\) yields a saddle point
  • at \((x,y) = (1,-3)\), \(D = f_{xx}(1, -3) \cdot f_{yy}(1, -3) - [f_{xy}(1, -3)]^2 = -144 < 0\), so \((x,y) = (1, -3)\) yields a saddle point
  • at \((x,y) = (1,3)\), \(D = f_{xx}(1, 3) \cdot f_{yy}(1, 3) - [f_{xy}(1, 3)]^2 = -144 < 0\), so \((x,y) = (1, 3)\) yields a saddle point

5 Lagrange Multiplier

5.1 Introduction

In the previous section Multivariate Maxima and Minima, we have already learned how to determine the relative maxima or relative minima of a multivariate function. In this section, we will learn how to find the relative extrema subject to a constraint.

Suppose the width and the height of a rectangle are \(x\) and \(y\) respectively. We know the area of the rectangle is \(f(x, y) = xy\). As \(x\) and \(y\) get larger and larger toward \(\infty\), the area \(f\) gets larger and larger toward \(\infty\), so there is no relative maximum of the area.

However, once a constraint is introduced, the situation becomes different, as we will see. Suppose that the perimeter of the rectangle is fixed to 20, ie. \(2x + 2y = 20\) or equivalently \(x + y = 10\). Now, subject to the constraint \(x+y=10\), what is the maximum of the area of the rectangle? The method in section Multivariate Maxima and Minima doesn't work for this problem because it doesn't consider the constraint. This is the reason why we need Lagrange Multiplier method.

Of course, in this example, we are able to find the maximum of the area of the rectangle simply by substitution method, without using any advanced method like Lagrange Multiplier.

  • Since \(x+y=10\), we can find \(y=10-x\).
  • Replace \(y\) with \(10-x\) in \(f(x,y)\) to get \(f = xy = x(10-x) = 10x - x^2\).
  • Now \(f\) is a function of only \(x\), so the original problem becomes finding the relative maximum of a univariate function. We have already learned this in application of univariate derivative. That is,
    • find the critical number by letting \(f' = 0\), ie, \(10-2x = 0\), which means \(x = 5\)
    • by First Derivative Test,
      • when \(x<5\), we have \(f'(x) > 0\), so \(f(x)\) is increasing
      • when \(x>5\), we have \(f'(x) < 0\), so \(f(x)\) is decreasing
      • so \(x=5\) yields a relative maximum, and the corresponding \(y = 10 - 5 = 5\)

However, this substitution method doesn't always work well, because sometimes the relationship between \(x\) and \(y\) is so complicated that neither of them can be represented as a simple function of the other variable. On the contrary, Lagrange Multiplier is always easy to implement.

Now let's see how we solve this problem through Lagrange Multiplier.

5.2 The Lagrange Multiplier Method

All relative extrema of the function \(f = f(x,y)\), subject to a constraint \(g(x,y) = 0\), will be found among those points \((x,y)\) for which there exists a value of \(\lambda\) such that \[ F_{x}(x,y,\lambda) = 0,\] \[ F_{y}(x,y,\lambda) = 0,\] \[ F_{\lambda}(x,y,\lambda) = 0, \] where \[ F(x,y,\lambda) = f(x,y) - \lambda \cdot g(x,y) \] and all indicated partial derivatives exist.

5.2.1 Remark

This method just helps us find relative extrema, not tells us whether the relative extremum is a relative minimum or a relative maximum.

5.3 Procedure of Applying Lagrange Multiplier

  1. Write the constraint in the form \(g(x,y)=0\)
  2. Form the Lagrange function \(F(x,y,\lambda) = f(x,y) - \lambda \cdot g(x,y)\)
  3. Find \(F_x(x,y,\lambda)\), \(F_y(x,y,\lambda)\) and \(F_{\lambda}(x,y,\lambda)\)
  4. Form the system of equations \(F_{x}(x,y,\lambda) = 0, F_{y}(x,y,\lambda) = 0, F_{\lambda}(x,y,\lambda) = 0\)
  5. Solve the system in Step 4; the relative extrema for \(f\) are among the solutions of the system

5.4 Solving the System of Equations by Substitution

Substitution is the most straightforward method for solving a system of equations of multiple variables. To apply the substitution method, we

  • first represent one variable as a function of the other variables, through one equation in the system
  • then replace this variable in all other equations of the system with the function, so that this variable no longer appears in the new system.

To find the relative extrema of function \(f(x,y)\) under the constraint \(g(x,y) = 0\), the Lagrange Multiplier method leads to a system of equations that contains 3 variables : \(x\), \(y\) and \(\lambda\). By the above statement about substitution method, to solve this system of equations, we may

  • first represent \(\lambda\) as a function of \(x\) and \(y\), through one equation in the system
  • then replace \(\lambda\) in the other 2 equations of the system with that function, so that \(\lambda\) no longer appears in the new system.

Of course, we may represent \(x\) as a function of \(y\) and \(\lambda\) (or \(y\) as a function of \(x\) and \(\lambda\)) and then apply the substitution in a similar way. However, in general, it is better to do the subsitution for \(\lambda\).

5.5 Examples

5.5.1 Example 1

Find relative extrema of \(f(x,y) = xy\), subjuect to \(x + y = 10\).

  1. The constraint can be rewritten as \(g(x,y) = x + y - 10 = 0\).
  2. The Lagrange function is

    \(F(x,y,\lambda) = f(x,y) - \lambda \cdot g(x,y)\) \( = xy - \lambda (x + y - 10)\) \( = xy - \lambda x - \lambda y + 10\lambda\).

  3. Find partial derivatives

    \(F_x(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial x} = y - \lambda\)

    \(F_y(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial y} = x - \lambda\)

    \(F_{\lambda}(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial \lambda} = -x - y + 10\)

  4. Form the system of equations

    System 1:

    \[ F_x(x,y,\lambda) = y - \lambda = 0 \ \ (1) \]

    \[ F_y(x,y,\lambda) = x - \lambda = 0 \ \ (2) \]

    \[ F_{\lambda}(x,y,\lambda) = -x - y + 10 = 0 \ \ (3) \]

  5. Let's solve the System 1 in Step 4 by substitution.

    • Represent \(\lambda\) as a function of \(x\) and \(y\) : from \((1)\) we get \(\lambda = y\ \ (1')\).
    • Replace \(\lambda\) with \(y\) in the other two equations, and we get System 2.

      System 2:

      \[ x - y = 0 \ \ (2') \]

      \[ -x - y + 10 = 0 \ \ (3) \]

    Now we just need solve the System 2 which contains only \(x\) and \(y\). Again, we use substitution method to solve it.

    • Represent \(y\) as a function of \(x\) : from \((2')\) we get \(y = x\ \ (2'')\).
    • Replace \(y\) with \(x\) in equation \((3)\), and we get \(- x - x + 10 = 0 \implies x = 5\)
    • By \((2'')\), we have \(y = x = 5\)

    Therefore, \((x,y) = (5,5)\) yields a relative extremum \(f(5,5) = 5 \cdot 5 =25\)

    Remark: You can use any method to solve these equations. Here I just show you how to apply the subtitution method. It may not be the simplest method, but it always works as far as this course is concerned. Using this "stupid" substitution method sometimes has an advantage: at least you will get the answer even if you are not good at manipulating complicated algebraic operations and tricks.

5.5.2 Example 2

Find relative extrema of \(f(x,y) = x^2 + 2y^2\), subjuect to \(3x + 4y = 5\).

  1. The constraint can be rewritten as \(g(x,y) = 3x + 4y - 5 = 0\).
  2. The Lagrange function is

    \(F(x,y,\lambda) = f(x,y) - \lambda \cdot g(x,y)\) \(= x^2 + 2y^2 - \lambda (3x + 4y - 5)\) \(= x^2 + 2y^2 - 3 \lambda x - 4 \lambda y + 5 \lambda\).

  3. Find partial derivatives

    \(F_x(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial x} = 2x - 3\lambda\)

    \(F_y(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial y} = 4y - 4\lambda\)

    \(F_{\lambda}(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial \lambda} = -3x - 4y + 5\)

  4. Form the system of equations

    System 1:

    \[ F_x(x,y,\lambda) = 2x - 3\lambda = 0 \ \ (1) \]

    \[ F_y(x,y,\lambda) = 4y - 4\lambda = 0 \ \ (2) \]

    \[ F_{\lambda}(x,y,\lambda) = -3x - 4y + 5 = 0 \ \ (3) \]

  5. Let's solve the System 1 in Step 4 by substitution.

    • Represent \(\lambda\) as a function of \(x\) and \(y\) : from \((1)\) we get \(\lambda = \frac{2x}{3} \ \ (1')\).
    • Replace \(\lambda\) with \(\frac{2x}{3}\) in the other two equations, and we get System 2.

      System 2:

      \[ 4y - 4 \cdot \frac{2x}{3} = 4y - \frac{8x}{3} = 0 \ \ (2') \]

      \[ -3x - 4y + 5 = 0 \ \ (3) \]

    Now we just need solve the System 2 which contains only \(x\) and \(y\). Again, we use substitution method to solve it.

    • Rrepresent \(y\) as a function of \(x\) : from \((2')\) we get \(y = \frac{2x}{3} \ \ (2'')\).
    • Replace \(y\) with \(\frac{2x}{3}\) in equation \((3)\), and we get \(- 3x - 4 \cdot \frac{2x}{3} + 5 = 0 \implies x = \frac{15}{17}\)
    • By \((2'')\), we have \(y = \frac{2}{3} \cdot \frac{15}{17} = \frac{10}{17}\)

    Therefore, \((x,y) = \left( \frac{15}{17},\frac{10}{17} \right)\) yields a relative extremum \(f\left( \frac{15}{17},\frac{10}{17} \right) = \frac{425}{289}\).

    Remark: You can use any method to solve these equations. Here I just show you how to apply the subtitution method. It may not be the simplest method, but it always works as far as this course is concerned. Using this "stupid" substitution method sometimes has an advantage: at least you will get the answer even if you are not good at manipulating complicated algebraic operations and tricks.

5.5.3 Example 3

Find relative extrema of \(f(x,y) = x^2 y\), subjuect to \(x + 2y = 3\).

  1. The constraint can be rewritten as \(g(x,y) = x + 2y - 3 = 0\).
  2. The Lagrange function is

    \(F(x,y,\lambda) = f(x,y) - \lambda \cdot g(x,y)\) \(= x^2 y - \lambda (x + 2y - 3)\) \(= x^2 y - \lambda x - 2 \lambda y + 3 \lambda\).

  3. Find partial derivatives

    \(F_x(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial x} = 2xy - \lambda\)

    \(F_y(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial y} = x^2 - 2\lambda\)

    \(F_{\lambda}(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial \lambda} = -x - 2y + 3\)

  4. Form the system of equations

    System 1:

    \[ F_x(x,y,\lambda) = 2xy - \lambda = 0 \ \ (1) \]

    \[ F_y(x,y,\lambda) = x^2 - 2\lambda = 0 \ \ (2) \]

    \[ F_{\lambda}(x,y,\lambda) = -x - 2y + 3 = 0 \ \ (3) \]

  5. Let's solve the System 1 in Step 4 by substitution.

    • Represent \(\lambda\) as a function of \(x\) and \(y\) : from \((1)\) we get \(\lambda = 2xy \ \ (1')\).
    • Replace \(\lambda\) with \(2xy\) in the other two equations, and we get System 2.

      System 2:

      \[ x^2 - 2 \cdot 2xy = x^2 - 4xy = 0 \ \ (2') \]

      \[ -x - 2y + 3 = 0 \ \ (3) \]

    Now we just need solve the System 2 which contains only \(x\) and \(y\). Again, we use substitution method to solve it.

    • Represent \(x\) as a function of \(y\) : from \((3)\) we get \(x = 3-2y \ \ (3')\).
    • Replace \(x\) with \(3-2y\) in equation \((3')\), and we get

      \((3-2y)^2 - 4(3-2y)y = 0\)

      \(\implies 3^2 + (2y)^2 - 2\cdot 3\cdot 2y - (12 - 8y)y = 0\)

      \(\implies 9 + 4y^2 - 12y - 12y + 8y^2 = 0\)

      \(\implies 12y^2 - 24y + 9 = 0\)

      \(\implies 4y^2 - 8y + 3 = 0\)

      \(\implies (2y-1)(2y-3) = 0\)

      \(y = \frac{1}{2}\) or \(y = \frac{3}{2}\)

    • By \((3')\), we have
      • when \(y = \frac{1}{2}\), \(x = 3 - 2 \cdot \frac{1}{2} = 2\)
      • when \(y = \frac{3}{2}\), \(x = 3 - 2 \cdot \frac{3}{2} = 0\)

    Therefore, \((x,y) = \left( 2,\frac{1}{2} \right)\) and \((x,y) = \left( 0,\frac{3}{2} \right)\) yield two relative extrema \(f\left( 2,\frac{1}{2} \right) = 2^2 \cdot \frac{1}{2} = 2\) and \(f\left( 0,\frac{3}{2} \right) = 0^2 \cdot \frac{3}{2} = 0\) respectively.

    Remark: You can use any method to solve these equations. Here I just show you how to apply the subtitution method. It may not be the simplest method, but it always works as far as this course is concerned. Using this "stupid" substitution method sometimes has an advantage: at least you will get the answer even if you are not good at manipulating complicated algebraic operations and tricks.

5.5.4 Example 4

Find relative extrema of \(f(x,y) = x^{\frac{1}{4}} y^{\frac{3}{4}}\), subjuect to \(x + 2y = 1\).

  1. The constraint can be rewritten as \(g(x,y) = x + 2y - 1 = 0\).
  2. The Lagrange function is

    \(F(x,y,\lambda) = f(x,y) - \lambda \cdot g(x,y)\) \(= x^{\frac{1}{4}} y^{\frac{3}{4}} - \lambda (x + 2y - 1)\) \(= x^{\frac{1}{4}} y^{\frac{3}{4}} - \lambda x - 2 \lambda y + \lambda\).

  3. Find partial derivatives

    \(F_x(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial x} = \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} - \lambda\)

    \(F_y(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial y} = x^{\frac{1}{4}} \cdot \frac{3}{4} \cdot y^{\frac{-1}{4}} - 2\lambda\)

    \(F_{\lambda}(x,y,\lambda) = \frac{\partial F(x,y,\lambda)}{\partial \lambda} = -x - 2y + 1\)

  4. Form the system of equations

    System 1:

    \[ F_x(x,y,\lambda) = \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} - \lambda = 0 \ \ (1) \]

    \[ F_y(x,y,\lambda) = x^{\frac{1}{4}} \cdot \frac{3}{4} \cdot y^{\frac{-1}{4}} - 2\lambda = 0 \ \ (2) \]

    \[ F_{\lambda}(x,y,\lambda) = -x - 2y + 1 = 0 \ \ (3) \]

  5. Let's solve the System 1 in Step 4 by substitution.

    • Represent \(\lambda\) as a function of \(x\) and \(y\) : from \((1)\) we get \(\lambda = \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} \ \ (1')\).
    • Replace \(\lambda\) with \(\frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}}\) in the other two equations, and we get System 2.

      System 2:

      \[ x^{\frac{1}{4}} \cdot \frac{3}{4} \cdot y^{\frac{-1}{4}} - 2 \cdot \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} = 0 \ \ (2') \]

      \[ -x - 2y + 1 = 0 \ \ (3) \]

    Now we just need solve the system 2 which contains only \(x\) and \(y\). Again, we use substitution method to solve it.

    • Before applying the substitution, let's simplify \((2')\) in some way. We see that \((2')\) has fraction powers and even negative fraction powers. Thus if we directly apply the substitution then those fraction powers still exist. We don't like fraction powers or negative powers, so let's eliminate them.
      • we see that the negative power of \(x\) in \((2')\) is \(\frac{-3}{4}\) and the negative power of \(y\) in \((2')\) is \(\frac{-1}{4}\).
      • so we multiply both sides of \((2')\) by \(x^{\frac{3}{4}} y^{\frac{1}{4}}\) in order to offset those negative powers

        \(x^{\frac{1}{4}} \cdot \frac{3}{4} \cdot y^{\frac{-1}{4}} - 2 \cdot \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} = 0 \ \ (2')\)

        \(\implies x^{\frac{3}{4}} y^{\frac{1}{4}} \cdot \left( x^{\frac{1}{4}} \cdot \frac{3}{4} \cdot y^{\frac{-1}{4}} - 2 \cdot \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} \right) = x^{\frac{3}{4}} y^{\frac{1}{4}} \cdot 0\)

        \(\implies x^{\frac{3}{4}} y^{\frac{1}{4}} \cdot \left( x^{\frac{1}{4}} \cdot \frac{3}{4} \cdot y^{\frac{-1}{4}} \right) - x^{\frac{3}{4}} y^{\frac{1}{4}} \cdot \left( 2 \cdot \frac{1}{4} \cdot x^{\frac{-3}{4}} y^{\frac{3}{4}} \right) = 0\)

        \(\implies \frac{3}{4} \cdot x^{\frac{3}{4}} x^{\frac{1}{4}} y^{\frac{1}{4}} \cdot y^{\frac{-1}{4}} - 2 \cdot \frac{1}{4} \cdot x^{\frac{3}{4}} \cdot x^{\frac{-3}{4}} \cdot y^{\frac{1}{4}} \cdot y^{\frac{3}{4}} = 0\)

        \(\implies \frac{3}{4} \cdot x - 2 \cdot \frac{1}{4} \cdot y = 0\)

        \(\implies y = \frac{3x}{2} \ \ (2'')\)

        Note here we don't have any fraction power or negative power any more.

      • Now System 2 becomes

        new System 2:

        \[ y = \frac{3x}{2} \ \ (2'') \]

        \[ -x - 2y + 1 = 0 \ \ (3) \]

    • Now let's solve the new System 2 by substitution.
      • \(y\) is already represent as \(\frac{3x}{2}\) in \((2'')\)
      • Replace \(y\) with \(\frac{3x}{2}\) in equation \((3)\), and we get

        \(-x - 2 \cdot \frac{3x}{2} + 1 = 0\)

        \(\implies -x - 3x + 1 = 0\)

        \(\implies x = \frac{1}{4}\)

      • By \((2'')\), we have \(y = \frac{3}{2} \cdot \frac{1}{4} = \frac{3}{8}\)

    Therefore, \((x,y) = \left( \frac{1}{4}, \frac{3}{8} \right)\) yields a relative extremum \(f\left( \frac{1}{4}, \frac{3}{8} \right) = \left( \frac{1}{4} \right) ^ {\frac{1}{4}} \left( \frac{3}{8} \right) ^ {\frac{3}{4}}\).

    Remark: You can use any method to solve these equations. Here I just show you how to apply the subtitution method. It may not be the simplest method, but it always works as far as this course is concerned. Using this "stupid" substitution method sometimes has an advantage: at least you will get the answer even if you are not good at manipulating complicated algebraic operations and tricks.

5.5.5 Example 5

Find relative extrema of \(f(x,y,z) = xyz\), subjuect to \(2xy + 2xz + yz = 12\).

  1. The constraint can be rewritten as \(g(x,y,z) = 2xy + 2xz + yz - 12 = 0\).
  2. The Lagrange function is

    \(F(x,y,z,\lambda) = f(x,y,z) - \lambda \cdot g(x,y,z)\) \(= xyz - \lambda (2xy + 2xz + yz - 12)\) \(= xyz - 2\lambda xy - 2\lambda xz - \lambda yz + 12\lambda\)

  3. Find partial derivatives

    \(F_x(x,y,z,\lambda) = \frac{\partial F(x,y,z,\lambda)}{\partial x} = yz - 2\lambda y - 2\lambda z\)

    \(F_y(x,y,z,\lambda) = \frac{\partial F(x,y,z,\lambda)}{\partial y} = xz - 2\lambda x - \lambda z\)

    \(F_z(x,y,z,\lambda) = \frac{\partial F(x,y,z,\lambda)}{\partial z} = xy - 2\lambda x - \lambda y\)

    \(F_{\lambda}(x,y,z,\lambda) = \frac{\partial F(x,y,z,\lambda)}{\partial \lambda} = - 2xy - 2xz - yz + 12\)

  4. Form the system of equations

    System 1:

    \[ F_x(x,y,z,\lambda) = yz - 2\lambda y - 2\lambda z = 0 \ \ (1) \]

    \[ F_y(x,y,z,\lambda) = xz - 2\lambda x - \lambda z = 0 \ \ (2) \]

    \[ F_z(x,y,z,\lambda) = xy - 2\lambda x - \lambda y = 0 \ \ (3) \]

    \[ F_{\lambda}(x,y,z,\lambda) = - 2xy - 2xz - yz + 12 = 0 \ \ (4) \]

  5. NOTE : the hierarchical structure of the following solution is indicated by the bullet symbol \(\bullet\) and indentation.

    Let's solve the System 1 in Step 4 by substitution.

    • Represent \(\lambda\) as a function of \(x, y\) and \(z\) : from \((1)\) we get \(\lambda = \frac{yz}{2y + 2z} \ \ (1')\).
    • Replace \(\lambda\) with \(\frac{yz}{2y + 2z}\) in the other three equations, and we get

      \(F_y(x,y,z,\lambda) = xz - 2\cdot \frac{yz}{2y + 2z} \cdot x - \frac{yz}{2y + 2z} \cdot z\) \(= \frac{xz(2y+2z)}{2y + 2z} - \frac{2xyz}{2y + 2z} - \frac{yz^2}{2y + 2z}\) \(= \frac{2xyz+2xz^2}{2y + 2z} - \frac{2xyz}{2y + 2z} - \frac{yz^2}{2y + 2z}\) \(= \frac{2xyz+2xz^2 - 2xyz - yz^2}{2y + 2z}\) \(= \frac{(2x - y)z^2}{2y + 2z} = 0\)

      \(\implies (2x - y)z^2 = 0 \ \ (2')\)

      \(F_z(x,y,z,\lambda) = xy - 2\cdot \frac{yz}{2y + 2z} \cdot x - \frac{yz}{2y + 2z} \cdot y\) \(= \frac{xy(2y+2z)}{2y + 2z} - \frac{2xyz}{2y + 2z} - \frac{y^2 z}{2y + 2z}\) \(= \frac{2xy^2+2xyz}{2y + 2z} - \frac{2xyz}{2y + 2z} - \frac{y^2 z}{2y + 2z}\) \(= \frac{2xy^2+2xyz - 2xyz - y^2 z}{2y + 2z}\) \(= \frac{(2x - z)y^2}{2y + 2z} = 0\)

      \(\implies (2x - z)y^2 = 0 \ \ (3')\)

      \(F_{\lambda}(x,y,z,\lambda) = - 2xy - 2xz - yz + 12 = 0 \ \ (4)\)

      Putting \((2')\), \((3')\) and \((4)\) together, we have System 2 which contains only \(x, y\) and \(z\) as follows.

      System 2:

      \[ (2x - y)z^2 = 0 \ \ (2') \]

      \[ (2x - z)y^2 = 0 \ \ (3') \]

      \[ F_{\lambda}(x,y,z,\lambda) = - 2xy - 2xz - yz + 12 = 0 \ \ (4) \]

    Now we just need solve the system 2, which contains only \(x, y\) and \(z\). Again, we use substitution method to solve it.

    From \((2')\), we get

    \[ z = 0 \ \ (5) \textbf{ OR } 2x - y = 0 \implies y = 2x \ \ (6) \]

    Note the relationship between \((5)\) and \((6)\) is OR, not AND, so we don't put them simultaneously into equations \((3')\) and \((4)\) in System 2. Instead, at each time, we just use one of them. As a result, we need discuss it case by case.

    • Case 1 : When \(z = 0 \ \ (5)\) holds
      • Replace \(z\) with \(0\) in equations \((3')\) and \((4)\), and we get System 3.1.

        System 3.1:

        \[ 2xy^2 = 0 \ \ (3'') \]

        \[ -2xy + 12 = 0 \ \ (4') \]

      • Now we just need solve the system 3.1 which contains only \(x\) and \(y\). Again, we use substitution method to solve it.
        • From \((3'')\) we get \[x = 0 \ \ (7) \textbf{ OR } y^2 = 0 \implies y = 0 \ \ (8)\]
        • When \(x = 0 \ \ (7)\) holds, replace \(x\) with \(0\) in equation \((4')\), and we get \(12 = 0\), which never holds, so there is no solution of \(y\) corresponding to \(x=0\)
        • When \(y = 0 \ \ (8)\) holds, replace \(y\) with \(0\) in equation \((4')\), and we get \(12 = 0\), which never holds, so there is no solution of \(x\) corresponding to \(y=0\)
        • Therefore, there is not solution to System 3.1 under either \((7)\) or \((8)\).
      • Therefore, there is no solution to \((x,y,z)\) in Case 1.
    • Case 2 : When \(y = 2x \ \ (6)\) holds
      • Replace \(y\) with \(2x\) in equations \((3')\) and \((4)\), and we get System 3.2.

        System 3.2:

        \[ (2x - z) (2x)^2 = 4(2x - z)x^2 = 0 \ \ (3''') \]

        \[ -2x(2x) - 2xz - 2xz + 12 = -4x^2 - 4xz + 12 = 0 \ \ (4'') \]

      • Now we just need solve the system 3.2 which contains only \(x\) and \(z\). Again, we use substitution method to solve it.
        • From \((3''')\), we get

          \[ x^2 = 0 \implies x = 0 \ \ (9) \textbf{ OR } 2x - z = 0 \implies z = 2x \ \ (10) \]

          Note that the relationship between \((9)\) and \((10)\) is OR, not AND, so we don't put them simultaneously into equations \((4'')\) in System 3.2. Instead, at each time, we just use one of them. As a result, we need discuss it case by case.

        • Case 2.1 : When \(x = 0 \ \ (9)\) holds

          Replace \(x\) with \(0\) in equation \((4'')\), and we get \(12 = 0\), which never holds, so there is no solution of \(z\) corresponding to \(x = 0\).

          Therefore, there is no solution to \((x,y,z)\) in Case 2.1.

        • Case 2.2 : When \(z = 2x \ \ (10)\) holds
          • Replace \(z\) with \(2x\) in equation \((4'')\), and we get \(-4x^2 - 4x(2x) + 12 = 0\), so

            \[ x = 1 \ \ (11) \textbf{ OR } x = -1 \ \ (12) \]

          • When \(x = 1 \ \ (11)\) holds, by \((10)\) we have \(z = 2x = 2 \cdot 1 = 2\) and by \((6)\) we have \(y = 2x = 2 \cdot 1 = 2\). Therefore, \((x,y,z) = (1, 2, 2)\) gives a relative extremum.
          • When \(x = -1 \ \ (12)\) holds, by \((10)\) we have \(z = 2x = 2 \cdot (-1) = -2\) and by \((6)\) we have \(y = 2x = 2 \cdot (-1) = -2\). Therefore, \((x,y,z) = (-1, -2, -2)\) gives a relative extremum.
          • Therefore, \((x,y,z) = (1,2,2)\) and \((x,y,z) = (-1,-2,-2)\) are the only two points giving relative extrema in Case 2.2.
      • Also, in whole Case 2, \((x,y,z) = (1,2,2)\) and \((x,y,z) = (-1,-2,-2)\) are the only 2 points giving relative extrema as Case 2.1 has no solution.
    • Finally, for the whole problem, \((x,y,z) = (1,2,2)\) and \((x,y,z) = (-1,-2,-2)\) are the only 2 points giving relative extrema as Case 1 has no solution. The values of the two extrema are \(f(1,2,2) = 1\cdot 2\cdot 2 = 4\) and \(f(-1, -2, -2) = (-1) \cdot (-2) \cdot (-2) = -4\).

    Remark: You can use any method to solve these equations. Here I just show you how to apply the subtitution method. It may not be the simplest method, but it always works as far as this course is concerned. Using this "stupid" substitution method sometimes has an advantage: at least you will get the answer even if you are not good at manipulating complicated algebraic operations and tricks.

6 Total Differentials and Approximations

6.1 Total Differential for Two Variables

Let \(z = f(x,y)\) be a function of \(x\) and \(y\). Let \(dx\) and \(dy\) be real numbers. Then the total differential of \(z\) is \[ dz = f_x(x,y) dx + f_y(x,y) dy \]

6.2 Approximations

For small values of \(dx\) and \(dy\), \(dz \approx \Delta z\), where \(\Delta z = f(x+dx, y+dy) - f(x,y)\).

Therefore, the approximation for \(f(x+dx, y+dy)\) is \[ f(x+dx, y+dy) \approx f(x,y) + dz = f(x,y) + f_x(x,y) dx + f_y(x,y) dy \]

6.2.1 Remark

This can be derived as follows. First, we have \(\Delta z \approx dz \ \ (1)\)

\(\Delta z = f(x+dx,y+dy) - f(x,y) \ \ (2)\)

\(dz = f_x(x,y) dx + f_y(x,y) dy \ \ (3)\)

Then putting \((2)\) and \((3)\) into \((1)\) we get

\(f(x+dx,y+dy) - f(x,y) \approx f_x(x,y) dx + f_y(x,y) dy\)

\(\implies f(x+dx,y+dy) \approx f(x,y) + f_x(x,y) dx + f_y(x,y) dy\).

6.3 Example

6.3.1 Example 1

Find the total differential of function \(z = x^2 y\) and compute its values when \((x, y) = (2, 3)\) and \((dx, dy) = (\Delta x, \Delta y) = (0.01, 0.02)\).

Find the partial derivatives

\(f_x(x,y) = \frac{\partial f(x,y)}{\partial x} = \frac{\partial x^2 y}{\partial x} = 2xy\)

\(f_x(x,y) = \frac{\partial f(x,y)}{\partial y} = \frac{\partial x^2 y}{\partial x} = x^2\)

Then the total differential is \(dz = f_x(x,y) dx + f_y(x,y) dy = 2xy dx + x^2 dy\)

When \((x,y) = (2,3)\) and \((dx, dy) = (0.01, 0.02)\), we have \(dz = f_x(x,y) dx + f_y(x,y) dy = 2xy dx + x^2 dy\) \(= 2 \cdot 2 \cdot 3 \cdot 0.01 + 2^2 \cdot 0.02\) \(= 0.2\)

6.3.2 Example 2

Approximate \(2.02^2 \cdot 2.99\).

Let's identify the relevant quantities first:

  • the function is \(f(x,y) = x^2 y\)
  • we want to approximate \(f(2.02, 2.99)\)
  • \((2.02, 2.99)\) is close to \((2, 3)\) and \(f(2,3)\) is easy to compute, so we should approximate \(f(2.02, 2.99)\) by \(f(2,3)\)
  • \(dx = 2.02 - 2 = 0.02\) and \(dy = 2.99 - 3 = -0.01\)

Then calculate

  • \(f_x(x,y) = \frac{\partial x^2 y}{\partial x} = 2xy\)
  • \(f_x(x,y) = \frac{\partial x^2 y}{\partial y} = x^2\)

Therefore, by the formula \(f(x+dx, y+dy) \approx f(x,y) + f_x(x,y) dx + f_y(x,y) dy\), we have

\(f(2.02, 2.99) = f(2+0.02, 3+(-0.01))\)

\(\approx f(2,3) + f_x(2,3) \cdot 0.02 + f_y(2,3) \cdot (-0.01)\)

\(= 2^2 \cdot 3 + 2 \cdot 2 \cdot 3 \cdot 0.02 + 2^2 \cdot (-0.01)\)

\(= 12.2\)

7 Integral Of A Multivariate Function With Respect To One Variable

7.1 Indefinite Integral

To find the indefinite integral of a multivariate function with respect to one variable, we regard all other variables as constants.

7.1.1 Example

Let \(f(x,y) = x^2 + xy + y^3\). Then

\(\int f(x,y) dx = \int (x^2 + xy + y^3) dx = \frac{x^3}{3} + \frac{yx^2}{2} + y^3 x + C(y)\) where \(C(y)\) is any function of \(y\).

\(\int f(x,y) dy = \int (x^2 + xy + y^3) dy = x^2 y + \frac{xy^2}{2} + \frac{y^4}{4} + C(x)\) where \(C(x)\) is any function of \(x\).

7.1.2 Remark

  • \(\int f(x,y) dx \neq \int f(x,y) dy\). That is, the integral of \(f\) with respect to \(x\) is not identical to the integral with respect to \(y\). This is the general situation.
  • As we did for univariate functions, the indefinite integral, as the "most general antiderivative", is a class of antiderivatives rather than a single one. One antiderivative in this class can be represented as another one plus a constant.
  • Here the "constant" means a function that doesn't have the variable with respect to which the integral is defined. That is, it can be a function of the other variables. To find \(\int f(x,y) dx\), we add \(C(y)\) (an arbitrary function of \(y\)) to one specific antiderivative of function \(f(x,y)\) with respect to \(x\) (ie, \(\frac{x^3}{3} + \frac{yx^2}{2} + y^3 x\)), and the result is just the whole family of antiderivatives of \(f(x,y)\) with respect to \(x\). Check it by finding the partial derivative of \(\frac{x^3}{3} + \frac{yx^2}{2} + y^3 x + C(y)\) with respect to \(x\). The similar situation for \(\int f(x,y) dy\), the indefinite integral with respect to \(y\).
  • In \(\int f(x,y) dx\), if we use just a constant number \(C\) instead of \(C(y)\) (an arbitrary function of \(y\)), then the result is still a family of antiderivatives of \(f(x,y)\) with respect to \(x\). However, this family is not "the most general" one – not as general as the one using \(C(y)\) – so it is not the "indefinite integral".

7.2 Definite Integral

As we did for univariate functions, we evaluate definite integrals by the corresponding indefinite integrals through Fundamental Theorem of Calculus.

7.2.1 Example

Let \(f(x,y) = x^2 + xy + y^3\). Then

\(\int_0^1 f(x,y) dx = \int_0^1 (x^2 + xy + y^3) dx\)

\(= \frac{x^3}{3} + \frac{yx^2}{2} + y^3 x + C(y) \big|_0^1\)

\(= \left( \frac{x^3}{3} + \frac{yx^2}{2} + y^3 x + C(y) \right) \big|_{x=1} - \left( \frac{x^3}{3} + \frac{yx^2}{2} + y^3 x + C(y) \right) \big|_{x=0}\)

\(= \left( \frac{1^3}{3} + \frac{y \cdot 1^2}{2} + y^3 \cdot 1 + C(y) \right) - \left( \frac{0^3}{3} + \frac{y \cdot 0^2}{2} + y^3 \cdot 0 + C(y) \right)\)

\(= \frac{1}{3} + \frac{y}{2} + y^3\)

\(\int_0^1 f(x,y) dy = \int_0^1 (x^2 + xy + y^3) dy\)

\(= x^2 y + \frac{xy^2}{2} + \frac{y^4}{4} + C(x) \big|_0^1\)

\(= \left( x^2 y + \frac{xy^2}{2} + \frac{y^4}{4} + C(x) \right) \big|_{y=1} - \left( x^2 y + \frac{xy^2}{2} + \frac{y^4}{4} + C(x) \right) \big|_{y=0}\)

\(= \left( x^2 \cdot 1 + \frac{x \cdot 1^2}{2} + \frac{1^4}{4} + C(x) \right) - \left( x^2 \cdot 0 + \frac{x \cdot 0^2}{2} + \frac{0^4}{4} + C(x) \right)\)

\(= x^2 + \frac{x}{2} + \frac{1}{4}\)

7.2.2 Remark

  • \(\int_0^1 f(x,y) dx \neq \int_0^1 f(x,y) dy\). This is the general situation, as the indefinite integrals \(\int f(x,y) dx \neq \int f(x,y) dy\).
  • \(\int_0^1 f(x,y) dx\) is a function of only \(y\), and \(\int_0^1 f(x,y) dy\) is a function of only \(x\). This is the general situation. When calculating the definite integral with respect to \(x\), we replace \(x\) in the antiderivative with the lower and upper integral limits, so \(x\) is eliminated and the result \(\int_0^1 x^2 + xy + y^3 dx = \frac{1}{3} + \frac{y}{2} + y^3\) contains only \(y\). It can be imagined that if we further find the definite integral of \(\frac{1}{3} + \frac{y}{2} + y^3\) with respect to \(y\) (ie, find \(\int_a^b \frac{1}{3} + \frac{y}{2} + y^3 dy\)), then \(y\) will be also eliminated and we will get a constant number. We will see this in next section "Double Integral".
  • When we evaluate \(\int_0^1 f(x,y) dx\), the definite integral of \(f(x,y)\) with respect to \(x\), \(C(y)\) doesn't play a role because it is eventually cancelled by \(-C(y)\). This is the general case : we don't really need \(C(y)\) for evaluating the definite integral with respect to \(x\), just as we don't need \(C\) for evaluating the univariate definite integral. The similar for the definite integral with respect to \(y\) and \(C(x)\).

8 Double Integral Of A Multivariate Function

8.1 Introduction: Volume of The Solid Under A Surface and Over A Region

For a non-negative function \(f(x,y)\) and a region \(R\), we are interested in the volume of the solid under the graph of \(f\) and over the region \(R\), which can be calculated through Double Integral.

In the following sections, we will see 2 special cases of \(R\):

  • Rectangluar \(R\), or
  • Variable \(R\)

cs8_9.gif

source of picture:
https://www.zweigmedia.com/RealWorld/summarypic/cs8_9.gif

8.2 Double Integral Over A Rectangle Region

8.2.1 Formula

For a non-negative \(f(x,y)\), if \(R = \{ (x,y) : a \le x \le b, c \le y \le d \}\), then the volume of the solid under the graph of \(f\) and over the region \(R\), denoted by either \(\iint_R f(x,y) dy dx\) or \(\iint_R f(x,y) dx dy\), equals either \(\int_a^b \left( \int_c^d f(x,y) dy \right) dx\) or \(\int_c^d \left( \int_a^b f(x,y) dx \right) dy\). That is,

\[ V = \iint_R f(x,y) dy dx = \iint_R f(x,y) dx dy \] \[ = \int_a^b \left( \int_c^d f(x,y) dy \right) dx = \int_c^d \left( \int_a^b f(x,y) dx \right) dy \]

8.2.2 Remark

For rectangular \(R\), we always have \(\int_a^b \left( \int_c^d f(x,y) dy \right) dx = \int_c^d \left( \int_a^b f(x,y) dx \right) dy\), which means the order of the two layers of integrals can be exchanged.

8.2.3 Example

Find the volume of the solid under the graph of the function \(f(x,y) = 6x^2 y + e^{x+2y}\) and over the region \(R = \{ (x, y) | 3 \le x \le 5, 1 \le y \le 2 \}\).

To calculate the volume, we need find either \(\int_3^5 \left( \int_1^2 6x^2 y + e^{x+2y} dy \right) dx\) or \(\int_1^2 \left( \int_3^5 6x^2 y + e^{x+2y} dx \right) dy\).

Let's find \(\int_3^5 \left( \int_1^2 6x^2 y + e^{x+2y} dy \right) dx\) now. You can find \(\int_1^2 \left( \int_3^5 6x^2 y + e^{x+2y} dx \right) dy\) by yourself using similar steps.

First, find the inner integral \(\int_1^2 6x^2 y + e^{x+2y} dy\).

  • Regarding \(x\) as a constant, we get the indefinite integral of \(6x^2 y + e^{x+2y}\) with respect to \(y\)

    \(\int 6x^2 y + e^{x+2y} dy\)

    \(= \int 6x^2 y dy + \int e^{x+2y} dy\)

    \(= 6x^2 \cdot \frac{y^2}{2} + \frac{e^{x+2y}}{2} + C(x)\)

    \(= 3 x^2 y^2 + \frac{e^{x+2y}}{2} + C(x)\)

    Hence, by FTC we get the definite integral \(\int_1^2 6x^2 y + e^{x+2y} dy\)

    \(= \left( 3 x^2 y^2 + \frac{e^{x+2y}}{2} \right) \big|_{y=1}^{y=2}\)

    \(= \left( 3 x^2 \cdot 2^2 + \frac{e^{x + 2 \cdot 2}}{2} \right) - \left( 3 x^2 \cdot 1^2 + \frac{e^{x+2 \cdot 1}}{2} \right)\)

    \(= \left( 12 x^2 + \frac{e^{x + 4}}{2} \right) - \left( 3 x^2 + \frac{e^{x+2}}{2} \right)\)

    \(= 12 x^2 + \frac{e^{x + 4}}{2} - 3 x^2 - \frac{e^{x + 2}}{2}\)

    \(= 9 x^2 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2}\)

Second, find the outer integral \(\int_3^5 \left( 9 x^2 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2} \right) dx\).

  • The indefinite integral

    \(\int \left( 9 x^2 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2} \right) dx\)

    \(= \int 9 x^2 dx + \frac{1}{2} \int e^{x + 4} dx - \frac{1}{2} \int e^{x + 2} dx\)

    \(= 3 x^3 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2} + C\)

  • Hence, by FTC we get the definite integral

    \(\int_3^5 \left( 9 x^2 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2} \right) dx\)

    \(= \left( 3 x^3 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2} \right) \big|_{x=3}^{x=5}\)

    \(= \left( 3 \cdot 5^3 + \frac{e^{5 + 4}}{2} - \frac{e^{5 + 2}}{2} \right) - \left( 3 \cdot 3^3 + \frac{e^{3 + 4}}{2} - \frac{e^{3 + 2}}{2} \right)\)

    \(= 294 + \frac{e^9 - e^7 - e^7 + e^5}{2}\)

    \(= 294 + \frac{e^9 - 2e^7 + e^5}{2}\)

Therefore, we have \(V = \iint_R f(x,y) dy dx = \int_3^5 \left( \int_1^2 6x^2 y + e^{x+2y} dy \right) dx = \int_3^5 \left( 9 x^2 + \frac{e^{x + 4}}{2} - \frac{e^{x + 2}}{2} \right) dx = 294 + \frac{e^9 - 2e^7 + e^5}{2}\)

8.3 Double Integral Over A Variable Region

8.3.1 Formula

  • Case 1 : For a non-negative \(f(x,y)\), if the region \(R = \{ (x,y) : a \le x \le b, g_1(x) \le y \le g_2(x) \}\), then the volume of the solid under the graph of \(f\) and over the region \(R\), denoted by \(\iint_R f(x,y) dy dx\), equals \(\int_a^b \left[ \int_{g_1(x)}^{g_2(x)} f(x,y) dy \right] dx\). That is \[ V = \iint_R f(x,y) dy dx = \int_a^b \left[ \int_{g_1(x)}^{g_2(x)} f(x,y) dy \right] dx \]
  • Case 2 : For a non-negative \(f(x,y)\), if the region \(R = \{ (x,y) : h_1(y) \le x \le h_2(y), c \le y \le d \}\), then the volume of the solid under the graph of \(f\) and over the region \(R\), denoted by \(\iint_R f(x,y) dx dy\), equals \(\int_c^d \left[ \int_{h_1(y)}^{h_2(y)} f(x,y) dx \right] dy\). That is

    \[ V = \iint_R f(x,y) dx dy = \int_c^d \left[ \int_{h_1(y)}^{h_2(y)} f(x,y) dx \right] dy \]

8.3.2 Remark

  • For non-rectangular \(R\), \(\int_a^b \left[ \int_{g_1(x)}^{g_2(x)} f(x,y) dy \right] dx \neq \int_{g_1(x)}^{g_2(x)} \left[ \int_a^b f(x,y) dx \right] dy\), and \(\int_c^d \left[ \int_{h_1(y)}^{h_2(y)} f(x,y) dx \right] dy \neq \int_{h_1(y)}^{h_2(y)} \left[ \int_c^d f(x,y) dx \right] dy\), which means the order of the two layers of integrals can NOT be exchanged.
  • When the integral limits of \(y\) are functions of \(x\), we should first calculate \(\int_{g_1(x)}^{g_2(x)} f(x,y) dy\), and then calculate the integral of the whole \(\int_{g_1(x)}^{g_2(x)} f(x,y) dy\) with respect to \(x\).
  • When the integral limits of \(x\) are functions of \(y\), we should first calculate \(\int_{h_1(y)}^{h_2(y)} f(x,y) dx\), and then calculate the integral of the whole \(\int_{h_1(y)}^{h_2(y)} f(x,y) dx\) with respect to \(y\).
  • For short, always let the inside integral be the one with variable integral limits.

8.3.3 Example

Find the volume of the solid under the graph of the function \(f(x,y) = 6x^2 y + e^{x+2y}\) and over the region \(R = \{ (x, y) | y \le x \le 2y, 1 \le y \le 2 \}\).

Note that here the integral limits of \(x\) are functions of \(y\) and the integral limits of \(y\) are constants, so to calculate the volume, we need first do the integration with respect to \(x\) and then do the integration with respect to \(y\). That is, we need find \(\int_1^2 \left( \int_{y}^{2y} 6x^2 y + e^{x+2y} dx \right) dy\).

First, find the inner integral \(\int_{y}^{2y} 6x^2 y + e^{x+2y} dx\).

  • Regarding \(y\) as a constant, we get the indefinite integral of \(6x^2 y + e^{x+2y}\) with respect to \(x\)

    \(\int 6x^2 y + e^{x+2y} dx\)

    \(= \int 6x^2 y dx + \int e^{x+2y} dx\)

    \(= 6y \cdot \frac{x^3}{3} + e^{x+2y} + C(y)\)

    \(= 2 x^3 y + e^{x+2y} + C(y)\)

  • Hence, by FTC we get the definite integral

    \(\int_{y}^{2y} 6x^2 y + e^{x+2y} dx\)

    \(= ( 2 x^3 y + e^{x+2y} ) \big|_{x = y}^{x = 2y}\)

    \(= ( 2 \cdot (2y)^3 y + e^{2y+2y} ) - ( 2 y^3 y + e^{y+2y} )\)

    \(= ( 16 y^4 + e^{4y} ) - ( 2 y^4 + e^{3y} )\)

    \(= 16 y^4 + e^{4y} - 2 y^4 - e^{3y}\)

    \(= 14 y^4 + e^{4y} - e^{3y}\)

Second, find the outer integral \(\int_1^2 \left( 14 y^4 + e^{4y} - e^{3y} \right) dy\)

  • The indefinite integral

    \(\int 14 y^4 + e^{4y} - e^{3y} dy\)

    \(= \int 14 y^4 dy + \int e^{4y} dy - \int e^{3y} dy\)

    \(= \frac{14y^5}{5} + \frac{e^{4y}}{4} - \frac{e^{3y}}{3} + C\)

  • Hence by FTC we get the definite integral

    \(\int_1^2 14 y^4 + e^{4y} - e^{3y} dx\)

    \(= \left( \frac{14y^5}{5} + \frac{e^{4y}}{4} - \frac{e^{3y}}{3} \right) \big|_{y=1}^{y=2}\)

    \(= \left( \frac{14 \cdot 2^5}{5} + \frac{e^{4 \cdot 2}}{4} - \frac{e^{3 \cdot 2}}{3} \right) - \left( \frac{14 \cdot 1^5}{5} + \frac{e^{4 \cdot 1}}{4} - \frac{e^{3 \cdot 1}}{3} \right)\)

    \(= \left( \frac{448}{5} + \frac{e^{8}}{4} - \frac{e^{6}}{3} \right) - \left( \frac{14}{5} + \frac{e^{4}}{4} - \frac{e^{3}}{3} \right)\)

    \(= \frac{448}{5} + \frac{e^{8}}{4} - \frac{e^{6}}{3} - \frac{14}{5} - \frac{e^{4}}{4} + \frac{e^{3}}{3}\)

    \(= \frac{434}{5} + \frac{e^{8} - e^{4}}{4} - \frac{e^{3} - e^{6}}{3}\)

Therefore, we have \(V = \int_1^2 \left( \int_{y}^{2y} 6x^2 y + e^{x+2y} dx \right) dy = \int_1^2 \left( 14 y^4 + e^{4y} - e^{3y} \right) dy = \frac{434}{5} + \frac{e^{8} - e^{4}}{4} - \frac{e^{3} - e^{6}}{3}\)

9 References

  1. Lial, M. L., Greenwell, R. N., Ritchey, N. P. (2011). Calculus with Applications (10th Edition). Boston, MA : Pearson.

Yunfei Wang

2015-11-04 Wed 21:42