Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Chapter 3

Partial di↵erentiation

3.1 Introduction to partial di↵erentiation

Many quantities that we measure are functions of two or more variables.


Example 3.1. The temperature T of a rod heated suddenly from time t = 0 at one end.

Figure 3.1: The rod is heated at the end x = 0. Initially, T = 0.

Clearly T depends on:

i The distance x from the heated end

ii The time t after heating commenced.

So we write
T = T (x, t),
i.e. T is a function of the two independent variables: x and t.
Example 3.2. (More abstractly), suppose that a function f is defined as

f (x, y) = x2 + 3y 2 ,

then the value of f is determined by every possible pair (x, y), so if (x, y) = (0, 2) then

f (0, 2) = 02 + 3 ⇥ 22 = 12.

Partial derivatives generalise the derivative to functions of two or more variables.

28
CHAPTER 3. PARTIAL DIFFERENTIATION 29

Definition 3.1. Suppose f is a function of two independent variables x and y, then the
partial derivative of f (x, y) w.r.t x is defined as

@f f (x + x, y) f (x, y)
= fx = lim .
@x x!0 x
Similarly, the partial derivative of f (x, y) w.r.t y is

@f f (x, y + y) f (x, y)
= fy = lim .
@y y!0 y

But. . . there’s a shortcut! If you want fx , say, then just pretend that y is a constant and
di↵erentiate with respect to x only. Similarly, when you want fy , simply pretend that x is
constant and go ahead with di↵erentiating with respect to y only. And yes, this lets you
use (most) of the tricks we have from Chapter 1!

Example 3.3. For the function f defined by

f (x, y) = x2 + 3y 2 ,

find the partial derivative of f w.r.t x by

i Di↵erentiating from first principles:


@f f (x +
x, y) f (x, y)
= lim
@x x!0 x
(x + x)2 + 3y 2 (x2 + 3y 2 )
= lim
x!0 x
2x x + ( x)2
= lim
x!0 x
= 2x.

ii Di↵erentiating w.r.t x, treating y as a constant. Then we can ignore the term 3y 2


because it vanishes, hence we end up with:
@f
= 2x,
@x
as above.

We can also find the partial derivative of f w.r.t y. . .

i Again, we use the definition:


@f f (x, y +
y) f (x, y)
= lim
@y y!0 y
x + 3(y + y)2 (x2 + 3y 2 )
2
= lim
y!0 y
3(2y y + ( y)2 )
= lim
y!0 y
= 6y.
CHAPTER 3. PARTIAL DIFFERENTIATION 30

ii Alternatively, if we di↵erentiate f w.r.t y, treating x as a constant, we see that the


x2 term vanishes, leaving us with
@f
= 6y,
@y
as expected.

Physical Interpretation: Consider the heated rod problem.

Figure 3.2: Plots showing how temperature T varies with respect to t and to x separately.

@T
a In the top graph of Figure 3.2, @t is the rate of change of T with time at a fixed distance x.
@T
b In bottom graph of the same figure, @x is the rate of change of T with distance x at
a particular instance in time.

Example 3.4. Suppose


f (x, y) = y sin x + x cos2 y,
Then for the partial derivative fx
@f
= y cos x + cos2 y
@x
where we treated y as a constant.
Meanwhile,
@f
= sin x + 2x cos y( sin y)
@y
= sin x x sin 2y

where we treated x as a constant.


Example 3.5. Suppose ⇣y⌘
1
f (x, y) = tan
x
then compute fx and fy .

Recall that
d 1 1
tan u =
du 1 + u2
CHAPTER 3. PARTIAL DIFFERENTIATION 31

Therefore, calculating fx (treating y as a constant):


1 @ ⇣y⌘ 1 ⇣ y⌘
fx = y 2 @x x
= 2 ,
1+ x 1 + xy x2
i.e
@f y
= fx = .
@x x + y2
2

Similarly, calculating fy (treating x as a constant):


✓ ◆
1 @ ⇣y⌘ 1 1
fy = y 2 @y x
= 2 ,
1+ x 1 + xy x
i.e
@f x
= fy = 2 .
@y x + y2
Example 3.6 (Exam Question 2008). If a function f (x, y) is defined as
✓ ◆
x
f (x, y) = x ln ,
y
@f @f
then find @x and @y .

Solution: Note that ✓ ◆


x
f (x, y) = x ln = x (ln x ln y) ,
y
so for the x derivative,
✓ ◆
@f 1
= 1 · (ln x ln y) + x 0
@x x
1
= (ln x ln y) + ⇢


x
= ln x ln y + 1
✓ ◆
x
= ln + 1.
y
Meanwhile, for the y derivative
@f @
=0 (x ln y)
@y @y
@
= x (ln y)
@y
x
= .
y
Example 3.7 (Function with three variables). Suppose f (x, y, z) is defined as
f (x, y, z) = zey cos x
then
@f
= zey sin x,
@x
@f
= zey cos x,
@y
@f
= ey cos x.
@y
CHAPTER 3. PARTIAL DIFFERENTIATION 32

3.2 Higher Partial Derivatives

You can di↵erentiate the first partial derivatives again to obtain second partial derivatives.
✓ ◆
@ @f @2f
fxx = =
@x @x @x2
✓ ◆
@ @f @2f
fyy = =
@y @y @y 2
✓ ◆
@ @f @2f
fxy = =
@y @x @y@x
✓ ◆
@ @f @2f
fyx = =
@x @y @x@y
Example 3.8. For the function
✓ ◆
1 x
f = tan ,
y
we are given that
y x
fx = , fy = .
x2 + y 2 x2 + y 2
We calculate fxx by treating y as constant and applying the quotient rule:

@ @ y
fxx = [fx ] =
@x @x x + y 2
2

0 y(2x) 2xy
= 2 2 2
= .
(x + y ) (x + y 2 )2
2

In a similar fashion,

@ @ x
fyy = [fy ] =
@y @y x2 + y 2
0 ( x)(2y) 2xy
= 2 2 2
= 2
(x + y ) (x + y 2 )2
and

@ @ y
fxy = [fx ] =
@y @y x + y 2
2
2 2
(x + y ) y(2y)
=
(x2 + y 2 )2
x2 + y 2 2y 2 x2 y 2
= = .
(x2 + y 2 )2 (x2 + y 2 )2
And finally,

@ @ x
fyx = [fy ] =
@x @x x + y 2
2

(x2 + y 2 )( 1) ( x)(2x)
=
(x2 + y 2 )2
x2 y 2
= = fxy .
(x2 + y 2 )2
CHAPTER 3. PARTIAL DIFFERENTIATION 33

Fact: If fx , fy , fxy and fyx are continuous (i.e. doesn’t ’jump’) at (x, y), then fxy = fyx ,
i.e. fyx = fxy holds for any f .

Example 3.9. Let


f (x, y) = xe2y .

fx = e2y fy = 2xe2y fy = 2xe2y


fxy = 2e2y fyx = 2e2y fyy = 4xe2y
fxyy = 4e2y fyxy = 4e2y fyyx = 4e2y

i.e.
fxyy = fyxy = fyyx
so the order does not matter.

Example 3.10 (Exam Question 2004). a) Verify that f (x, y) = e (1+a2 )x cos ay is a
solution of the equation
@f @2f
= f.
@x @y 2
Solution: First compute the required derivatives
@f (1+a2 )x
= (1 + a2 )e cos ay
@x
@f (1+a2 )x
= ae sin ay
@y
@2f (1+a2 )x
= a2 e cos ay
@y 2

So computing the RHS (right hand side)

RHS = fyy f
2 (1+a2 )x (1+a2 )x
= a e cos ay e cos ay
2 (1+a2 )x
= (1 + a )e cos ay = LHS.

b Let g = yf (xy). Show that


@g @g
y x = g.
@y @x
Solution:
@g
= = f (xy) + yxf 0 (xy),
@y
@g
= y 2 f 0 (xy),
@x
where primes denote di↵erentiation w.r.t the combined variable xy.

Note: To see this, consider


d
(sin 2x) = 2 cos 2x,
dx
CHAPTER 3. PARTIAL DIFFERENTIATION 34

i.e
d
(f (2x)) = 2f 0 (2x).
dx
Also consider
@
(sin xy) = y cos xy,
@x
and therefore
@
(f (xy)) = yf 0 (xy).
@x
Hence returning to the example,
2⇠ ⇠⇠ 2⇠ ⇠⇠ = g(x, y) = RHS,
xy⇠
LHS = yf (xy) + ⇠ f 0 (xy) xy⇠
⇠ f 0 (xy)

as required.

You might also like