Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 35

Partial Derivatives of Multivariable Functions

Recommended resources

Introduction

In our last lesson, we mastered the product, quotient, and chain rules, which gave us the power to differentiate complex single-variable functions. We saw how these rules allow us to systematically break down functions like or .

However, most interesting real-world systems, especially in AI, aren't described by single-variable functions. A machine learning model's performance, for instance, isn't a function of one variable, but of millions of variables—its weights and biases. To understand how to improve such a model, we need to know how its performance changes when we adjust each of these variables individually.

This brings us to the focus of today's lesson. Our goal is to compute partial derivatives of multivariable functions. You'll discover that this isn't a brand-new type of calculus, but rather a clever application of all the rules you've just learned. We will investigate the theory first, establishing the core idea, and then move on to applying it.


1. The Concept of a Partial Derivative

With a function like , the derivative tells us how the function's output changes as its single input changes. But what about a function with two inputs, like ? How does its output change? The answer depends on whether we are changing , changing , or changing both.

The partial derivative is our tool for handling the simplest case: changing only one variable at a time while holding all others constant.

To build your intuition, let's start with a video that introduces this concept and the new notation you'll be using.

Partial derivatives, introduction

This video from Khan Academy explains the core idea behind partial derivatives. It introduces the notation and uses the analogy of 'nudging' one input variable while keeping the other fixed.

Watch from the beginning until 04:54. Focus on understanding why it's called a 'partial' derivative and how the notation \partial (a curly 'd') distinguishes it from the ordinary derivative 'd'.

As the video explained, the central idea is to simplify the problem. By holding constant, the multivariable function temporarily behaves like a single-variable function of .

We can visualize this beautifully. Imagine a function as a 3D surface. Taking a partial derivative with respect to is like taking a vertical slice of that surface parallel to the x-axis. Along that slice, is constant. The partial derivative is then simply the slope of the curve on that slice.

Visualizing Partial Derivatives
This image from a DeepLearning.AI course shows the function \(f(x, y) = x^2 + y^2\), which forms a 3D bowl shape (a paraboloid). The red curve shows a 'slice' where \(y\) is held constant. The partial derivative with respect to \(x\) at any point on this slice is the slope of the line tangent to this red curve.

Notation and Definition

Formally, the partial derivative of with respect to is defined using a limit, just like in single-variable calculus. Notice how only is changed by .

There are several common notations for partial derivatives of a function . They all mean the same thing.

  • Partial derivative with respect to x: , , ,
  • Partial derivative with respect to y: , , ,

For a more detailed look at the notation and formal definition, you can refer to Paul's Online Math Notes.

Calculus III - Partial Derivatives - Pauls Online Math Notes

This resource provides a clear, text-based explanation of the notation and formal definition, which will solidify the theoretical foundation.

Read the sections that start after the first quick example, beginning with 'Now, as this quick example has shown...' down to just before 'Okay, now let’s work some examples.' Focus on the formal definitions and the table of equivalent notations.


2. The Mechanics of Computation

You now understand the theory: to find a partial derivative, you hold all other variables constant. The practical consequence of this is straightforward:

To compute , treat every occurrence of (and any other variables) as if it were a number, like 5 or . Then, apply all the differentiation rules you already know.

Let's see this in action. This next video is a fantastic resource that walks through numerous examples, from basic polynomials to more complex functions involving exponentials, logs, and trigonometric functions.

Partial Derivatives - Multivariable Calculus

The Organic Chemistry Tutor provides a masterclass in applying the rules. Pay close attention to how he identifies which variable is 'active' and which is 'constant' in each step.

Watch the video from the beginning to 14:52. This covers: Polynomials (00:01 - 05:08): See how terms with only the 'constant' variable differentiate to zero. Exponentials (05:08 - 09:35): Notice the use of the chain rule where the exponent is a function of both variables. Logarithms (09:35 - 14:52): Again, observe the chain rule in action with the U'/U formula.

A Quick Example to Reinforce

Let's do one together. Consider the function .

  1. Find :

    • We are differentiating with respect to .
    • This means we treat as a constant. Therefore, the entire term is just a constant multiplier.
    • The problem is like finding the derivative of , where .
    • The derivative of is .
    • So, .
  2. Find :

    • We are differentiating with respect to .
    • This means we treat as a constant. Therefore, the term is a constant multiplier.
    • We need the derivative of with respect to . This requires the chain rule!
    • Derivative of outer function (): .
    • Derivative of inner function (): .
    • So, the derivative of is .
    • Putting it all together: .

Notice how all the rules from our previous lesson—the power rule, the rule for exponentials, and the chain rule—were used directly.


3. Combining Rules and Extending to More Variables

The true power of this method becomes apparent with more complex functions, where you might need the product or quotient rule. A key skill is identifying when these rules are necessary.

For a function like :

  • When finding , is a constant. No product rule needed.
  • When finding , is a constant. No product rule needed.

But for a function like :

  • When finding , both and contain . You must use the product rule.

The same logic applies to functions of three or more variables, like . To find , you simply treat both and as constants.

Partial Derivatives in Engineering Mathematics

Let's look at a few examples involving more variables and the application of the product and quotient rules in the context of partial differentiation.

Read the sections 'Computing Partial Derivatives' and 'Solved Examples on Partial Derivative'. Focus on the three-variable example f(x,y,z)=e^{xy} \cdot z^3 and the basic two-variable example to see the principle applied again.


Conclusion

In this lesson, we have extended our knowledge of differentiation into the realm of multivariable functions. You've learned that the seemingly complex task of finding a partial derivative simplifies to applying the rules you already know, with the crucial discipline of treating all other variables as constants.

Key Takeaways:

  • A partial derivative measures the rate of change of a multivariable function with respect to one variable, while all other variables are held constant.
  • The notation or denotes the partial derivative of with respect to .
  • The core computational technique is to treat all variables—except the one you are differentiating with respect to—as constants.
  • All your existing rules (Power, Product, Quotient, Chain) apply directly.

Preview of the Next Lesson:
We've learned how to find the rate of change in the x-direction () and the y-direction (). But what if we want to know the direction of the steepest possible uphill slope on our 3D surface? This is a vital question for optimization. In our next lesson, "Explain the concept of a gradient vector and its relation to the direction of steepest ascent," you will learn how to combine all the partial derivatives of a function into a single object called the gradient vector. This vector points in the direction of the fastest increase of the function and is the absolute cornerstone of how we train almost all modern AI models.