3. Partial Derivatives

Partial Derivatives

Explores partial derivatives, their geometric interpretation, and how to compute them.

Partial Derivatives

In this lesson, we’ll dive into the world of partial derivatives—a powerful tool for understanding functions of multiple variables. By the end of this lesson, you’ll know how to compute partial derivatives, interpret them geometrically, and apply them to real-world problems. Ready to sharpen your calculus skills, students? Let’s get started! 🎯

What Are Partial Derivatives?

Imagine you’re in a hilly landscape 🌄. At any point, the slope of the hill may change depending on which direction you walk. If you walk east, you might go uphill, but if you walk north, you might go downhill. Partial derivatives give us a way to measure these “directional slopes” for functions with more than one variable.

A partial derivative measures how a multivariable function changes as we vary just one of its variables, while keeping the others fixed. For example, if we have a function $f(x, y)$, the partial derivative with respect to $x$ tells us how $f$ changes if we move a tiny bit in the $x$-direction, keeping $y$ constant.

Real-World Example: Weather Prediction

Let’s think about temperature $T(x, y)$ at a certain location on Earth, where $x$ and $y$ represent geographical coordinates (longitude and latitude). The partial derivative $\frac{\partial T}{\partial x}$ tells us how quickly the temperature changes as we move east or west, while $\frac{\partial T}{\partial y}$ tells us how quickly it changes as we move north or south. Meteorologists use partial derivatives to analyze how temperature and pressure change over regions—key to predicting weather patterns! 🌦️

Computing Partial Derivatives

Now that we understand what partial derivatives represent, let’s learn how to compute them. Think of partial differentiation as focusing on one variable at a time and treating the others as constants.

Single-Variable Review

Before jumping into partial derivatives, let’s recall a key fact from single-variable calculus. If $f(x) = x^2$, then the derivative is $f'(x) = 2x$. This tells us that the slope of $f$ at any point $x$ is $2x$. Now we’ll extend this idea to functions with more than one variable.

Example 1: Partial Derivatives of a Simple Function

Consider the function:

$$f(x, y) = x^2 + 3xy + y^2.$$

We’ll compute the partial derivative with respect to $x$, denoted by $\frac{\partial f}{\partial x}$ or $f_x$.

  1. Treat $y$ as a constant. That means any term involving $y$ alone (like $y^2$) acts just like a constant number would.
  2. Differentiate $f(x, y)$ with respect to $x$.

Let’s break it down term by term:

  • $x^2$ becomes $2x$ (since the derivative of $x^2$ with respect to $x$ is $2x$).
  • $3xy$ becomes $3y$ (since $y$ is treated as a constant, and the derivative of $x$ with respect to $x$ is 1).
  • $y^2$ is treated as a constant, so the derivative of a constant is 0.

Thus, the partial derivative with respect to $x$ is:

$$f_x = 2x + 3y.$$

Now let’s compute the partial derivative with respect to $y$, denoted $\frac{\partial f}{\partial y}$ or $f_y$.

  1. Treat $x$ as a constant.
  2. Differentiate $f(x, y)$ with respect to $y$.

Term by term:

  • $x^2$ is treated as a constant, so its derivative is 0.
  • $3xy$ becomes $3x$ (since $x$ is treated as a constant, and the derivative of $y$ with respect to $y$ is 1).
  • $y^2$ becomes $2y$ (the derivative of $y^2$ with respect to $y$ is $2y$).

Thus, the partial derivative with respect to $y$ is:

$$f_y = 3x + 2y.$$

Great job, students! You’ve just computed your first set of partial derivatives! 🙌

Example 2: Partial Derivatives of a Trigonometric Function

Let’s try another example. Consider:

$$g(x, y) = \sin(xy) + x^2y.$$

We’ll compute $\frac{\partial g}{\partial x}$.

  1. Treat $y$ as a constant.
  2. Differentiate term by term.
  • For $\sin(xy)$: The chain rule applies. The derivative of $\sin(u)$ is $\cos(u)$, and the inner function $u = xy$. So we get:

$$\frac{\partial}{\partial x} \sin(xy) = \cos(xy) \cdot y$$

(since the derivative of $xy$ with respect to $x$ is $y$).

  • For $x^2y$: Treat $y$ as a constant. The derivative of $x^2$ with respect to $x$ is $2x$, so:

$$\frac{\partial}{\partial x} (x^2y) = 2xy.$$

Thus:

$$g_x = y \cos(xy) + 2xy.$$

Now let’s compute $\frac{\partial g}{\partial y}$.

  1. Treat $x$ as a constant.
  2. Differentiate term by term.
  • For $\sin(xy)$: Again, use the chain rule. The derivative of $\sin(u)$ is $\cos(u)$, and the inner function $u = xy$. This time, the derivative of $xy$ with respect to $y$ is $x$. So:

$$\frac{\partial}{\partial y} \sin(xy) = \cos(xy) \cdot x.$$

  • For $x^2y$: Treat $x^2$ as a constant. The derivative of $y$ with respect to $y$ is 1, so:

$$\frac{\partial}{\partial y} (x^2y) = x^2.$$

Thus:

$$g_y = x \cos(xy) + x^2.$$

Notation for Partial Derivatives

There are several notations for partial derivatives. Here are the most common ones:

  • Leibniz notation: $\frac{\partial f}{\partial x}$ and $\frac{\partial f}{\partial y}$
  • Subscript notation: $f_x$ and $f_y$
  • Other variations: $\partial_x f$ or $D_x f$

All of these notations mean the same thing: the rate of change of $f$ with respect to one variable while holding the others constant.

Geometric Interpretation of Partial Derivatives

Partial derivatives have a beautiful geometric interpretation. Let’s explore that next.

Graphs of Functions of Two Variables

When we graph a function of two variables $f(x, y)$, we get a surface in three-dimensional space. Each point $(x, y)$ on the $xy$-plane corresponds to a height $z = f(x, y)$.

The partial derivative $\frac{\partial f}{\partial x}$ tells us the slope of the surface in the $x$-direction. Similarly, $\frac{\partial f}{\partial y}$ tells us the slope in the $y$-direction.

Imagine standing on a hill. If you walk east (along the $x$-axis), the slope of your path is given by $\frac{\partial f}{\partial x}$. If you walk north (along the $y$-axis), the slope is given by $\frac{\partial f}{\partial y}$. Together, these slopes describe how the surface tilts in different directions.

Tangent Planes

Let’s connect partial derivatives to tangent planes. A tangent plane is a flat surface that just touches a curved surface at a single point, like a tangent line touches a curve.

If we know the partial derivatives at a point $(x_0, y_0)$, we can find the equation of the tangent plane to the surface $z = f(x, y)$ at that point.

The equation of the tangent plane is:

$$z = f(x_0, y_0) + f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0).$$

This linear approximation gives us a local picture of the surface. If the partial derivatives are large, the surface is steep in that direction. If they’re small, the surface is flat.

Example: Tangent Plane to a Paraboloid

Consider the function:

$$f(x, y) = x^2 + y^2.$$

At the point $(1, 2)$, let’s find the tangent plane.

  1. Compute the partial derivatives:
  • $f_x = 2x$, so at $(1, 2)$: $f_x(1, 2) = 2 \cdot 1 = 2$.
  • $f_y = 2y$, so at $(1, 2)$: $f_y(1, 2) = 2 \cdot 2 = 4$.
  1. Find the function value at $(1, 2)$:

$$f(1, 2) = 1^2 + 2^2 = 1 + 4 = 5.$$

  1. Plug into the tangent plane formula:

$$z = 5 + 2(x - 1) + 4(y - 2).$$

Simplifying:

$$z = 5 + 2(x - 1) + 4(y - 2) = 5 + 2x - 2 + 4y - 8 = 2x + 4y - 5.$$

This plane gives us a linear approximation of the surface near $(1, 2)$. It tells us that if we move slightly in the $x$-direction, $z$ increases by about $2$ units for each unit step. If we move slightly in the $y$-direction, $z$ increases by about $4$ units for each unit step.

Higher-Order Partial Derivatives

Just as we can take second derivatives in single-variable calculus, we can take higher-order partial derivatives in multivariable calculus.

Second Partial Derivatives

We can take the partial derivative of a partial derivative. For example, if we start with $f_x$, we can differentiate it again with respect to $x$ to get $f_{xx}$, or with respect to $y$ to get $f_{xy}$.

Let’s revisit our earlier function:

$$f(x, y) = x^2 + 3xy + y^2.$$

We already found:

$$f_x = 2x + 3y.$$

Now let’s find $f_{xx}$ and $f_{xy}$.

  • $f_{xx} = \frac{\partial}{\partial x}(2x + 3y) = 2$ (since $3y$ is treated as a constant).
  • $f_{xy} = \frac{\partial}{\partial y}(2x + 3y) = 3$ (since $2x$ is treated as a constant, and the derivative of $3y$ with respect to $y$ is 3).

Similarly, let’s find $f_y$ and then $f_{yy}$ and $f_{yx}$.

We found earlier:

$$f_y = 3x + 2y.$$

  • $f_{yy} = \frac{\partial}{\partial y}(3x + 2y) = 2$ (since $3x$ is treated as a constant).
  • $f_{yx} = \frac{\partial}{\partial x}(3x + 2y) = 3$ (since $2y$ is treated as a constant).

Notice something interesting here: $f_{xy} = f_{yx}$. This is not just a coincidence! Under reasonable conditions (which hold for most functions we encounter), the mixed partial derivatives are equal:

$$f_{xy} = f_{yx}.$$

This is known as Clairaut’s Theorem (or Schwarz’s Theorem).

Example: Second Partial Derivatives of a Trigonometric Function

Let’s find the second partial derivatives of $g(x, y) = \sin(xy) + x^2y$.

We already found:

$$g_x = y \cos(xy) + 2xy.$$

Now let’s find $g_{xx}$ and $g_{xy}$.

  1. For $g_{xx}$:
  • Differentiate $g_x$ with respect to $x$.
  • The derivative of $y \cos(xy)$ with respect to $x$ is $y \cdot (-\sin(xy)) \cdot y = -y^2 \sin(xy)$ (using the chain rule again).
  • The derivative of $2xy$ with respect to $x$ is $2y$.

Thus:

$$g_{xx} = -y^2 \sin(xy) + 2y.$$

  1. For $g_{xy}$:
  • Differentiate $g_x$ with respect to $y$.
  • The derivative of $y \cos(xy)$ with respect to $y$ is $\cos(xy) + y(-\sin(xy)) \cdot x = \cos(xy) - xy \sin(xy)$.
  • The derivative of $2xy$ with respect to $y$ is $2x$.

Thus:

$$g_{xy} = \cos(xy) - xy \sin(xy) + 2x.$$

Similarly, you can find $g_y$ and then $g_{yy}$ and $g_{yx}$, and you’ll find that $g_{xy} = g_{yx}$.

Applications of Partial Derivatives

Partial derivatives are not just a theoretical concept—they have tons of practical applications! Here are a few important ones.

1. Optimization Problems

In many real-world problems, we want to find the maximum or minimum value of a function. For example, a business might want to maximize profit, or a scientist might want to minimize the energy required for a process.

One key tool for finding maxima and minima in multivariable functions is the gradient, which is the vector of all partial derivatives. The gradient is denoted $\nabla f$ and is given by:

$$\nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right).$$

A critical point occurs where the gradient is zero:

$$\nabla f = (0, 0).$$

At these points, the function might have a maximum, minimum, or saddle point. We can use second derivatives (in the form of the Hessian matrix) to classify these points.

2. Economics: Marginal Analysis

In economics, partial derivatives are used to study how economic quantities change. For example, consider a production function $P(L, K)$, where $L$ is labor and $K$ is capital. The partial derivative $\frac{\partial P}{\partial L}$ is called the marginal product of labor—it tells us how much additional output we get if we add one more unit of labor, holding capital constant.

Similarly, $\frac{\partial P}{\partial K}$ is the marginal product of capital. By analyzing these partial derivatives, businesses can make informed decisions about resource allocation.

3. Engineering: Heat Flow

Engineers use partial derivatives to model how heat flows through materials. The heat equation involves second partial derivatives with respect to both space and time. By solving this equation, engineers can predict how temperature will evolve in a system—crucial for designing everything from engines to electronic devices. 🔥

4. Machine Learning: Gradient Descent

In machine learning, we often want to minimize a cost function (also called a loss function), which measures how well a model fits the data. The method of gradient descent uses partial derivatives to iteratively move toward the minimum of the cost function.

Each step in gradient descent moves in the direction opposite to the gradient (since the gradient points in the direction of steepest ascent). By following the negative gradient, the algorithm zeroes in on the optimal solution.

Conclusion

In this lesson, you’ve learned what partial derivatives are, how to compute them, and how to interpret them geometrically. We explored real-world examples, such as weather prediction and economics, where partial derivatives play a vital role. You also saw how second partial derivatives and the gradient help us analyze surfaces and solve optimization problems.

Partial derivatives are a core tool in calculus, and they open the door to understanding more advanced topics like gradients, tangent planes, and optimization. Keep practicing, and you’ll soon master the art of analyzing multivariable functions! 🚀

Study Notes

  • A partial derivative measures how a function changes as one variable changes while holding the others constant.
  • Notation for partial derivatives:
  • $\frac{\partial f}{\partial x}$ or $f_x$ is the partial derivative of $f$ with respect to $x$.
  • $\frac{\partial f}{\partial y}$ or $f_y$ is the partial derivative of $f$ with respect to $y$.
  • To compute a partial derivative, treat all other variables as constants.
  • Example: For $f(x, y) = x^2 + 3xy + y^2$:
  • $f_x = 2x + 3y$
  • $f_y = 3x + 2y$
  • The geometric interpretation: $\frac{\partial f}{\partial x}$ is the slope of the surface in the $x$-direction, and $\frac{\partial f}{\partial y}$ is the slope in the $y$-direction.
  • Tangent plane equation at $(x_0, y_0)$:

$$z = f(x_0, y_0) + f_x(x_0, y_0)(x - x_0) + f_y(x_0, y_0)(y - y_0).$$

  • Second partial derivatives:
  • $f_{xx}$, $f_{yy}$ are second derivatives with respect to one variable.
  • $f_{xy}$, $f_{yx}$ are mixed partial derivatives.
  • Clairaut’s Theorem: $f_{xy} = f_{yx}$ under most reasonable conditions.
  • Gradient: $\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right)$.
  • Applications:
  • Optimization: Find critical points where $\nabla f = (0, 0)$.
  • Economics: Marginal analysis with production functions.
  • Engineering: Heat flow modeled with partial derivatives.
  • Machine Learning: Gradient descent uses partial derivatives to minimize cost functions.

Practice Quiz

5 questions to test your understanding