Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Engineering Analysis 2 : Multivariate functions
P. Rees, O. Kryvchenkova and P.D. Ledger,
College of Engineering, Swansea University, UK
PDL (CoE) SS 2017 1/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Outline
1 Multivariate functions
2 Partial Differentiation
3 Higher Order Partial Derivatives
4 Total Differentiation
5 Line Integrals
6 Surface Integrals
PDL (CoE) SS 2017 2/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Introduction
Recall from EG189: analysis of a function of single variable: Differentiation d f (x) d x
Expresses the rate of change of a function f with respect to x. Integration Z f (x) d x
Reverses the operation of differentiation and can used to work out areas under curves, and as we have just seen to solve ODEs.
We’ve seen in vectors we often need to deal with physical fields, that depend on more than one variable.
We may be interested in rates of change to each coordinate (e.g. x, y, z), time t, but sometimes also other physical fields as well.
PDL (CoE) SS 2017 3/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Introduction (Continue ...)
Example 1: the area A of a rectangular plate of width x and breadth y can be calculated
A = xy
The variables x and y are independent of each other.
In this case, the dependent variable A is a function of the two independent variables x and y as A = f (x, y) or A ≡ A(x, y)
PDL (CoE) SS 2017 4/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Introduction (Continue ...)
Example 2: the volume of a rectangular plate is given by
V = xyz
where the thickness of the plate is in z-direction.
In this case: V — is the dependent variable x, y, and z — are the independent variables We write V = f (x, y, z) or V ≡ V(x, y, z).
PDL (CoE) SS 2017 5/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Visualisation of Functions of Two and Three Variables
In general a function f can be a function of n independent variables. But, here we restrict ourselves to functions of two or three independent variables.
If n = 2 then we can write
f (x, y)
This is a function of two independent variables x and y. How to visualise such a function: 1. Use level curves which trace in the x, y domain on which the function f (x, y) has a constant value. 2. Plot the points corresponding to (x, y, z) where we choose z = f (x, y) in a rectangular coordinate system. ie the values of z are chosen to be the values of the function for a given x, y (rather than the z coordintates) and are shown as a surface.
PDL (CoE) SS 2017 6/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Visualisation of Functions of Two and Three Variables
Example: We wish to visualise the function
f (x, y) = x2 + y2
Solution: By using MATLAB, we can make a level surface plot and/or a surface plot of this functions as:
10
8
6
4
2
0
−2
−4
−6
−8
−10 −10 −8 −6 −4 −2 0 2 4 6 8 10
(a) The level surface plot (b) The surface plot
PDL (CoE) SS 2017 7/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Outline
1 Multivariate functions
2 Partial Differentiation
3 Higher Order Partial Derivatives
4 Total Differentiation
5 Line Integrals
6 Surface Integrals
PDL (CoE) SS 2017 8/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
1st Semester: the derivative of a function f (x) measures the slope of the tangent to the graph of the function.
If we have a function f (x, y) of two variables, slope has no sense because z = f (x, y) defines a surfaces in 3D. Simplest surface f (x, y) = 0 is flat in both the x and y directions.
1
0.5
0
−0.5
−1 5 5 0 0
−5 −5 Figure: Visualisation surfaces for f (x, y) = 0
PDL (CoE) SS 2017 9/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
Consider f (x, y) = x + 2y i if we move along a line of fixed y and increasing x the slope is equal to 1. ii if we move along a line for which x is fixed and y is increasing then we find that the slope is equal to 2.
Visualisation of surface for f (x, y) = x + 2y
PDL (CoE) SS 2017 10/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
For a general surface the slope will be different depending on which direction we move in.
To find out rates of change for functions of more than 1 variable we need a new kind of derivative —called a partial derivative.
The partial derivative of f (x, y) with respect to x is defined as
f (x + ∆x, y) − f (x, y) lim ∆x→0 ∆x i.e. we differentiate: f (x, y) with respect to x while keeping y constant (fixed). The partial derivative of f (x, y) with respect to x is the same as measuring the slope in the x direction. ∂f or ∂f /∂x or fx ∂x
PDL (CoE) SS 2017 11/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
In writing, care must be taken to distinguish between:
df ∆f ∂f , and dx ∆x ∂x Similarly, the partial derivative of f (x, y) with respect to y is
∂f f (x, y + ∆y) − f (x, y) = lim ∂y ∆x→0 ∆y
Differentiating f (x, y) with respect to y by keeping x constant. This partial derivative is the same as measuring the slope in the y direction.
PDL (CoE) SS 2017 12/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
Directional derivative
∂f ∂f If we know and , we know the surface for any direction. ∂x ∂y
If we define α — an angle to the x axis then the slope is:
∂f ∂f cos α + sin α ∂x ∂y
PDL (CoE) SS 2017 13/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Rules of Partial Differentiation
The rules of partial differentiation are very similar to those of ordinary differentiation Rule 1 (scaler multiplication rule) If k is a constant then ∂ ∂f ∂ ∂f (kf ) = k (kf ) = k ∂x ∂x ∂y ∂y
Rule 2 (sum rule) If u = f (x, y) and v = g(x, y) then
∂ ∂u ∂v ∂ ∂u ∂v (u + v) = + (u + v) = + ∂x ∂x ∂x ∂y ∂y ∂y
Rule 3 (product rule) If u = f (x, y) and v = g(x, y) then
∂ ∂v ∂u ∂ ∂v ∂u (uv) = u + v (uv) = u + v ∂x ∂x ∂x ∂y ∂y ∂y
PDL (CoE) SS 2017 14/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
Example: Given the function f (x, y) = x2y3 + 3y + x, determine its partial derivative with respect to x and y. Hence determine its directional derivative for a direction at angle α = π/4 to the x axis. Solution: To find the partial derivative of f (x, y) with respect to x, we differentiate f (x, y) and keep y constant ∂f = 2xy3 + 1 ∂x The partial derivative of f (x, y) with respect to y, by differentiating f (x, y) while keeping x constant ∂f = 3x2y2 + 3 ∂y The directional derivative is √ 2 (2xy3 + 1) cos α + (3x2y2 + 3) sin α = (2xy3 + 3x2y2 + 4) 2
PDL (CoE) SS 2017 15/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
Example: Given the function f (x, y) = x2y3 + 3y + x, determine its partial derivative with respect to x and y. Hence determine its directional derivative for a direction at angle α = π/4 to the x axis. Solution: To find the partial derivative of f (x, y) with respect to x, we differentiate f (x, y) and keep y constant ∂f = 2xy3 + 1 ∂x The partial derivative of f (x, y) with respect to y, by differentiating f (x, y) while keeping x constant ∂f = 3x2y2 + 3 ∂y The directional derivative is √ 2 (2xy3 + 1) cos α + (3x2y2 + 3) sin α = (2xy3 + 3x2y2 + 4) 2
PDL (CoE) SS 2017 15/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Rules of Partial Differentiation Continued
Rule 4 (quotient rule) If u = f (x, y) and v = g(x, y) then
∂u ∂v ∂u ∂v ∂ u v ∂x − u ∂x ∂ u v ∂y − u ∂y = = ∂x v v2 ∂y v v2
Rule 5 (simple composite–functions or simple chain rule) If u = g(f (x, y)) = g(w) then
∂u dg ∂w ∂u dg ∂w = = ∂x dw ∂x ∂y dw ∂y
we will later extend this concept to where g can not be written just in terms of a single vairable w.
PDL (CoE) SS 2017 16/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Partial Differentiation
Example: Determine ∂f /∂x and ∂f /∂y when f (x, y) is
a) x2y2 + 3xy − x + 2 b) sin(x2 − 3y)
Solution: a) For f (x, y) = x2y2 + 3xy − x + 2 we have
∂f ∂f = 2xy2 + 3y − 1 = 2x2y + 3x ∂x ∂y
b) For f (x, y) = sin(x2 − 3y) = sin w with w = x2 + y2 we have
∂f df ∂w ∂ = = cos(x2 − 3y) (x2 − 3y) = 2x cos(x2 − 3y) ∂x dw ∂x ∂x ∂f = −3 cos(x2 − 3y) ∂y
PDL (CoE) SS 2017 17/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Generalising Partial Differentiation
We’ve already seen partial differentiation applied to functions of two variables.
The concept may be extended to functions of many variables.
For a function f (x1, x2, ··· xn) of n variables, the partial derivative with respect to xi is
∂f = ∂xi f (x , x , ··· , xi + ∆xi, x , ··· , xn) − f (x , x , ··· , xi, x , ··· , xn) lim 1 2 i+1 1 2 i+1 ∆xi→0 ∆xi
Differentiating the function with respect to xi while keeping all other n − 1 variables constant.
PDL (CoE) SS 2017 18/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Generalising Partial Differentiation
Example: Determine ∂f /∂x, ∂f /∂y and ∂f /∂z when
f (x, y, z) = xyz2 + 3xy − z
Solution: We obtain that ∂f = yz2 + 3y ∂x ∂f = xz2 + 3x ∂y ∂f = 2xyz − 1 ∂x
PDL (CoE) SS 2017 19/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Generalising the Chain Rule
We’ve already seen a particular case of the the chain rule in partial differentiation, now lets generalise it.
Let z = g(v, w) and v and w are themselves functions of two independent variables x and y. z is a function of x and y, say G(x, y). We want to differentiate z with respect to x or y ∂z ∂z ∂u ∂z ∂w ∂z ∂z ∂u ∂z ∂w = + = + ∂x ∂v ∂x ∂w ∂x ∂y ∂v ∂y ∂w ∂y In matrix notation ∂z ! ∂v ∂w ! ∂z ∂x ∂x ∂x ∂v ∂z = ∂v ∂w ∂z ∂y ∂y ∂y ∂w This is the chain rule for a function of a two variables.
If z = g(w) and w = f (x, y) this reduces to the simpler case previously presented.
PDL (CoE) SS 2017 20/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Chain RuleI
Example: Find ∂T/∂r and ∂T/∂θ when
T(x, y) = x2 + 2xy + y3x2
and x = r cos θ and y = r sin θ Solution: By the chain rule ∂T ∂T ∂x ∂T ∂y = + ∂r ∂x ∂r ∂y ∂r In this example ∂T ∂T = 2x + 2y + 2xy3 = 2x + 3x2y2 ∂x ∂y and ∂x ∂y = cos θ = sin θ ∂r ∂r so that ∂T = (2x + 2y + 2xy3) cos θ + (2x + 3x2y2) sin θ ∂r = (2r cos θ + 2r sin θ + 2r4 cos θ sin3 θ) cos θ + (2r cos θ + 3r4 cos2 θ sin2 θ) sin θ
PDL (CoE) SS 2017 21/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Chain RuleII
Similarly
∂T = −(2x + 2y + 2xy3)r sin θ + (2x + 3x2y2)r cos θ ∂θ = −(2r cos θ + 2r sin θ + 2r4 cos θ sin3 θ)r sin θ + (2r cos θ + 3r4 cos2 θ sin2 θ)r cos θ
PDL (CoE) SS 2017 22/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Chain RuleI
Example: Find dR/ ds when
R(x, y) = cosh(x2 + 3y)
and x(s) = s2 + 3s and y(s) = sin s. Solution: For this example, x and y are functions of s only so
dR ∂R dx ∂R dy = + ds ∂x ds ∂y ds
which gives
dR = 2x(2s + 3) sinh(x2 + 3y) + 3 cos s sinh(x2 + 3y) ds = 2(s2 + 3s)(2s + 3) sinh((s2 + 3s)2 + 3 sin s) + 3 cos s sinh((s2 + 3s)2 + 3 sin s) = 2(2s3 + 9s2 + 9s) sinh((s2 + 3s)2 + 3 sin s) + 3 cos s sinh((s2 + 3s)2 + 3 sin s)
PDL (CoE) SS 2017 23/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Outline
1 Multivariate functions
2 Partial Differentiation
3 Higher Order Partial Derivatives
4 Total Differentiation
5 Line Integrals
6 Surface Integrals
PDL (CoE) SS 2017 24/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Higher order partial derivatives
∂f ∂f We have considered functions like f (x, y) and found its partial derivatives ∂x and ∂y . If the partial derivatives are also functions of x and y, they can also be differentiated with respect to x and y. We define higher order partial derivatives as follows
∂2f ∂ ∂f = ∂x2 ∂x ∂x ∂2f ∂ ∂f = ∂y2 ∂y ∂y ∂2f ∂ ∂f = ∂x∂y ∂x ∂y ∂2f ∂ ∂f = ∂y∂x ∂y ∂x
PDL (CoE) SS 2017 25/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Higher Order Partial Derivatives
∂f ∂f ∂2f ∂2f If , , and exist and are continuous, then it follows that ∂x ∂y ∂x∂y ∂y∂x
∂2f ∂2f = ∂x∂y ∂y∂x
If the conditions are not fulfilled these so called mixed partial derivatives are not equal. ∂2f ∂2f 6= ∂x∂y ∂y∂x
PDL (CoE) SS 2017 26/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Higher Order Partial DerivativesI
Example: For the function f (x, y) = sin x cos y + x3ey find all the second order partial derivatives.
Solution: First we find the first order partial derivatives
∂f ∂f = cos x cos y + 3x2ey = − sin x sin y + x3ey ∂x ∂y
Then by differentiating these expressions again we can find the second order derivatives
∂2f ∂2f = − sin x cos y + 6xey = − sin x cos y + x3ey ∂x2 ∂y2 ∂2f ∂2f = − cos x sin y + 3x2ey = ∂x∂y ∂y∂x
∂2f ∂2f In this case, we have that = ∂x∂y ∂y∂x
PDL (CoE) SS 2017 27/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Higher Order Partial DerivativesI
Example: Find all second partial derivatives of z = sin(xy).
Solution: First of all the first partial derivatives are found.
∂2z ∂2z = y cos(xy) = x cos(xy) ∂x ∂y Then each of these is differentiated with respect to x:
∂2z ∂ ∂z = = −y2 sin(xy) ∂x2 ∂x ∂x ∂2z ∂ ∂z = = −xy sin(xy) + cos(xy) ∂x∂y ∂x ∂y
Note here the need to use the product rule to differentiate x cos(xy) with respect to x. Also ∂2z ∂ ∂z ∂2z = = −xy sin(xy) + cos(xy) = ∂y∂x ∂y ∂x ∂x∂y ∂2z ∂ ∂z = = −y2 sin(xy) ∂y2 ∂y ∂y
PDL (CoE) SS 2017 28/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Outline
1 Multivariate functions
2 Partial Differentiation
3 Higher Order Partial Derivatives
4 Total Differentiation
5 Line Integrals
6 Surface Integrals
PDL (CoE) SS 2017 29/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total differentiation
Let us define: Function z = f (x, y) — function of two variables x and y. ∆x is a small change in x, ∆y a small change in y and ∆z a small change in z. It follows that ∆z = f (x + ∆x, y + ∆y) − f (x, y)
Rewrite this as the sum of two terms: 1. the first of which shows the change in z due to a change in x 2. the second which shows the change in z due to a change in y
∆z = [f (x + ∆x, y + ∆y) − f (x, y + ∆y)] + [f (x, y + ∆y) − f (x, y)]
PDL (CoE) SS 2017 30/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total Differentiation
Multiply the first term by ∆x/∆x = 1 and the second term by ∆y/∆y = 1
[f (x + ∆x, y + ∆y) − f (x, y + ∆y)] ∆z = ∆x+ ∆x [f (x, y + ∆y) − f (x, y)] + ∆y ∆y
By letting ∆x, ∆y and ∆z → 0, we get
∂f ∂f dz = dx + dy ∂x ∂y
In this expression dx, dy and dz are called differentials.
PDL (CoE) SS 2017 31/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total Differentiation
If z = f (x) so that it is a function of one variable, the formula takes the form
df dz = dx dx
If w = f (x, y, z) is a function of three variables we have
∂f ∂f ∂f dw = dx + dy + dz ∂x ∂y ∂z
We can use differentials to calculate errors. If z = f (x, y) and ∆x and ∆y are errors in x and y, then the error in z is approximately given by
∂f ∂f ∆z ≈ ∆x + ∆y ∂x ∂y
PDL (CoE) SS 2017 32/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total DifferentiationI
Example: We want to estimate p(3.01)2 + (3.97)2
p 2 2 Solution: Let z = f (x, y) = x + y . √ If we set x = 3 and y = 4 we can easily compute z = 32 + 42 = 5. Now p(3.01)2 + (3.97)2 is z when x is increased by ∆x = 0.01 and when y is decreased by 0.03, i.e., ∆y = −0.03
∂f ∂f ∆z ≈ ∆x + ∆y ∂x ∂y 1 1 = 2x(x2 + y2)−1/2∆x + 2y(x2 + y2)−1/2∆y 2 2 x y = ∆x + ∆y px2 + y2 px2 + y2 3 4 = × 0.01 + × (−0.03) = −0.018 5 5
So p(3.01)2 + (3.97)2 ≈ 5 + ∆z = 5 − 0.018 ≈ 4.98.
PDL (CoE) SS 2017 33/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total DifferentiationI
Example: The height of a cylinder is under measured by 3% and the raduis is over measured by 2% we wish to estimate the percentage error in the volume.
Solution: The volume of a cylinder is given by V = πr2h as ∂V ∂V = 2πrh = πr2 ∂r ∂h The error in the volume may be written as ∂V ∂V ∆V ≈ ∆r + ∆h ∂r ∂h = 2πrh∆r + πr2∆h
As we are interested in the percentage error, we divide this by V
2πrh πr2 ∆V ≈ ∆r + ∆h πr2h πr2h 2∆r ∆h = + r h ∆r 2 ∆h 3 ∆V 1 From the question we know that = and = − giving = . This r 100 h 100 V 100 means that the volume is overestimated by 1%.
PDL (CoE) SS 2017 34/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total DifferentiationI
Example: Find the total differential coefficient of
x2y
with respect to x, when x and y are connected by the relation:
x2 + xy + y2 = 1
Solution: Let define u = x2y, then the total differential is
∂u ∂u du = dx + dy ∂x ∂y
Thus the total differential coefficient of u with respect to x is
du ∂u ∂u dy = + dx ∂x ∂y dx du dy = 2xy + x2 dx dx
PDL (CoE) SS 2017 35/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Total DifferentiationII
2 2 ∂f From the implicit relation f = x + xy + y = 1, we first find fx = ∂x = 2x + y and ∂f fy = ∂y = 2y + x and see that f 2x + y x = fy x + 2y but, also using the techniques of implicit differentiation from EG189 we have in this case dy dy dy 2x − y fx 2x + y + x + 2y = 0 = − = − dx dx dx x + 2y fy so that du dy 2x + y = 2xy + x2 = 2xy + x2 − dx dx x + 2y du x2(2x + y) = 2xy − . dx x + 2y
PDL (CoE) SS 2017 36/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Outline
1 Multivariate functions
2 Partial Differentiation
3 Higher Order Partial Derivatives
4 Total Differentiation
5 Line Integrals
6 Surface Integrals
PDL (CoE) SS 2017 37/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Integration
In science and engineering: three types of integrals commonly arsie: line integrals, surface integrals and volume integrals.
Line integrals
Are used for computing induced voltage in a coil, mass of wire, work done by a force moving in a vector field...
The basic form of a line integral is Z f (x, y, z) ds C here s is measured around the contour (possibly a curve or a straight line) C over which the integral is to be performed.
The contour can exist at some arbitrary location in space and rather than integrate than Z b integrate with respect to x as in EG189 in f (x)dx we need to integrate f (x, y, z) with a respect to s along C.
PDL (CoE) SS 2017 38/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals
We don’t usually specify limits for line integrals as the starting and end points for the integral are defined by the choice of contour C, which can be arbitrary:
z
C
y
s
x When performing contour integrals, we are working out the area below the function when restricted to the curve C as illustrated below for the case of f (x, y)
f(x,y)
y Function C
s Contour
x
PDL (CoE) SS 2017 39/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals
p Note that in Cartesian coordinates ds = dx2 + dy2 + dz2 and in two–dimensions this simplifies to
s 2 s 2 p dy dx ds = dx2 + dy2 = + 1dx = 1 + dy dx dy
provided s increases as x (resp. y) increases, with the different arrangements offering advantages for lines aligned with the x or y axes repectively. Example Compute the line integral of f (x, y) = x2 + y along the contour defined by the line y = 2x between the points (−1, −2) and (1, 2). Solution Z Z q f (x, y)ds = x2 + yds ds = (2)2 + 1dx C C since dy/dx = 2. Thus
Z 1 √ √ x3 1 √ x2 + 2x 5dx = 5 + x2 = 2 5 −1 3 −1
PDL (CoE) SS 2017 40/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Working with Parameterisations r dy 2 However, particular care must be exercised with setting ds = dx + 1dx if s r 2 dx increasing as x is decreasing and similarly with ds = 1 + dy dy with s increasing and y decreasing. in such cases we need the negative root
Example R Find C ds for the curve y = x between a line starting at (1, 1) and finishing at (0, 0) Solution √ The solution is just the length of the line between the two points i.e. 2. √ A first approach might be to say dy = dx and so ds = 2dx and since we go from (1, 1) to (0, 0) then to say Z Z 0 √ √ √ 0 ds = 2dx = − 2[x]1 = − 2 C 1 but this has the sign!
The trick√ is to use the negative root (as s is increasing as x is decreasing) so that ds = − 2dx √ Z 2 Z 0 √ Z 1 √ √ √ 1 ds = − 2dx = 2dx = 2[x]0 = 2 0 1 0
PDL (CoE) SS 2017 41/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Working with Parameterisations r dy 2 However, particular care must be exercised with setting ds = dx + 1dx if s r 2 dx increasing as x is decreasing and similarly with ds = 1 + dy dy with s increasing and y decreasing. in such cases we need the negative root
Example R Find C ds for the curve y = x between a line starting at (1, 1) and finishing at (0, 0) Solution √ The solution is just the length of the line between the two points i.e. 2. √ A first approach might be to say dy = dx and so ds = 2dx and since we go from (1, 1) to (0, 0) then to say Z Z 0 √ √ √ 0 ds = 2dx = − 2[x]1 = − 2 C 1 but this has the sign!
The trick√ is to use the negative root (as s is increasing as x is decreasing) so that ds = − 2dx √ Z 2 Z 0 √ Z 1 √ √ √ 1 ds = − 2dx = 2dx = 2[x]0 = 2 0 1 0
PDL (CoE) SS 2017 41/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals R Example: Evaluate C xy ds from (1, 0) to (0, 1) along the curve C that is the portion of x2 + y2 = 1 in the first quadrant. y (0,1) C
(1,0) x
Solution: dy dy x By implicit differentiation 2x + 2y = 0 so = − . Thus dx dx y s s x2 1 ds = − + 1dx = − dx y2 1 − x2
since s is increasing as x is decreasing. If we integrate wrt s we go from (1, 0) to (0, 1) thus s 1 Z (0,1) Z 0 p 1 Z 1 x2 1 xy ds = − x 1 − x2 dx = xdx = = 2 (1,0) 1 1 − x 0 2 0 2
PDL (CoE) SS 2017 42/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals R Example: Evaluate C xy ds from (1, 0) to (0, 1) along the curve C that is the portion of x2 + y2 = 1 in the first quadrant. y (0,1) C
(1,0) x
Solution: dy dy x By implicit differentiation 2x + 2y = 0 so = − . Thus dx dx y s s x2 1 ds = − + 1dx = − dx y2 1 − x2
since s is increasing as x is decreasing. If we integrate wrt s we go from (1, 0) to (0, 1) thus s 1 Z (0,1) Z 0 p 1 Z 1 x2 1 xy ds = − x 1 − x2 dx = xdx = = 2 (1,0) 1 1 − x 0 2 0 2
PDL (CoE) SS 2017 42/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals
Example: Evaluate the integral Z I = [(x2 + 2y) ds + (x + y2) ds] C from (0, 1) to (2, 3) along the curve C defined by y = x + 1 Solution: √ Since y = x + 1 then dy = dx and ds = 2dx since in this case as s is increasing x is increasing.
Z 2 √ I = [(x2 + 2(x + 1)) + (x + (x + 1)2)] 2dx 0 √ √ Z 2 √ 2 5 2 64 2 = 2 (2x2 + 5x + 3) dx = 2 x3 + x2 + 3x = 0 3 2 0 3
PDL (CoE) SS 2017 43/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals
Example: Evaluate the integral Z I = [(x2 + 2y) ds + (x + y2) ds] C from (0, 1) to (2, 3) along the curve C defined by y = x + 1 Solution: √ Since y = x + 1 then dy = dx and ds = 2dx since in this case as s is increasing x is increasing.
Z 2 √ I = [(x2 + 2(x + 1)) + (x + (x + 1)2)] 2dx 0 √ √ Z 2 √ 2 5 2 64 2 = 2 (2x2 + 5x + 3) dx = 2 x3 + x2 + 3x = 0 3 2 0 3
PDL (CoE) SS 2017 43/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals
R We’ve already seen line integrals in the form C f (x, y) ds for Cartesian coordinates. Other forms include:
r 2 r 2 dy dx ds = 1 + dx dx = 1 + dy dy in 2D Cartesian form
r 2 2 dx dy ds = dt + dt dt in 2D parametric form
r 2 2 dr ds = r + dθ dθ in 2D polar form (z constant) If a line integral is such that the integration is performed around a closed (simple) H curve, then we denote this type of integral by C ds — is evaluated by travelling around C in an anticlockwise direction.
Another form found when dealing with vector fields e.g. F(x, y, z) is the line integral R R C F · ds = C F · τ ds where ds ≡ τ ds and τ is a unit tangent to C whose orientation changes with position.
PDL (CoE) SS 2017 44/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals
Example: Evaluate Z (z + x2 − 2y)ds C along the curve C which is specified parametrically as x = t2, y = t2 and z = 2t2 from (0, 0, 0) to (1, 1, 2). Solution: On the curve C, we generalise ds to s dx 2 dy 2 dz 2 p √ ds = + + dt = 4t2 + 4t2 + 16t2dt = 24tdt dt dt dt
since dx = 2tdt, dy = 2t dt and dz = 4t dt. Also at the point (0, 0, 0) t = 0 and at the point (1, 1, 2) t = 1. In this case as s is increasing as t increasing and so the positive root is correct. Z √ Z 1 (z + x2 − 2y)ds = 24 (2t2 + t4 − 2t2 )tdt C 0 √ Z 1 = 24 t5 dt 0 √ √ t6 1 24 = 24 = 6 0 6
PDL (CoE) SS 2017 45/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line IntegralsI
I ds Example: Evaluate the integral p where C is the unit square with vertices C x2 + y2 (1, 1), (−1, 1), (−1, −1), (1, −1).
y (−1,1) (1,1) B A
x DE (−1,−1) (1,−1)
PDL (CoE) SS 2017 46/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line IntegralsII
Solution: We can break the integral into four parts I Z Z Z Z f (x, y)ds = f (x, y)ds + f (x, y)ds + f (x, y)ds + f (x, y)ds C CAB CBD CDE CEA and use the parameterisation approach: 1 1 Along CAB y = 1 and x(t) = 2 (1 − t) − 2 (1 + t) = −t, −1 ≤ t ≤ 1 dx dy q = −1, = 0, ds = (−1)2 + 02dt = dt dt dt
Z ds Z 1 dt √ = √ 2 2 CAB x + 1 −1 t + 1
Along CBD x = −1 and y(t) = −t, −1 ≤ t ≤ 1
Z ds Z 1 dt = √ p 2 2 CBD y + 1 −1 t + 1
Along CDE y = −1 and x(t) = t, −1 ≤ t ≤ 1
Z ds Z 1 dt √ = √ 2 2 CDE x + 1 −1 t + 1 PDL (CoE) SS 2017 47/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Line Integrals III
Along CEA x = 1 and y(t) = t, −1 ≤ t ≤ 1
Z ds Z 1 dt = √ p 2 2 CEA y + 1 −1 t + 1
Note that each part the pameterisation t increases as s increases. Thus the integral becomes
I Z 1 1 ds dt h −1 i p = 4 √ = 4 sinh t C x2 + y2 −1 1 + t2 −1 = 8 sinh−1 1
PDL (CoE) SS 2017 48/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Outline
1 Multivariate functions
2 Partial Differentiation
3 Higher Order Partial Derivatives
4 Total Differentiation
5 Line Integrals
6 Surface Integrals
PDL (CoE) SS 2017 49/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Surface Integrals
Z b Recall f (x)dx is equal to the area under the curve f (x) between x = a and x = b a
f(x)
* f(x r )
x x* 0 x0 x1 r−1 r xr xn x a b
Figure: Integral of a function of a single variable
PDL (CoE) SS 2017 50/ 67 Multivariate functions Partial Differentiation Higher Order Partial Derivatives Total Differentiation Line Integrals Surface Integrals
Surface integrals
We would like have integrals of functions of more than one variable. Let’s consider z = f (x, y) and a region R of the xy plane:
z
y