Tag

Partial differentiation

Partial derivatives are just a straightforward extension of derivatives as you understand them already. The key difference is that they are derivatives of multivariable functions instead of single-variable functions. Further, when you differentiate with respect to one variable, all other variables are kept constant. If you would like to build a graphical image of what the partial derivative is, well recall that the derivative of a single-variable function is just the gradient of that function. Consequently, it is also the gradient of the tangent line to that function. The partial derivative is similar to that. As when we have a function with more than a single independent variable, we have the freedom to choose which variable or variables we wish to determine our function's gradient with respect to.

If you want to visualize this, imagine a surface defined by z=f(x,y)z=f(x,y) for example. Because a tangent line is two dimensional and we're in three dimensional space, there can be more than one tangent line to a given point. As when constructing the tangent line, we must answer a question: in which direction do we want our line to be tangential to our surface? It could be tangential in the xx direction or the yy direction, or even in any arbitrary direction in the xx-yy plane. If we want the tangent line in the xx direction, we will need the partial derivative with respect to xx to get its gradient, whereas if we want the tangent line in the yy direction, we will need the partial derivative with respect to yy to get its gradient. More generally, for an arbitrary direction in the xx-yy plane we would use the directional derivative as it is called.

Say ff is a function of two variables — xx and yy. Then its partial derivative with respect to xx is formally defined as:

∂f∂x=lim⁡h→0f(x+h,y)−f(x,y)h.\begin{aligned} \dfrac{\partial f}{\partial x} &= \lim_{h\rightarrow 0} \dfrac{f(x+h, y)-f(x, y)}{h}. \end{aligned}

This is analogous to the first principles definition of the derivative you would have learned for standard derivatives. Namely, if we are differentiating f(x)f(x):

dfdx=lim⁡h→0f(x+h)−f(x)h.\begin{aligned} \dfrac{df}{dx} &= \lim_{h\rightarrow 0}\dfrac{f(x+h) - f(x)}{h}. \end{aligned}

The only difference is that now we also have a variable yy that our function f(x,y)f(x,y) depends on, but is kept constant when differentiating with respect to xx. Say f(x,y)=2x2yf(x,y)=2x^2y. Then ∂f∂x\dfrac{\partial f}{\partial x} would be:

∂f∂x=lim⁡h→02(x+h)2y−2x2yh.\begin{aligned} \dfrac{\partial f}{\partial x} &= \lim_{h\rightarrow 0} \dfrac{2(x+h)^2y - 2x^2y}{h}. \end{aligned}

Did you notice that 2y2y is a common factor of both terms in our numerator? Let us take it out of our limit altogether, as it is effectively a constant (it does not depend on hh, after all).

∂f∂x=2ylim⁡h→0(x+h)2−x2h\begin{aligned} \dfrac{\partial f}{\partial x} &= 2y\lim_{h\rightarrow 0} \dfrac{(x+h)^2-x^2}{h} \end{aligned}

Using the binomial theorem, we know that

(x+h)2=x2+2xh+h2.\begin{aligned} (x+h)^2 &= x^2 + 2xh + h^2. \end{aligned}

Hence:

∂f∂x=2ylim⁡h→0x2+2xh+h2−x2h=2ylim⁡h→02xh+h2h=2ylim⁡h→02x+h=2y⋅2x=4xy.\begin{aligned} \dfrac{\partial f}{\partial x} &= 2y\lim_{h\rightarrow 0} \dfrac{x^2+2xh + h^2-x^2}{h} \\ &= 2y\lim_{h\rightarrow 0} \dfrac{2xh + h^2}{h} \\ &= 2y\lim_{h\rightarrow 0} 2x + h \\ &= 2y \cdot 2x \\ &= 4xy. \end{aligned}

Okay, so that is the long way of finding out partial derivatives. Fortunately, there is also a faster way. Which is that we apply normal differentiation rules, but any variable we are not differentiating with respect to is treated like it is a constant. So for f(x,y)=2x2yf(x,y)=2x^2y we would treat the 2y2y as just a constant number and only differentiate the x2x^2. Applying the power rule, we see that ddxx2=2x\dfrac{d}{dx}x^2 = 2x and hence:

∂f∂x=2y⋅2x=4xy.\begin{aligned} \dfrac{\partial f}{\partial x} &= 2y \cdot 2x \\ &= 4xy. \end{aligned}