Basic Partial Derivatives

The basic idea of partial derivatives is to study the rate of change of a function when only one variable in the function is changed, while all others are fixed.

An example here could be a chemical reaction, with a function $f(x)$ defining what percentage of the reactants have turned into the products. In reality, this will be dependent on many things - the time passed since the start of the reaction, the temperature, the pressure, etc. However, we will often fix the temperature and the pressure to be optimal for the reaction taking place, so only one thing is changing - time.

Let’s take an example function:

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

Let’s ask a simple question - what is the rate of change of $f$ with respect to $x$ if $y$ is held constant? To do this, we pretend $y$ is a constant and differentiate solely in terms of $x$!

$$ \frac{\partial f}{\partial x} = 3x^2 + 2y $$

This is the partial derivative of $f$ with respect to $x$. Note that the $y^2$ term just disappears - that’s because it’s a constant, much like the $+3$ at the end! Similarly, we don’t use product rule to differentiate $2xy$, because it’s not a product - it’s a constant $2y$ multiplied by a function $x$ that needs to be differentiated. So, if we say that $y$ is fixed at a value of $2$, the rate of change of $f$ with respect to $x$ is:

$$ \frac{\partial f}{\partial x} = 3x^2 + 2(2) = 3x^2 + 4 $$

We can visualise this as us taking slices of the 3D plot along the line $y=2$, essentially leaving us with a 2D graph that we then differentiate!

But this can go both ways - we can fix $x$ at a value, say $3$, and calculate the rate of change of $f$ with respect to $y$ as $x$ is fixed:

$$ \frac{\partial f}{\partial y} = 2y + 2x $$

The symbol $\partial$ is just said “partial”. $\frac{\partial f}{\partial x}$ means “the rate of change of $f$ as $x$ varies, while $y$ is held fixed”. Often you may see it written as $f_x(x,y)$ as that is more compact.

Higher-Order Partial Derivatives

As with typical differentiation, where $\frac{d^2 y}{dx^2}$ denotes differentiating twice, we can calculate higher-order derivatives by partially differentiating multiple times.

From before, we will say that

$$ \frac{\partial f}{\partial x} = 3x^2 + 2y $$

So we can calulate the second-order partial derivative:

$$ \frac{\partial^2f}{\partial x^2} = \frac{\partial}{\partial x}\left[\frac{\partial f}{\partial x}\right] = \frac{\partial}{\partial x}\left[3x^2+2y\right]=6x $$