Partial Derivatives

Partial Derivatives

Functions of Several Variables #

A function of two variables \(f(x, y)\) is a rule that assigns a unique real number to every pair of real numbers \((x, y)\) in a set \(D\) . The set \(D\) is the domain of \(f\) and the set of values that \(f\) takes on is its range. Expressed mathematically, \(\{f(x, y) | (x, y) \in D\}\) .

We can often use graphs to visualize functions of two variables. If \(f\) is a function of two variables with domain \(D\) , then the graph of \(f\) is the set of all points \((x, y, z)\) in \(\mathbb{R}^3\) such that \(z = f(x, y)\) and \((x, y)\) is in \(D\) .

Another handy visualization technique is a contour map, which draws out various level curves of the function – curves including all \((x, y)\) where \(f(x, y) = k\) for some constant k. It’s a good idea to evenly space out your level curve values.

A function of three variables takes an ordered triple \((x, y, z) \subset \mathbb{R}^3\) and returns a unique real number. These are tough to visualize, since you’re now working in four dimensions, but you can examine the level surfaces of the function, which are like level curves but 3D. They take all \(\{(x, y, z) | f(x, y, z) = k\}\) .

Limits and Continuity #

Let \(f\) be a function of two variables whose domain \(D\) includes points arbitrarily close to \((a, b)\) . The limit of \(f(x, y)\) exists at \(L\) (i.e. \(\lim_{(x, y) \rightarrow (a, b)} f(x, y) = L\) ) if for every number \(\epsilon > 0\) there is a corresponding number \(\delta > 0\) such that if \((x, y) \in D\) and \(0 < \sqrt{(x - a)^2 + (y - b)^2} < \delta\) then \(|f(x, y) - L | < \epsilon\) .

Limits are interesting. For a limit of a multivariable function to exist, it must exist from all approaches and always be the same regardless of the approach. For example, let’s take the function \(\frac{x^2-y^2}{x^2 + y^2}\) and approach its value at the origin from the positive \(x\) -axis and the positive \(y\) -axis.

Approaching from the positive \(x\) -axis, we have:

\[\lim_{(x, 0) \rightarrow (0, 0)} \frac{x^2-y^2}{x^2 + y^2} = \frac{x^2}{x^2} = 1\]

From the positive \(y\) -axis, we end up with:

\[\lim_{(0, y) \rightarrow (0, 0)} \frac{x^2-y^2}{x^2 + y^2} = \frac{-y^2}{y^2} = -1\]

Obviously, those two numbers aren’t the same. Therefore, the limit doesn’t exist.

Here’s your friendly reminder of the properties of limits:

  1. The limit of a sum is the sum of the limits.
  2. The limit of a difference is the difference of the limits.
  3. The limit of a constant times a function is the constant times the limit of the function.
  4. The limit of a product is the product of the limits.
  5. The limit of a quotient is the quotient of the limits (provided that the limit of the denominator is not zero).

Before moving on, let’s generalize the limit definition using vectors: If \(f\) is defined on a subset \(D\) of \(\mathbb{R}^{n}\) , then \(\lim_{\vec{x} \rightarrow \vec{a}} f(\vec{x}) = L\) means that for every number \(\epsilon > 0\) there is a corresponding \(\delta > 0\) such that if \(\vec{x} \in D\) and \(0 < |\vec{x} - \vec{a}| < \delta\) then \(|f(\vec{x}) - L| < \epsilon\) .

From limits, we can progress to the concept of continuity, which essentially boils down to:

\[\lim_{(x, y) \rightarrow (a, b)} f(x, y) = f(a, b)\]

If \(f\) can achieve this for every \((a, b)\) on a domain \(D\) , then \(f\) is continuous on \(D\) .

Partial Derivatives #

Let’s look at the good old derivative. Derivatives don’t really work too well when you try changing multiple things at once. What do you do to solve this? Only change one thing at a time! A partial derivative is the derivative of a function with respect to only one variable, holding all other variables constant.

When calculating a partial derivative, just treat all variables other than the one you’re working with as if they are constant. For example:

\[\frac{\partial}{\partial x} 3x^2y = y \cdot \frac{d}{d x} 3x^2\]

Here are some common partial derivatives:

\[f_x(a, b) = \lim_{h \rightarrow 0} \frac{f(a + h, b) - f(a, b)}{h}\] \[f_y(a, b) = \lim_{h \rightarrow 0} \frac{f(a, b + h) - f(a, b)}{h}\]

Common notation:

\[f_x(x, y) = f_x = \frac{\partial f}{\partial x} = \frac{\partial}{\partial x} f(x, y) = \frac{\partial z}{\partial x} = f_1 = D_1f = D_xf\] \[f_y(x, y) = f_y = \frac{\partial f}{\partial y} = \frac{\partial}{\partial y} f(x, y) = \frac{\partial z}{\partial y} = f_2 = D_2f = D_yf\]

This is pretty straightforward to generalize to three variables:

\[f_z(a, b, c) = \lim_{h \rightarrow 0} \frac{f(a, b, c + h) - f(a, b, c)}{h}\]

To take the second partial derivatives of a function:

\[(f_x)_y = f_{xy} = f_{12} = \frac{\partial}{\partial y}(\frac{\partial f}{\partial x}) = \frac{\partial^2f}{\partial y\partial x} = \frac{\partial^2z}{\partial y\partial x}\]

The order of the variables represents the order of differentiation. In the example above, you differentiate by \(x\) , then by \(y\) .

Clairaut’s Theorem says that if \(f\) is defined on a disk \(D\) and both \(f_{xy}\) and \(f_{yx}\) are continuous on \(D\) , then \(f_{xy}(a, b) = f_{yx}(a, b)\) .

Tangent Planes and Linear Approximations #

You know how, in single-variable calculus, you have a tangent line that just barely touches your equation at a specific point? Yeah, multivariable calculus has the same thing for surfaces, except it’s a whole tangent plane. This next formula is arguably the most important formula in all of multivariable calculus:

\[z - z_0 = f_x(x - x_0) + f_y(y - y_0) + f_z(z - z_0)\]

We can create a function that graphs this tangent plane:

\[L(x, y) = f(a, b) + f_x(a, b)(x - a) + f_y(a, b)(y - b)\]

This is known as the linearization of \(f\) at \((a, b)\) . From there, we can calculate a linear approximation of \(f\) at any \((x, y)\) by plugging its domain into the linearization.

The difference between the linearization and the reference value that the tangent plane is based off of is known as the differential:

\[dz = f_x(x, y)dx + f_y(x, y)dy = \frac{\partial z}{\partial x}dx + \frac{\partial z}{\partial y}dy\]

All of this can be expanded easily to more variables by adding additional similar terms.

The Chain Rule #

Let’s look at the Chain Rule as we currently know it:

\[\frac{dy}{dt} = \frac{dy}{dx} \frac{dx}{dt}\]

where \(y = f(x)\) and \(x = g(t)\) .

If we have \(z = f(x, y)\) , \(x = g(t)\) , and \(y = h(t)\) , then:

\[\frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt}\]

What if the variables in \(z\) are themselves determined by multivariable functions? If we have \(z = f(x, y)\) , \(x = g(s, t)\) , and \(y = h(s, t)\) , then:

\[\frac{dz}{ds} = \frac{\partial z}{\partial x} \frac{\partial x}{\partial s} + \frac{\partial z}{\partial y} \frac{\partial y}{\partial s}\] \[\frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial z}{\partial y} \frac{\partial y}{\partial t}\]

We can use the Chain Rule to help us implicitly differentiate functions. Let’s say \(F(x, y) = 0\) and \(y = f(x)\) . If we want to find \(\frac{dy}{dx}\) :

\[\frac{\partial F}{\partial x} \frac{dx}{dx} + \frac{\partial F}{\partial y} \frac{dy}{dx} = \frac{\partial F}{\partial x} + \frac{\partial F}{\partial y} \frac{dy}{dx} = 0\] \[\frac{\partial F}{\partial y} \frac{dy}{dx} = -\frac{\partial F}{\partial x}\] \[\frac{dy}{dx} = -\frac{\frac{\partial F}{\partial x}}{\frac{\partial F}{\partial y}} = -\frac{F_x}{F_y}\]

Directional Derivatives and the Gradient Vector #

We know how to take a partial derivative with respect to a variable such as \(x\) or \(y\) , but what about if we want to find the derivative in a specific direction? The directional derivative of \(f\) at \((x_0, y_0)\) in the direction of a unit vector \(\vec{u} = \langle a, b \rangle\) is:

\[D_{\vec{u}}f(x_0, y_0) = \lim_{h\rightarrow 0}\frac{f(x_0 + ha, y_0 + hb) - f(x_0, y_0)}{h}\] \[D_{\vec{u}}f(x_0, y_0) = f_x(x_0, y_0)a + f_y(x_0, y_0)b\]

The partial derivatives of \(f\) with respect to \(x\) and \(y\) are just special cases of the directional derivative where \(\vec{u} = \hat{\imath}\) and \(\vec{u} = \hat{\jmath}\) , respectively.

There’s a very useful way to clean up all this notation. The gradient vector of a scalar function is defined as follows:

\[\nabla f = \langle f_x, f_y, f_z \rangle\]

Going back to the directional derivative formula, we can see that it’s just an expanded form of \(\nabla f \cdot \vec{u}\) . Similarly, if we define \(d\vec{r} = \langle x - x_0, y - y_0, z - z_0 \rangle\) , then the differential formula becomes \(df = \nabla f \cdot d\vec{r}\) . The gradient vector is always perpendicular to the level curve or level surface of a function.

Going back to the definition of a dot product, we can determine that \(\nabla f \cdot \vec{u} = |\nabla f| |\vec{u}| \cos\theta = |\nabla f|\cos\theta\) . When \(\theta = 0\) , then the two vectors are pointing in the same direction and \(D_{\vec{u}}f = |\nabla f|\) . This is the maximum possible value of \(D_{\vec{u}}f\) . Conversely, when the vectors point in opposite directions, \(D_{\vec{u}}f = -|\nabla f|\) .

Minimum and Maximum Values #

A function of two variables has a local maximum at \((a, b)\) if \(f(x, y) \leq f(a, b)\) when \((x, y)\) is near \((a, b)\) . It has a local minimum at \((a, b)\) if \(f(x, y) \geq f(a, b)\) when \((x, y)\) is near \((a, b)\) .

If a function \(f\) has a local maximum or minimum at \((a, b)\) and the first-order partial derivatives of \(f\) exist there, then \(f_x = f_y = 0\) at that point.

A point \((a, b)\) is a critical point of \(f\) if \(f_x = f_y = 0\) at that point or one of the two partial derivatives does not exist there. Like single-variable calculus, not all critical points are necessarily maxima or minima. A point that is neither is called a saddle point, since it’s often a minimum in one dimension and a maximum in the other. The Second Derivatives Test to determine maxima and minima is as follows:

\[H(a, b) = \begin{bmatrix} f_{xx} & f_{xy}\\ f_{yx} & f_{yy} \end{bmatrix}\] \[D(a, b) = |H(a, b)| = f_{xx} \cdot f_{yy} - (f_{xy})^2\] \[T(a, b) = f_{xx} + f_{yy}\]

  • If \(D < 0\) , you have a saddle point.
  • If \(D > 0\) and \(T > 0\) , you have a local minimum.
  • If \(D > 0\) and \(T < 0\) , you have a local maximum.
  • If you have none of these, you probably did something wrong.

The absolute minimum and absolute maximum of a function \(f\) over a domain \(D\) can be found by performing the Second Derivatives Test and checking over the boundary of \(D\) as well. Note that \(D\) must be bounded – a finite region – and closed – inclusive of its boundary.

Lagrange Multipliers #

There’s a handy trick for finding the maximum or minimum values of a function subject to a constraint. We want the gradients of both the function and the constraint to point in the same direction. For a function \(f(x, y, z)\) and a constraint \(g(x, y, z)\) :

\[\nabla f(x, y, z) = \lambda \nabla g(x, y, z)\]

where \(\lambda\) is what’s known as a Lagrange multiplier. From here, we solve for potential values of \(x\) or \(y\) , then plug it all back in and find the extremes. This technique helps us limit our search space exclusively to values within the constraint.

What if our constraint is actually defined as the intersection of surfaces \(g\) and \(h\) ? In this scenario, we want the gradient \(\nabla f\) to be in the plane determined by \(\nabla g\) and \(\nabla h\) . Therefore:

\[\nabla f = \lambda \nabla g + \mu \nabla h\]

where \(\lambda\) and \(\mu\) are both Lagrange multipliers.