<<

THE CHAIN RULE IN PARTIAL DIFFERENTIATION

1 Simple chain rule

If u = u(x, y) and the two independent variables x and y are each a of just one other variable t so that x = x(t) and y = y(t), then to find du/dt we write down the differential of u ∂u ∂u δu = δx + δy + .... (1) ∂x ∂y Then taking limits δx 0, δy 0 and δt 0 in the usual way we have → → → du ∂u dx ∂u dy = + . (2) dt ∂x dt ∂y dt Note we only need straight ‘d’s’ in dx/dt and dy/dt because x and y are function of one variable t whereas u is a function of both x and y.

2 Chain rule for two sets of independent variables

If u = u(x, y) and the two independent variables x, y are each a function of two new independent variables s, t then we want relations between their partial .

1. When u = u(x, y), for guidance in working out the chain rule, write down the differential ∂u ∂u δu = δx + δy + ... (3) ∂x ∂y then when x = x(s, t) and y = y(s, t) (which are known functions of s and t), the chain rule for us and ut in terms of ux and uy is ∂u ∂u ∂x ∂u ∂y = + (4) ∂s ∂x ∂s ∂y ∂s ∂u ∂u ∂x ∂u ∂y = + . (5) ∂t ∂x ∂t ∂y ∂t 2. Conversely, when u = u(s, t), for guidance in working out the chain rule write down the differential ∂u ∂u δu = δs + δt + ... (6) ∂s ∂t then when s = s(x, y) and t = t(x, y) (which are known functions of x and y) the chain rule for ux and uy in terms of us and ut is ∂u ∂u ∂s ∂u ∂t = + (7) ∂x ∂s ∂x ∂t ∂x ∂u ∂u ∂s ∂u ∂t = + . (8) ∂y ∂s ∂y ∂t ∂y

1 3. It is important to note that: ∂s = ∂x − etc. Why? Because ∂s means ∂x 6 ∂s ∂x   ∂x differentiating s w.r.t x holding y constant whereas ∂s means differentiating x w.r.t s holding t constant. This is the most commonly made mistake.

1 3 Polar co-ordinates

We want to transform from Cartesian co-ordinates in the two independent variables (x, y) to two new independent variables (r, θ) which are polar co-ordinates. The pair (r, θ) therefore play the role of (s, t) in (4), (5), (7) and (8). The relation between these two sets of variables with x and y expressed in terms of r and θ is

x = r cos θ, y = r sin θ (9) whereas the other way round we have y r2 = x2 + y2, θ = tan 1 . (10) − x From (9) we have ∂x ∂y ∂x ∂y = cos θ, = sin θ, = r sin θ, = r cos θ. (11) ∂r ∂r ∂θ − ∂θ From (10) we have ∂r x ∂r y = = cos θ, = = sin θ, (12) ∂x r ∂y r and1 ∂θ y sin θ ∂θ x cos θ = − = , = = . (13) ∂x x2 + y2 − r ∂y x2 + y2 r Now we are ready to use the chain rule as in (3) and (4): ∂u ∂u ∂x ∂u ∂y ∂u ∂u = + = cos θ + sin θ (14) ∂r ∂x ∂r ∂y ∂r ∂x ∂y and ∂u ∂u ∂x ∂u ∂y ∂u ∂u = + = (r sin θ) + (r cos θ). (15) ∂θ ∂x ∂θ ∂y ∂θ −∂x ∂y

Conversely ∂u ∂u ∂r ∂u ∂θ ∂u ∂u sin θ = + = cos θ (16) ∂x ∂r ∂x ∂θ ∂x ∂r ∂θ r −   and ∂u ∂u ∂r ∂u ∂θ ∂u ∂u cos θ = + = sin θ + . (17) ∂y ∂r ∂y ∂θ ∂y ∂r ∂θ r   ∂ ∂ Exercise: From (16) and (17) we can write the operations ∂x and ∂y as ∂ ∂ sin θ ∂ ∂ ∂ cos θ ∂ = cos θ = sin θ + . (18) ∂x ∂r r ∂θ ∂y ∂r r ∂θ −     ∂ ∂u Use the expression for ∂x on ∂x in (16) to find uxx in terms of urr, urθ, uθθ and ur and uθ. Do the same to find uyy. Then show

∂2u ∂2u ∂2u 1 ∂u 1 ∂2u + = + + . (19) ∂x2 ∂y2 ∂r2 r ∂r r2 ∂θ2

1 ∂r ∂x Note that ∂x = cos θ whereas ∂r = cos θ, illustrating Item 3 at the bottom of the previous page.

2 4 Laplace’s equation: changing from Cartesian to polar co- ordinates

Laplace’s equation (a partial or PDE) in Cartesian co-ordinates is

uxx + uyy = 0. (20) We would like to transform to polar co-ordinates. In the handout on the chain rule (side 2) we found that the x and y-derivatives of u transform into polar co-ordinates in the following way: sin θ cos θ u = (cos θ) u u u = (sin θ) u + u . (21) x r r θ y r r θ −     ∂ Likewise the operation ∂x becomes ∂ ∂ sin θ ∂ = (cos θ) (22) ∂x ∂r r ∂θ −   ∂ and the operation ∂y becomes ∂ ∂ cos θ ∂ = (sin θ) + . (23) ∂y ∂r r ∂θ   Hence ∂u ∂ sin θ ∂ sin θ u = x = (cos θ) (cos θ) u u . (24) xx ∂x ∂r r ∂θ r r θ  −     −  ∂ ∂x from (22) ux from (21)

Now we work this out using| the product{z rule. Remember } | that u{zr and uθ are } functions of both r and θ. We get sin2 θ cos θ sin θ cos θ sin θ sin2 θ u = (cos2 θ)u + u + 2 u 2 u + u . xx rr r r r2 θ r rθ r2 θθ !   −   ! (25) Now we do the same for uyy to get ∂u ∂ cos θ ∂ cos θ u = y = (sin θ) + (sin θ) u + u (26) yy ∂y ∂r r ∂θ r r θ       ∂ ∂y from (23) uy from (21) | {z } | {z } and therefore cos2 θ cos θ sin θ cos θ sin θ cos2 θ u = (sin2 θ)u + u 2 u + 2 u + u . yy rr r r r2 θ r rθ r2 θθ ! −     ! (27) Summing (25) and (27) and remembering that cos2 θ + sin2 θ = 1, we find that 1 1 u + u = u + u + u (28) xx yy rr r r r2 θθ and so Laplace’s equation converts to 1 1 u + u + u = 0. (29) rr r r r2 θθ

3