Multivariable Functions Functions of Two Variables: z = f (x, y ) Understanding the concept of a function of two variables simply requires an understanding of the concept of a function of a single variable. Consider the single variable function y = f (x). ◼ x is the independent variable; y is the dependent variable. ◼ A function f (x) is a rule that gives a unique value y for a given value of x. ◼ The domain of f is the set of all input numbers x. ◼ The range of f is the set of all output numbers y. ◼ If the domain is not explicitly specified, it is taken to be the largest possible set of real numbers. ◼ In general, if the domain is given by the set X and the range by the set Y , we may summarise the action of the function by f : X → Y . Suppose that the domain and range each comprise a set of real numbers. We may write f : → as a way of stating that the function f maps a subset of real numbers onto a subset of real numbers; f is referred to as a real-valued function. Which of the following graphs would you consider a function? The same ideas are transferable to a function of two variables; e.g. z = f (x, y). For any (x, y) combination, the value of the function z is unique. Here the domain is twodimensional and the range is one-dimensional. In particular, f : 2 → states that f is a real valued function of two variables where the domain may be a subset of 2 ≡ × and the range may be a subset of . How do we graph a function of two variables? We’ll look at this in more details in the sections to come. For now we’ll consider the domain and range. 2 KMA252 Multivariable Functions.nb Example Find the domain and range of the function z = f (x, y) = 16 - x2 - 4 y2 . The domain is restricted by the necessity to have 16 - x2 - 4 y2 ⩾ 0 ⇒ x2 + 4 y2 ⩽ 16. In standard notation this can be written (x-0)2 42 + (y-0)2 22 ⩽ 1, which describes an elliptic disk centred at the origin with semi-axis lengths of 4 and 2 in the x and y directions respectively. Using set notation we may state the domain as = (x, y) ∈ 2 x2 + 4 y2 ⩽ 16. To z= compute the range we 16 - x2 - 4 y2 = may find it 12 16 convenient to let α = x2 + 4 y2 . Then 16 - α , and its graph for α ∈ [0, 16] clearly shows a range of [0, 4]. z 4 3 2 1 4 8 α Using set notation we may state the range as ℛ = {z ∈ 0 ⩽ z ⩽ 4}. But what does the graph of f look like? We do not know yet; all we know is that the graph will be restricted to x2 + 4 y2 ⩽ 16 and 0 ⩽ z ⩽ 4. We will look at its 3 dimensional representation in an upcoming section. 3D Cartesian Coordinates A function of two variables z = f (x, y) can be visualised by plotting the ordinate (value of the dependent variable, z) at the locations of the abscissae (values of the two independent variables, KMA252 Multivariable Functions.nb 3 (x, y)). The most common coordinate system in use is the cartesian or rectangular coordinate system. It has three axes (x, y, z) that are mutually perpendicular, with their relative orientations following the right hand rule. The function z = f (x, y) will map out some sort of surface where, in units of the z-axis, z is the height of the function above the xy-plane. Of course, it is not essential for x and y to be the independent variables and z to the dependent variable. Depending on the problem or function under investigation, y and z could be the independent variables, and x could be the dependent one: x = g(y, z); or time and displacement might be independent and momentum dependent. In this course we will also explore the 3D cylindrical and spherical coordinate systems. Drawing the surface is not always easy, but can be made easier with the help of computer packages such as Matlab and Mathematica. There are, however, some simple special cases. Planes Parallel to Axis Planes The equation representing a plane parallel to an axis plane can be recognised by the absence of two variables, with the remaining variable equal to a constant. The plane extends to ±∞ in the direction of the absent variables; e.g. the surface describing z = f (x, y) = p, p ∈ is a plane for which z = p ∀ x, y. 4 KMA252 Multivariable Functions.nb Note that a straight line results from the intersection of two planes and a point results from the intersection of three planes. Surfaces whose equation has a variable missing The equation representing a cylinder can be recognised by the absence of a single variable. The cylinder extends to ±∞ in the direction of the absent variable. For example, in 2D z = x2 is a parabola in the x z plane. In 3D, z = f (x, y) = x2 is a parabolic cylinder extending in the y direction. Axi-symmetric surfaces (surfaces of revolution) Axi-symmetric surfaces are characterised by a circle or ellipse relationship embedded within the function definition. Recall the general form of an ellipse centred at (x0 , y0 ) with semi-axis lengths a, b in the x, y directions respectively: (x-x0 )2 a2 + (y-y0 )2 b2 = 1. KMA252 Multivariable Functions.nb 5 Note: A circle of radius R is a special case of an ellipse with a = b = R. The particular symmetry relationship is sometimes written into the function definition. For example, writing z = f 2 x2 + 3 y2 indicates that this function has elliptic symmetry about the z axis. Example Sketch the function defined by z = f (x, y) = x2 + y2 + π. Firstly, we recognise a circle relationship in the definition so the surface must have circular symmetry. Using cylindrical polar coodinates x = ρ cos(ϕ), y = ρ sin(ϕ), the relationship can be reduced to x2 + y2 + π = ρ2 cos2 (ϕ) + ρ2 sin2 (ϕ) + π = ρ2 + π . This reduced variable definition can be plotted in 2D and the 3D surface obtained by wrapping the space curve about the z-axis. Note that the symmetry of the function might not be obvious in the graph if a poor plotting regime is chosen. Cross-Sections and Contours In the previous section we considered the special planar surfaces x = k, y = m, z = p with k, m, p ∈ . When plotted together we noted that an orthogonal collection of surfaces was formed and that where two of these planar surfaces intersected, a space curve was formed - in this case a straight line. We can use this concept of taking a special planar surface and intersecting it with a surface z = f (x, y) to produce a space curve. This is equivalent to holding one of x, y, z constant and finding the relationship between the remaining variables. When one of the independent variables (x or y) is held constant the resultant space curve is called a cross-section. When the dependent variable (z) is held constant the resultant space 6 KMA252 Multivariable Functions.nb curve is called a contour or level-curve. Cross-Sections Example Find cross-sections of z = f (x, y) = 16 - x2 - 4 y2 . We will, in turn, hold one of the independent variables constant and interrogate the behaviour of f as a function of a single variable. Holding x constant, x = 0, z= x = ±1, z = x = ±4, -2 ⩽ y ⩽ 2 12 - 4 y2 , - 12 2 15 - 4 y2 , - x = ±2, z = x = ±3, 16 - 4 y2 , z= z= 7 - 4 y2 , -4 y2 , 15 2 - 7 2 ⩽ y⩽ 15 2 ⩽ y⩽ 7 2 ⩽ y⩽ y = 0. 12 2 Cross-sections for constant x z 4 3 2 1 -2 -1 Holding y constant: y = 0, z= y = ± 1, z = y = ±1, z = 2 y = ± 3, y = ±2, 2 z= z= 16 - x2 , 1 2 y -4 ⩽ x ⩽ 4 15 - x2 , - 15 ⩽ x ⩽ 12 - x2 , - 12 ⩽ x ⩽ 7 - x2 , -4 x2 , - 7 ⩽x⩽ x = 0. 15 12 7 KMA252 Multivariable Functions.nb 7 Cross-sections for constant y z 4 3 2 1 -4 -2 2 4 x Mathematical software such as Matlab, Mathematica, and Maple use cross-sections when drawing surfaces, as we shall see. In the graphs above we have sampled at regular spacings of x = -4 + k and y = -2 + k ∈ 0, 1, ..., 8. k 2 for If an irregularly spaced sampling was chosen, such as x = ± 15 , ± 12 , ± 7 , 0 and y = ± 15 2 ,± 12 2 ,± 7 2 , 0 the graphs instead would have looked like z -2 -1 z 4 4 3 3 2 2 1 1 1 -4 y 2 -2 2 4 x Without knowledge of the sampling regime, cross-sections can produce misleading interpretations of the shape of the 3D surface. The default regime is to to use regular spacing. Example Find the family of cross-sections of z = f (x, y) = 16 - x2 - 4 y2 . In the previous example we created cross-sections for particular values of the independent variables. This time we want to find the general description for the cross-sections. Letting x = c, c ∈ ⇒ ⇒ z2 ⇒ 2 16-c2 z= + 16 - c2 - 4 y2 z2 = 16 - c2 - 4 y2 z2 + 4 y2 = 16 - c2 y2 1 2 2 16-c2 = 1. - (1) - (2) Equation (2) describes a family of ellipses in planes parallel to the y z-plane, centred at (y0 , z0 ) = (0, 0), with semi-axis lengths of 16 - c2 and 1 2 16 - c2 in the z and y directions 8 KMA252 Multivariable Functions.nb - respectively. The ellipses exist for 16 - c2 > 0 ⇒ c ϵ (-4, 4). For c = ±4 we must return to equation (1). The only solution to z2 + 4 y2 = 0 is the simultaneous solution z = 0, y = 0. 2 Lastly, we recall that the range of f is [0, 4] so the only part of the ellipses described by (2) that we require are those for which z ⩾ 0. The parametric definitions z(t) = y(t) = 1 2 16 - c2 sin(t) 16 - c2 cos(t) t ϵ [0, π] will trace out the cross-sections accordingly. Exercise: repeat the process for y = k, k ϵ and show that z(t) = 16 - 4 k 2 sin(t) x(t) = 16 - 4 k 2 cos(t) t ϵ [0, π] parametrises the semi-circular cross-sections for k ϵ [-2, 2]. Contours and Level-Curves Contour diagrams are used in a multitude of ways; e.g. regional maps giving accumulated rainfall contours, pressure contours (isobars) on weather maps, and height contours on topographical maps. Such contour diagrams are based on observations so a relationship between the independent variables might be difficult to determine. Contours of a surface z = f (x, y) can not cross - why not? Example Find the family of contours of z = f (x, y) = 16 - x2 - 4 y2 . This definition is already a description for the family of contours but aesthetically it’s unappealing. Letting z = m, m ⩾ 0, ⇒ ⇒ x2 ⇒ 2 16-m2 m= + 16 - x2 - 4 y2 m2 = 16 - x2 - 4 y2 x2 + 4 y2 = 16 - m2 y2 1 2 2 16-m2 = 1. - (3) - (4) Equations (3) and (4) are equivalent to the cross-sections equations (1) and (2) but the domain of x and y now permits full ellipses rather than half ellipses. For m ϵ [0, 4), x(t) = y(t) = 1 2 16 - m2 sin(t) 16 - m2 cos(t) t ϵ [0, 2 π) KMA252 Multivariable Functions.nb 9 will parametrically define the family of level curves. Note that the parametrisation is also valid for m ∈ [0, 4]. Surfaces from Cross-Sections and Contours The collection of cross-sections and contours can be used to interpret the graph of the function z = f (x, y). Example Use the cross-sections and contours of z = f (x, y) = function. 16 - x2 - 4 y2 to draw a graph of the So far, our analysis has shown that we have elliptic cross-sections for constant x, circular (elliptic) cross-sections for constant y, and elliptic contours for constant z. This triumvirate of ellipses means that the resulting surface is an ellipsoid. With the range restriction the surface is in fact the half of the ellipsoid restricted to the closed upper half-space (z ⩾ 0). The left panel above shows our collection of cross-sections and contours and the right panel shows Mathematica’s default graph of the function. Note that Mathematica constructs its mesh from cross-sections and then interpolates the surface behaviour in between. To finish off, this last collection of figures shows the surface intersecting with the our special planes. 10 KMA252 Multivariable Functions.nb Example Find level curves of z = f (x, y) = exp- x2 - y2 + 2 x + 4 y - 3. We start by simplifying the argument of the exponential function by completing the square. - x2 - y2 + 2 x + 4 y - 3 = -x2 - 2 x + 1 - 1 - y2 - 4 y + 4 - 4 - 3 = -(x - 1)2 + 1 - (y - 2)2 + 4 - 3 So the surface can be written = -(x - 1)2 - (y - 2)2 + 2. z = exp-(x - 1)2 - (y - 2)2 + 2 = e2 e-(x-1) 2 +(y-2)2 . We recognise circular symmetry in the relationship involving the independent variables. Letting z = c, c ∈ ⇒ c = exp-(x - 1)2 - (y - 2)2 + 2 ln(c) = -(x - 1)2 - (y - 2)2 + 2 ⇒ (x - 1)2 + (y - 2)2 = 2 - ln(c). The family of contours are circles centred at (x0 , y0 ) = (1, 2) with radius range of f requires 2 - ln(c) ⩾ 0 ⇒ c ∈ 0, e2 . 2 - ln(c) . The KMA252 Multivariable Functions.nb 11 The 3 surfaces in the row of figures above depict the same function but are constructed in different ways. The leftmost figure uses cross-sections in x and y, the centre figure uses polar coordinates centred at the origin, and the rightmost figure exploits the circular symmetry centred at (1, 2). Even and Odd Symmetry When dealing with a function of a single variable, an even function exists if f (- x) = f (x) and an odd function exists if f (- x) = - f (x). When dealing with a function of two variables we may be able to determine the general shape of a surface by looking for symmetry relationships between the variables. Example Interrogate z = f (x, y) = x2 - y2 . Holding x constant we see that z ∝ - y2 ; i.e. an even relationship. Holding y constant we see that z ∝ x2 ; i.e. an even relationship. Even behaviour in both the x and y directions means that f (- x, - y) = f (- x, y) = f (x, - y) = f (x, y). We note that the cross-sectional relationship is parabolic in both cases. z -2 -1 z 4 4 2 2 -2 -4 1 2 y -2 -1 -2 -4 1 2 y Holding z constant we are left with a relationship in x and y that is hyperbolic. Letting z = c, c∈ 12 KMA252 Multivariable Functions.nb ⇒ (x-0)2 c 2 c = x2 - y2 - y = ±x (y-0)2 -c 2 (y-0)2 c 2 - =1 (x-0)2 -c 2 c>0 c=0 =1 c<0 The family of contours are hyperbolae opening in the ± x direction (c > 0), hyperbolae opening in the ± y direction (c < 0), and straight lines (asymptotes of the hyperbolae) for c = 0. Combining the cross-sections and contours to graph the surface results in the leftmost panel below. The surface is called a hyperbolic paraboloid (hyperbolic in x and y, parabolic in x and z, and parabolic in y and z). It is informally known as a saddle function. The middle panel shows the same surface but graphed using a polar parametrisation. The rightmost panel is an overlay of the two figures, confirming they are the same. The parametrisation used to produce the polar plot is x = ρ cos(ϕ) y = ρ sin(ϕ) z= ρ2 cos(2 ϕ) ρ ϵ [0, ∞) ϕ ϵ [0, 2 π) . KMA252 Multivariable Functions.nb 13 Linear Functions A function of two variables z = f (x, y) is linear if it has the form z = f (x, y) = m x + n y + c, m, n, c ϵ . All cross-sections and contours are linear and a graph of the function is a plane. constant x constant y z constant z y z y x x Much of the advanced analysis we will do on general functions during this course will actually be done on a linear function which approximates that function in the neighbourhood of a point. Linear functions are also useful in providing first-order solutions to boundary value problems (partial differential equations with boundary conditions). Example Suppose we have a square room 10m10m with a heater in one corner and exits in two corners, as in the diagram below. exit 2 exit 1 heater The temperature on the front face increases by Where is the temperature less than 18∘ C ? 1 ∘ C/m 2 and the temperature at both exits is 15∘ C. Assuming a linear model, let temperature T(x, y) = m x + n y + c. The origin is taken to be in the lower left corner (exit 1) with x increasing horizontally and y increasing vertically in the 14 KMA252 Multivariable Functions.nb diagram above. ◼ temperature at exit 1 = 15∘ C ⇒ T(0, 0) = 15 = c. ∴ T(x, y) = m x + n y + 15. ◼ temperature on the front face increases by 1 ∘ C/m. 2 On the front face we are assessing the cross-section at y = 0; i.e T(x, 0) = m x + 15 ⇒ m = 1 . ∴ T(x, y) = ◼ temperature at exit 2 = 15∘ C ⇒ T (10, 10) = 15 = ∴ T(x, y) = 1 2 x- 1 2 y + 15. To find the region where T < 18, 1 2 ⇒ x- 1 2 x + n y + 15. × 10 + n × 10 + 15 ⇒ n = - 1 . 2 1 2 1 2 2 y + 15 < 18 y > x - 6. Is this model a good one? Functions of Three or More Variables: h = f (x, y, z, ...) These occur often in practice. For example, consider meteorology: pressure P in the atmosphere depends on the three spatial variables x, y, z and time t, P = f (x, y, z, t) . This is also true for things such as density ρ and temperature T. But it is not easy to visualise a function of three variables. How do we do it? One approach is to do as we did for functions of two variables where we held one variable constant and varied the other one. With functions of more than two variables we can hold one or more variables constant and draw contour maps at different values of the remaining variables Example Consider a low pressure cell in the atmosphere modelled by KMA252 Multivariable Functions.nb P(x, y, z) = e-α z Pa - P1 e-x 2 +y2 15 where the x and y axes lie along the ground, and the z axis points up corresponding to altitude. The definition exhibits circular symmetry in x and y and this is reflected in surface plots and contour diagrams at different heights. This is one way to help us visualise a function of three variables. The same approach can be used for a function of k variables by holding k - 2 variables constant. For example, consider the following definition which includes a time dependent modification to the pressure model. P(x, y, z, t) = e-α (z-λ t) Pa - P1 e-(β x-ω t) 2 +(γ y-κ t)2 With suitable parameter values, the evolving nature of the low pressure cell at z = 0 is readily seen in the following contour plots for increasing time, t. The Bureau of Meteorology uses this approach when publishing its barometric charts. Pressure 16 KMA252 Multivariable Functions.nb contours are drawn at sea level at six hour intervals. Contour-Surfaces / Level-Surfaces For a function of two variables z = f (x, y) we plotted contours / level-curves for z = c, c ∈ . For a function of three variables p = f (x, y, z) we can also set p = c, c ∈ to produce contours. The resulting relationship is now three-dimensional and the contour is a contoursurface / level-surface. As for functions of two variables, there are some simple special surfaces. Ellipsoid The general form of an ellipsoid centred at (x0 , y0 , z0 ) is (x-x0 )2 a2 + (y-y0 )2 b2 + (z-z0 )2 c2 = 1. The positive constants a, b, c give the semi-axis lengths of the ellipsoid in the x, y, z directions respectively. A sphere is a surface for which every point (x, y, z) is a fixed distance R from the centre (x0 , y0 , z0 ); R is the radius of the sphere. This is a special case of an ellipsoid with a = b = c = R. (x - x0 )2 + (y - y0 )2 + (z - z0 )2 = R2 Example As we move away from the sun (radius R and surface temperature Ts ) suppose the temperature is given by where x2 + y2 + z2 ⩾ R2 . T(x, y, z) = Ts e-x 2 +y2 +z2 -R2 Spherical symmetry is immediately obvious in the temperature definition so spherical contour KMA252 Multivariable Functions.nb 17 surfaces are to be expected. Level surfaces exist where T(x, y, z) = c, so c = Ts e-x 2 +y2 +z2 -R2 ⇒ x2 + y2 + z2 = R2 - ln c Ts = R2 + ln Ts . c The family of level surfaces are spheres centred at the origin with radius R2 + ln Ts c , c ⩽ Ts . This figure shows contour surfaces corresponding to T = 0.4 Ts (yellow), 0.6 Ts (red), and 0.8 Ts (cyan). Linear Functions of 3 Variables A linear function will have the form where m, n, p, q ∈ . T(x, y, z) = m x + n y + p z + q The level surfaces for a linear function are given by T = c, c ∈ . We see that this can produce the plane equation in the form of a function of two variables: z = f (x, y) = M x + N y + C. c = m x+n y+ p z+q ⇒ z = - m x- which is the desired expression with M = p -m , p n p N= y+ -n , p c-q p C= c-q . p So the family of level surfaces are planes. A specific plane within the family can be selected by an appropriate choice of value for C. 18 KMA252 Multivariable Functions.nb The figure above shows the contour surfaces c = ±5, ±3, ±1 for T(x, y, z) = 2 x + 3 y - z. Hyperboloids The standard form of a hyperboloid centred at (x0 , y0 , z0 ) is (x-x0 )2 a2 + (y-y0 )2 b2 - (z-z0 )2 c2 = -1 elliptic hyperboloid of 2 sheets 0 elliptic cone 1 elliptic hyperboloid of 1 sheet. The positive constants a, b, c control the dimensions of the ellipse (x y) and hyperbolae (x z and y z directions). If the standard form is generalised such that the function value can be all real numbers rather than just -1, 0, 1, three-dimensional space can be filled with the entire family of hyperboloids given by h = f (x, y, z) = (x-x0 )2 a2 + (y-y0 )2 b2 - (z-z0 )2 , c2 h = k, k ∈ . KMA252 Multivariable Functions.nb 19 Moving the minus to one of the other variables will change the orientation of the hyperboloid. Example Determine the level surface represented by G(x, y, z) = x2 + 2 y2 - 3 z2 - 2 x - 4 y = -3 . Our initial step is to put this into standard form by completing squares. ⇒ x2 + 2 y2 - 3 z2 - 2 x - 4 y = -3 x2 - 2 x + 2 y2 - 2 y - 3 z2 = -3 ⇒ x2 - 2 x + 1 - 1 + 2 y2 - 2 y + 1 - 1 - 3 (z - 0)2 = -3 ⇒ ⇒ (x - 1)2 + 2 (y - 1)2 - 3 (z - 0)2 = 0 (x-1)2 12 + (y-1)2 1 2 2 - (z-0)2 1 3 2 = 0. -⊕ -⊗ The level surface is an elliptic cone opening in the z direction and centred at (1, 1, 0). If needed we can determine cross-sections and contours of G by, in turn, holding x, y, z constant to reveal the behaviour between the remaining variables. Here, we expect a hyperbolic relationship in both x and z and y and z, and an elliptic relationship in x and y. For such an assessment it is easier to work with equation ⊕ rather than the general form of equation ⊗. For example, should we want parametric definitions for cross-sections in y, let y = k, k ∈ . Then equation ⊕ gives 20 KMA252 Multivariable Functions.nb ⇒ 3 (z - 0)2 - (x - 1)2 = 2 (k - 1)2 (z-0)2 2/3 (k-1)2 - (x-1)2 2 (k-1)2 =1 , k ≠ 1. -★ -☺ This is in the standard form of a hyperbola centred at (x0 , z0 ) = (1, 0) and opening in the z direction. For k = 1 we return to equation ★ which becomes 3 z2 - (x - 1)2 = 0, and solves to give the two straight lines z = ± the hyperbolae. 1 3 (x - 1). We may also interpret these lines as asymptotes of A possible parametric definition for the hyperbolic cross-sections for z > 0 is z(t) = x(t) = 2 / 3 (k - 1) cosh(t) 2 (k - 1) sinh(t) + 1 tϵ and a possible parametric definition for the entire cone is x(u, v) = y(u, v) = z(u, v) = u 3 u cos(v) + 1 3 / 2 u sin(v) + 1 v ϵ [0, 2 π) , u ϵ . Note that the two-dimensional cross-sections requires one parameter whereas the threedimensional contour surface requires two parameters. In general the parametrisation of a kdimensional contour requires k - 1 parameters. Level Surfaces of a General Function Recall the time dependent atmospheric pressure model, P(x, y, z, t) = e-α (z-λ t) Pa - P1 e-(β x-ω t) 2 +(γ y-κ t)2 . To draw contour surfaces of constant pressure at some time t, we might try and rearrange the equation into a function of two variables z = f (x, y) or a function of three variables = ( ) u = G(x, y, z), and hope that a recognisable function might fall out. KMA252 Multivariable Functions.nb 21 Whilst elliptic symmetry will be evident in the expressions, neither f nor G will fit the form of one our standard surfaces. In such cases it is best to leave the plotting of contour surfaces to numerical techniques embedded in our software. Treating z = f (x, y) as a level surface We have seen that the graph of z = f (x, y) is a surface and we have also seen that a contour of u = g(x, y, z) is a surface. Can we write the definition of a surface in both ways? By the definition of a function we know that f must be single-valued for all x y combinations. Immediately, this precludes any surface that closes on itself. For such surfaces multiple function definitions will be required for the entire surface. Take the unit sphere for example. To define the surface using functions of two variables requires a function for the top half and a separate function for the bottom half. z = f1 (x, y) = - z = f2 (x, y) = + As a function of 3 variables we may let 1 - x2 - y2 1 - x2 - y2 u = g(x, y, z) = x2 + y2 + z2 . Letting u = c, c ⩾ 0 then gives the family of spherical contour surfaces, centred at the origin, with radius c . The unit sphere is the particular case, c = 1. The three variable approach is efficient but both definitions will prove useful in the analysis of a surface. A simple way to transform a two variable definition into a three variable definition is via the 22 KMA252 Multivariable Functions.nb following. z = f (x, y) ⇒ z - f (x, y) = 0. Letting u = g(x, y, z) = z - f (x, y), we may consider the surface as the contour surface u = 0. Vectors In order to do calculus with surfaces, we need an efficient way of describing where points on a line or surface are. Position vectors are the best way of doing this. To describe vectors in general we will consider their geometric and analytic description in Cartesian coordinates. Geometric Description of Vectors Geometrically, vectors are entities thought of as having length and direction. Equality Two vectors are equal iff they have the same length and direction. Where they sit in space does not matter. a c b a = c ≠ b Addition Vectors a and b are added head-to-tail. c Scalar Multiplication b a a + b = c Multiplying a vector a by a constant c results in a change in the length of the vector to c × length(a ). There is no change in the direction unless c < 0 whereupon the direction is reversed. The special case of c = 0 results in the zero vector which will be discussed later. 2 KMA252 Vectors.nb 2a a -a a 2 Two vectors are parallel if one is a scalar multiple of the other: i.e. v = λ u . Interpret subtraction as addition and scalar multiplication: c = a - b = a + (-b ). Subtraction a b c -b a Analytic Description of Vectors It is often inconvenient to use geometric vectors. We can instead use vectors by referring to their components in some agreed directions. In the Cartesian coordinate system the agreed directions align with the + x, + y, +z axes and are called the i , j, k unit vectors, respectively. The generalised notations ex , e y , ez and x, y, z are also often used. The general feature of a unit vector is that it has unit length. The special feature of the family of Cartesian unit vectors is that they are mutually orthogonal to each other. By scalar multiplication and vector addition we can think of the analytic description of any vector v as z k i j y v = v1 i + v2 j + v3 k v1 i v x v3 k v2 j where v1 , v2 , v3 are the components of v in the directions of the x, y, z axes respectively. KMA252 Vectors.nb 3 Operations involving analytic vectors will require restricting operations to shared directions. The terms unit vectors and directions can be used interchangeably. Consider two vectors a = a1 i + a2 j + a3 k and b = b1 i + b2 j + b3 k . Equality a and b are equal iff their components are equal: a1 = b1 , a2 = b2 , a3 = b3 . Addition We can add two vectors by adding their components. a + b = a1 i + a2 j + a3 k + b1 i + b2 j + b3 k = (a1 + b1 ) i + (a2 + b2 ) j + (a3 + b3 ) k Scalar Multiplication Multiplying a vector a by a constant c results in each component of a being multiplied c. c a = c a1 i + a2 j + a3 k = (c a1 ) i + (c a2 ) j + (c a3 ) k Subtraction We can subtract two vectors by subtracting their components. a - b = a1 i + a2 j + a3 k - b1 i + b2 j + b3 k = (a1 - b1 ) i + (a2 - b2 ) j + (a3 - b3 ) k Position Vectors Normally we don’t say where vectors are in space. However, we may need to define points relative to a given coordinate system. z O P(x,y,z) y r x If P(x, y, z) is the point in space, then a position vector is defined as 4 KMA252 Vectors.nb r = OP = x i + y j + z k . Such a vector always has its start point fixed at the origin. Displacement Vectors A displacement vector is considered to be the difference between two position vectors. If A(xa , ya , za ) and B(xb , yb , zb ) are the terminal points of the respective position vectors a and b , then a displacement vector d from A to B is given by d = AB = b - a = (xb - xa ) i + (yb - ya ) j + (zb - za ) k . This confirms that two vectors, having the same magnitude and direction, are considered to be the same even if they do not coincide. In the diagram below, e 1 = e 2 iff b - a = v - u . b O a e 1 = b -a v e 2 = v -u u Unit Vectors Unit vectors have already been introduced as a vector of unit length or a direction. To compute a unit vector attached to some arbitrary vector we simply take that vector and divide it by its length. Suppose v = v1 i + v2 j + v3 k . The length of v is given by the 2-norm ≡ v 2 = v v · v = A unit vector pointing in the same direction as v is e v ≡ v = = = v v v1 i +v2 j+v3 k 2 2 1/2 v2 1 +v2 +v3 v1 2 +v2 1/2 v2 +v 1 2 3 i + v21 + v22 + v23 . v2 v21 +v22 +v23 1/2 j + v3 v21 +v22 +v23 1/2 k We note from a slight rearrangement that this is equivalent to our definition of a vector as an entity having magnitude and direction: v = v v . KMA252 Vectors.nb 5 n-Dimensional Vectors In this course we will concentrate on vectors embedded in a 3-dimensional coordinate system but this is not a necessary condition. In general, a vector can have n independent components and subject to a set of linear algebra axioms, can be operated on using vector addition and scalar multiplication. Depending on the value of n, various other operations may be permissible. Invariance of Vectors In defining a vector as an entity having magnitude and direction we have made no mention of the location of the origin nor the orientation of the coordinate system. We expect the length and direction of a vector to remain unchanged if the origin is moved or the coordinate axes and corresponding unit vectors are changed. y j v O i a b y′ x j' i' O' x′ In the diagram above the 2D vector v is a position vector relative to the coordinate system centred at O. We may write the vector, v = v1 i + v2 j. In the rotated and translated coordinate system centred at O', the vector v can be interpreted as a displacement vector v = b - a . In terms of the new unit vectors we may write the vector, ' v = v1 i + v2 j' . For invariance we require length and direction to be conserved. This does not require that the vector components be conserved; i.e. v1 ≠ v1 and v2 ≠ v2 (unless there is no rotation). Length conservation ⇒ v = v21 + v22 = v1 i+v2 j Direction conservation ⇒ v = = v21 +v22 (v1 )2 + (v2 )2 v1 i ' +v2 j' v1 2 +v2 2 . In reference to the diagram above consider the position vector v = 1 i + 1 j. With respect to O Example the translated origin O' is at (3, 1) and the axes are rotated clockwise by π / 4. Redefine v in terms of the new coordinate system and show that it is invariant under this affine transformation. 6 KMA252 Vectors.nb ' Firstly, we observe that v is at an angle of π / 4 with respect to the x axis, so i must be parallel to v and j' must be perpendicular to v . Then ' - 2 ' 2 2 2 i = 2 i + 2 j and j = 2 i + 2 j . y j O v i x a b y′ j' O' i' x′ ' ' In the transformed reference frame a = -2 2 i + 2 j' and b = - 2 i + 2 j' , giving ' ' ' v = b - a = - 2 i + 2 j' - -2 2 i + 2 j' = 2 i + 0 j' . ' This states that v is parallel to i , as expected, and that its length is 2 which can be easily confirmed by computing the length in the original reference frame. The Dot (Scalar) Product The dot (scalar) product takes two vectors v and w and performs a binary operation with them that results in a scalar. Geometric Description of the Dot Product θ w v v · w = v w cos(θ) KMA252 Vectors.nb 7 where θ is the angle between the vectors v and w when drawn tail to tail. The dot product is commutative: v · w = w · v . If v and w are at right angles then cos(θ) = 0. So two vectors v and w are perpendicular (or orthogonal) iff v · w = 0. We have used the dot product to compute vector length: v · v = v v cos(0) ⇒ v = v · v . Example Prove the Law of Cosines. We begin by drawing two vectors a and b drawn tail to tail, then form the difference vector c = b - a . θ b a c = b -a c · c = (b - a ) · (b - a ) = a · a + b · b - a · b - b · a = a · a + b · b - 2 a · b ⇒ c 2 = a 2 + b 2 - 2 a b cos(θ) . In the special case θ = π / 2, the orthogonal dot product simplifies to a · b = a b cos π = 0. 2 The Law of Cosines then simplifies to Pythagaros’ Theorem, c 2 = a 2 + b 2 . Analytic Description of the Dot Product Since i , j, k are orthogonal, i · j = j · i = 0, j · k = k · j = 0, and k · i = i · k = 0. Furthermore, since they are unit vectors i · i = 1, j · j = 1, and k · k = 1. The dot product of two arbitrary vectors a = a1 i + a2 j + a3 k and b = b1 i + b2 j + b3 k is 8 KMA252 Vectors.nb a · b = a1 i + a2 j + a3 k · b1 i + b2 j + b3 k = a1 b1 i · i + a1 b2 i · j + a1 b3 i · k + a2 b1 j · i + a2 b2 j · j + a2 b3 j · k + a3 b1 k · i + a3 b2 k · j + a3 b3 k · k ⇒ a · b = a1 b1 + a2 b2 + a3 b3 For vectors in n-dimensions, the dot product may succinctly be written a · b = ∑ni=1 ai bi . If a = a1 i + a2 j + a3 k , it can readily be seen that a1 = a · i , a2 = a · j , and a3 = a · k . Vector Components From Dot Products In each case the dot product gives the amount of the vector a in the given direction. Projections Computing vector components from dot products, as we did above, is a special case of a projection. When computing a projection we seek the amount of the vector a in some arbitrary direction e u . au = a · e u = a e u cos(θ) = a cos(θ) The quantity au may also be referred to as a scalar projection. A further term - vector projection - attaches the direction to the scalar projection. a u = au e u Compute the amount of a = 3 i - 2 j + 7 k that is in the direction of b = 1 i + 2 j - 1 k . Example We are asked to compute ab = a · e b but to do so we must first compute the direction e b = The scalar projection is then 1 i+2 j-1 k b . e b = = b 6 ab = a · e b = 3 i - 2 j + 7 k · 1 i +2 j-1 k 6 = -8 6 =-4 6 3 = -3.266. b . b What does this value mean? We note the length of a is a = 38 = 6.164. The scalar projection tells us that a bit more than one-half of its length (3.266/6.164) is in the direction of e b ; the negative sign tells us it is in the opposite direction. Should the vector projection be required we have KMA252 Vectors.nb a b = ab e b = -3.266 e b = - 4 6 3 1 i+2 j-1 k 6 9 = - 4 1 i + 2 j - 1 k = - 4 b . 3 3 The Cross (Vector) Product The cross (vector) product takes two vectors v and w and performs a binary operation with them that results in a third vector. Geometric Description of the Cross Product v w = v w sin(θ) n where n is a unit normal vector that is perpendicular to the plane formed by the vectors v and w when drawn tail to tail. Its direction is given by the right hand rule. The cross product is anti-commutative: v w = - w v . If v and w are parallel then sin(θ) = 0 and v w = 0 n = 0 . The vector 0 = 0 i + 0 j + 0 k is known as the zero vector; it has zero magnitude and any direction. Example Cross product behaviour is readily seen in rotating objects. Take a rigid circular body (a disc) rotating about its central axis. Since the body is solid, every point on the disc will have the same angular velocity. That is, every point on the disc will undergo the same change in angular position Δθ over the same short change in time Δt: ω = Δθ / Δt. Consider a point on the disc that is a distance r from the axis of rotation. It is known that the tangential velocity v of this point is proportional to its distance from the axis of rotation. We have v = ω r. 10 KMA252 Vectors.nb Noting that v is the magnitude of the tangential velocity vector v , r is the magnitude of the position vector r , and v and r are perpendicular to each other, it must be that ω is the magnitude of an angular velocity vector ω that is mutually perpendicular to v and r . The right hand rule relationship is evident when the tangent vector is shifted to the origin or when all vectors are shifted to the point. Analytic Description of the Cross Product Since i , j, k are mutually orthogonal, i i = 0 , j j = 0 , and k k = 0 . j × i = -k ; k × j = - i ; i × k = - j . The cross product of two arbitrary vectors a = a1 i + a2 j + a3 k and b = b1 i + b2 j + b3 k is a b = a1 i + a2 j + a3 k b1 i + b2 j + b3 k = a1 b1 i i + a1 b2 i j + a1 b3 i k + a2 b1 j i + a2 b2 j j + a2 b3 j k + a3 b1 k i + a3 b2 k j + a3 b3 k k = 0 + a1 b2 k - a1 b3 j - a2 b1 k + 0 + a2 b3 i + a3 b1 j - a3 b2 i + 0 Furthermore, i × j = k , j × k = i , k × i = j , KMA252 Vectors.nb ⇒ 11 a b = (a2 b3 - a3 b2 ) i + (a3 b1 - a1 b3 ) j + (a1 b2 - a2 b1 ) k This formula can easily be remembered in the form of a matrix determinant: i j k a b = a1 a2 a3 . b1 b2 b3 The Plane Equation We have seen that the equation of the plane can be written in the form of a contour surface as c1 x + c2 y + c3 z = c4 . We will now give a more general description using vectors. Consider a plane containing a stationary point A(x0 , y0 , z0 ) that is the terminal point of the position vector a . The plane has unit normal vector n = n1 i + n2 j + n3 k . Consider also the arbitrary position vector r terminating at the variable point P(x, y, z). We may connect the two points with a displacement vector AP = r - a . If we compute the projection of r - a on the unit normal n , a zero result will be obtained if the two vectors are perpendicular. This can only happen when r - a lies in the plane. The plane equation is thus (r - a ) · n = 0 . (0.1) Expanding this expression yields 12 KMA252 Vectors.nb n1 (x - x0 ) + n2 (y - y0 ) + n3 (z - z0 ) = 0 which can be manipulated into our previous general form. Example Compute the plane through the points A(0, 1, 0), B(1, 0, 5), C(1, 1, 3). To use equation (0.1) to describe the plane we require a position vector to a stationary point in the plane as well as the plane’s unit normal vector. The points A, B, C provide three stationary points so we may choose the position vector terminating at any one of these points. Arbitrarily, let that position vector be b = OB = 1 i + 0 j + 5 k . To create the unit normal vector we recall the geometric definition of the cross product: the cross product takes two vectors v and w and performs a binary operation with them that results in a third vector that is perpendicular to the plane formed by the vectors v and w . We can construct two vectors in the plane with our stationary points. The vectors AB, BA, BC, CB, AC, and CA are all vectors residing in the plane and any two of them can be used to form the cross product. Arbitrarily, with a = OA and c = OC, AB = b - a = 1 i + 0 j + 5 k - 0 i + 1 j + 0 k = 1 i - 1 j + 5 k AC = c - a = 1 i + 1 j + 3 k - 0 i + 1 j + 0 k = 1 i + 0 j + 3 k . We now have two vectors residing in the plane from which we can compute a normal vector n . i j k Let n = AB AC = 1 -1 5 = -3 i + 2 j + 1 k . 1 0 3 This is not a unit vector, nor is it the zero vector, so we are permitted to write our plane equation as n (r - b ) · n = (r - b ) · = 0 n ⇒ (r - b ) · n = 0 . Then (x - 1) i + (y - 0) j + (z - 5) k · -3 i + 2 j + 1 k = 0 ⇒ -3 (x - 1) + 2 (y - 0) + 1 (z - 5) = 0 ⇒ -3 x + 2 y + z = 2 . This also can be computed from the cross product determinant: (x - 1) (y - 0) (z - 5) 1 -1 5 = 0. 1 0 3 Curvilinear Coordinates For the most part, the vectors we have been dealing with so far have been variants of position vectors defined in the Cartesian coordinate system. Soon we will turn our attention to vector fields in which each point in space is mapped to a vector quantity, and is given in the form F (x, y, z) = F1 (x, y, z) i + F2 (x, y, z) j + F3 (x, y, z) k . The functions F1 , F2 , F3 are scalar fields in which each point in space is mapped to a scalar quantity. Velocity fields, magnetic fields, and electric fields are common examples of physical vector fields. Temperature fields and pressure fields are examples of physical scalar fields. In the form above the scalar fields are no more than components of the vector field. It is often the case that describing vector fields in Cartesian coordinates is inefficient or cumbersome because the coordinate system does not reflect the geometric symmetry inherent in the field. Many physical systems involve cylindrical or spherical objects, in which we might expect the associated scalar and vector fields to exhibit cylindrical or spherical dependence, respectively. In such situations it might make sense to work with cylindrical or spherical coordinates. Transformation of Coordinates Let the Cartesian coordinates (x, y, z) of any point P be expressible in terms of arbitrary coordinates (u1 , u2 , u3 ), such that x ≡ x (u1 , u2 , u3 ) , y ≡ y(u1 , u2 , u3 ) , z ≡ z(u1 , u2 , u3 ). We expect these relationships to be single-valued (but not always) so that, in turn, u1 ≡ u1 (x, y, z) , u2 ≡ u2 (x, y, z) , u3 ≡ u3 (x, y, z). When x, y, or z is held constant we know that a plane is produced. When u1 , u2 , or u3 is held constant a curved surface might be the result. Thus the coordinate surfaces for (u1 , u2 , u3 ) might be a combination of planes and curved surfaces; hence the name curvilinear coordinate system. A coordinate curve results where a pair of coordinate surfaces intersect. If the three coordinate curves emanating from every point P are mutually orthogonal, the coordinate system is said to be an orthogonal curvilinear coordinate systems. In addition to Cartesian coordinates we shall explore two such systems: cylindrical coordinates (ρ, ϕ, z) and spherical coordinates (r, θ, ϕ). The variable labels used here are as defined in ISO 80000-2:2009 Quantities and units - Part 2: Mathematical signs and symbols to be used in the natural sciences and technology. ISO 80000-2 superseded ISO 31-11. Practically, you will find many variations in use, so be careful! 2 KMA252 Coordinate Systems.nb Cylindrical coordinates (ρ, ϕ, z) Embedded on the Cartesian axes, the coordinate surfaces are infinite vertical cylinders for radius ρ, vertical planes radiating out from the z-axis for angle ϕ, and horizontal planes for height z. ρ and ϕ are analogous to r and θ in 2D polar coordinates, except that a negative radius is not permitted for ρ. The radius is measured from the z-axis and parallel to the xy-plane. To transform between Cartesian and cylindrical coordinates, we have x = ρ cos(ϕ) , y = ρ sin(ϕ) , z = z ρ= x2 + y2 , ϕ = arctan(y / x) , z = z where ρ ∈ [0, ∞), ϕ ∈ [0, 2 π), z ∈ (-∞, ∞). The angular coordinate is sometimes referred to as the azimuthal angle. The cylindrical unit vectors are e ρ , respectively. Unlike the Cartesian constant: e ρ will always be normal e ϕ , e z and they point in the direction of increasing ρ, ϕ, z unit vectors, two of the cylindrical unit vectors are not to a ρ coordinate surface so its direction will be dependent on ϕ, and e ϕ will always be normal to a ϕ coordinate surface so its direction also will be dependent on ϕ. Conversely, e z always points up so it is a constant vector. In the order e ρ , e ϕ , e z the unit vectors form a right handed orthonormal basis: e ρ e ϕ = e z , e ϕ e z = e ρ , e z e ρ = e ϕ . KMA252 Coordinate Systems.nb 3 The variable unit vectors can be expanded into Cartesian form as follows. e ρ = cos(ϕ) i + sin(ϕ) j e ϕ = -sin(ϕ) i + cos(ϕ) j These relationships are evident geometrically. e ϕ sin(ϕ ) cos(ϕ ) y ϕ ϕ ϕ cos(ϕ ) e ρ sin(ϕ ) x In matrix form the unit vector relationship can be written e ρ e ϕ e z = cos(ϕ) sin(ϕ) 0 -sin(ϕ) cos(ϕ) 0 0 0 1 which we can summarise as ECyl = MCylCart ECart . i j k The transformation matrix MCylCart is an orthogonal matrix, meaning that its rows and columns are orthogonal unit vectors. For such a matrix, M -1 = M T . We immediately have 4 KMA252 Coordinate Systems.nb ECart = MCylCart T ECyl ⇒ i j k = MCartCyl ECyl = cos(ϕ) -sin(ϕ) 0 sin(ϕ) cos(ϕ) 0 0 0 1 Spherical coordinates (r, θ , ϕ) e ρ e ϕ . e z The spherical coordinate system specifies a radius and two angles. The spherical radius differs from the cylindrical radius in that now it is the distance that a point is from the origin, rather than the distance it is from the z-axis. The angle ϕ has the same definition as its cylindrical counterpart. Embedded on the Cartesian axes, the coordinate surfaces are spheres for radius r, cones for angle θ, and vertical planes radiating out from the z-axis for angle ϕ. To transform between Cartesian and cylindrical coordinates, we have r= x = r sin(θ) cos(ϕ) , y = r sin(θ) sin(ϕ) , z = r cos(θ) x2 + y2 + z2 , θ = arccos , ϕ = arctan(y / x) z 2 x +y2 +z2 where r ∈ [0, ∞), θ ∈ [0, π], ϕ ∈ [0, 2 π). The mesh formed by constant θ and ϕ on the surface of a sphere resembles lines of constant latitude and longitude, respectively. The positive z-axis (North-pole) corresponds to θ = 0, the xy-plane corresponds to θ = π / 2, and the negative z-axis (South-pole) corresponds to θ = π; θ is often referred to as the polar or colatitude angle. The spherical unit vectors are e r , e θ , e ϕ and they point in the direction of increasing r, θ, ϕ respectively. None of the spherical unit vectors are constant: e r will always be normal to a r θ KMA252 Coordinate Systems.nb r coordinate surface so its direction will be dependent on θ and ϕ, e θ will always be normal to a θ 5 coordinate surface so its direction will be dependent on θ and ϕ, and e ϕ will always be normal to a ϕ coordinate surface so its direction also will be dependent on ϕ. In the order e r , e θ , e ϕ the unit vectors form a right handed orthonormal basis: e r e θ = e ϕ , e θ e ϕ = e r , e ϕ e r = e θ . The spherical unit vectors can be expanded into Cartesian form as follows. e r = sin(θ) cos(ϕ) i + sin(θ) sin(ϕ) j + cos(θ) k e θ = cos(θ) cos(ϕ) i + cos(θ) sin(ϕ) j - sin(θ) k e ϕ = -sin(ϕ) i + cos(ϕ) j + 0 k In matrix form the unit vector relationship can be written e r e θ e ϕ = sin(θ) cos(ϕ) sin(θ) sin(ϕ) cos(θ) cos(θ) cos(ϕ) cos(θ) sin(ϕ) -sin(θ) -sin(ϕ) cos(ϕ) 0 which we can summarise as ESph = MSphCart ECart . i j k Since the transformation matrix MSphCart is an orthogonal matrix, we immediately have ECart = MSphCart T ESph ⇒ i j k = MCartSph ESph = sin(θ) cos(ϕ) cos(θ) cos(ϕ) -sin(ϕ) sin(θ) sin(ϕ) cos(θ) sin(ϕ) cos(ϕ) cos(θ) -sin(θ) 0 e r e θ . e ϕ The matrix forms are particularly convenient when transforming between coordinate systems. For example, the cylindrical unit vectors can be transformed into spherical unit vectors via 6 KMA252 Coordinate Systems.nb ECyl = MCylCart ECart = MCylCart MCartSph ESph ⇒ e ρ e ϕ e z = cos(ϕ) sin(ϕ) 0 -sin(ϕ) cos(ϕ) 0 0 0 1 sin(θ) cos(θ) 0 0 0 1 = cos(θ) -sin(θ) 0 sin(θ) cos(ϕ) cos(θ) cos(ϕ) -sin(ϕ) sin(θ) sin(ϕ) cos(θ) sin(ϕ) cos(ϕ) cos(θ) -sin(θ) 0 e r e θ . e r e θ e ϕ e ϕ Position Vectors Using the coordinate transformations and unit vector transformations defined above, we may write the general position vector in each coordinate system. Cartesian : r = x i + y j + z k Cylindrical : r = ρ e ρ + z e z Spherical : r = r e r The Cartesian definition is the only one that defines a unique point in space. Since e ρ varies with ϕ, the cylindrical version defines a circle of radius ρ at height z above the xy-plane. This definition is reserved for fields exhibiting cylindrical symmetry. Similarly, since e r varies with θ and ϕ, the spherical version defines a sphere of radius r. This definition is reserved for fields exhibiting spherical symmetry. Vector Calculus Parametric Position Vector We want to be able to differentiate and integrate certain functions along some path in 3D space. To do this we first must be able to describe the path. We can think of a space curve as a collection of points P(x, y, z), and thus write a formula to represent the position vector r of each point. We may use the convenient notation P(r ) ≡ P(x, y, z) to indicate that P is a function of position. t = t0 O r(t) t= t f P( x,y,z) C Now suppose that as some real variable t varies from t = t0 to t = t f , the point P moves from one end of the curve to the other end. Then point P is a function of t and is given by P(x(t), y(t), z(t)). The variable t is called a parameter. We may now write the parametric position vector r (t) = x(t) i + y(t) j + z(t) k , t ∈ t0 , t f . This is called a parameterisation of . As above, P(r (t)) indicates that P is a function of the parametric position vector. The advantage of representing a curve parametrically is that very complicated paths can be represented by functions x(t), y(t), z(t), even if they self-intersect. 2 KMA252 Vector Calculus.nb Example Parameterise the triangular path ABCA. C(1,1,2) z y B(2,0,1) A(0,0,0) x One way of doing this is: AB : BC : CA : x(t) = 2 t y(t) = 0 z(t) = t x(t) = 3 - t y(t) = t - 1 z(t) = t x(t) = y(t) = z(t) = 0⩽t⩽1 1⩽t⩽2 1 (10 - t) 8 1 (10 - t) 8 1 (10 - t) 4 2 ⩽ t ⩽ 10 Or we could write this succintly as the parametric position vector, 2 t i + 0 j + t k , 0⩽t⩽1 (3 - t) i + (t - 1) j + t k , 1 ⩽ t ⩽ 2 r (t) = 10-t 1 i + 1 j + 2 k , 2 ⩽ t ⩽ 10. 8 Example Parameterise an elliptic helix up the z-axis. The helix has semi-axis length a in the x-direction and semi-axis length b in the y-direction. The path should be scribed counter-clockwise, beginning at (0, -b, 0). KMA252 Vector Calculus.nb 3 There are an infinite number of parameterisations that would satisfy these conditions. One such parameterisation is r (t) = a sin(t) i - b cos(t) j + t k , t ∈ t0 , t f . 8 With the real parameter ω introduced to the parameterisation, r (t) = a sin(ω t) i - b cos(ω t) j + ω t k , 8 t ∈ t0 , t f the shape of the space curve will not change but the number of loops and the speed with which it is traversed will change. Straight Lines Suppose we want to find the equation of a straight line joining the points A and B, which have respective position vectors a and b . We begin by letting r (t) = x(t) i + y(t) j + z(t) k be the parametric position vector of a typical point P on the straight line. Now if l is any vector pointing along the direction of the line AB then the equation of the line is r (t) = a + t l . 4 KMA252 Vector Calculus.nb To determine the domain of t so that A and B are the terminal points on the line, we must know l explicitly. A particular choice is l = b - a , so that Example r (t) = a + t (b - a ) , t ∈ [0, 1]. Find the equation of the straight line from A(3, -1, 6) to B(4, 4, 8). Let a = 3 i - 1 j + 6 k and b = 4 i + 4 j + 8 k . r (t) = a + t (b - a ) = 3 i - 1 j + 6 k + t 4 i + 4 j + 8 k - 3 i - 1 j + 6 k = (3 + t) i + (5 t - 1) j + (6 + 2 t) k , t ∈ [0, 1] . We may extract the individual components x(t) = 3 + t, y(t) = 5 t - 1, z(t) = 6 + 2 t. Velocity and Acceleration Consider a particle moving along path in 3D space. At time t its position vector is OP = r (t) . Suppose that at a slightly later time t + Δt, the particle has a new position vector OQ = r (t + Δt) . In the time interval Δt the particle has moved through a displacement Δr = r (t + Δt) - r (t) and the average velocity vector over the time interval Δt is 1 Δt Δr = r (t+Δt) - r (t) Δt . KMA252 Vector Calculus.nb 5 To find the instantaneous velocity vector we let the time interval tend to zero, such that v (t) = limΔt→0 = d r (t) = r ' (t) . r (t+Δt) - r (t) Δt dt The instantaneous velocity vector is tangent to the particle’s path . Expanding the vectors in Cartesian coordinates highlights some important properties. v (t) = = = d r (t) x(t) i + y(t) j + z(t) k x(t) i + d y(t) j + d z(t) k . dt dt dt d dt d dt The Cartesian unit vectors are constant and therefore independent of t. Hence d y(t) d z(t) v (t) = d x(t) i + j+ k dt dt dt = x' (t) i + y' (t) j + z' (t) k . The existence of the velocity vector requires the existence of the component derivatives x' (t), y' (t), z' (t). In a similar way we can define the instantaneous acceleration vector to be a (t) = limΔt→0 = = d v (t) v (t+Δt) - v (t) Δt dt d 2 r (t) d t2 = x'' (t) i + y'' (t) j + z'' (t) k . Again, the existence of the acceration vector requires the existence of the component derivatives x'' (t), y'' (t), z'' (t). Example Find the motion of a particle moving on a circular path of radius b about the z-axis, at a height h above the xy-plane. With angular frequency ω, the parametric position vector to point P on the circular path may be defined r (t) = b cos(ω t) i + b sin(ω t) j + h k . The domain of t will be determined by the number of path cycles required. For a single cycle we may restrict the domain to [0, 2 π / ω). Differentiating the position vector with respect to t yields the velocity vector 6 KMA252 Vector Calculus.nb v (t) = -ω b sin(ω t) i + ω b cos(ω t) j + 0 k . Differentiating the velocity vector with respect to t yields the acceleration vector a (t) = -ω2 b cos(ω t) i - ω2 b sin(ω t) j + 0 k = -ω2 b cos(ω t) i + b sin(ω t) j + 0 k . What can we interpret from the position, velocity, and acceleration vectors? The first thing we notice about the velocity and acceleration vectors is that both have zero vertical components, meaning that both vectors are parallel to the xy-plane. We know that the velocity must be tangent to the particle’s path, so this definition must describe a vector that is perpendicular to the circle. For the acceleration vector we note that its i and j components are proportional to the corresponding components of the position vector. Additionally, the negative sign in the acceleration indicates that it is in the opposite direction. Since these position vector components tell us how far the particle is from the z-axis (cylindrical radius), the corresponding acceleration components must be directed back to the z-axis. What is evident in these Cartesian descriptions of the position, velocity, and acceleration vectors is that they are not intuitive for the geometry of the problem. Perhaps we can make more sense of the vectors if solved in cylindrical form? Velocity and Acceleration in Cylindrical Coordinates We recall that the position vector in cylindrical coordinates is r = ρ e ρ + z e z and that e ρ ≡ e ρ (ϕ) and e ϕ ≡ e ϕ (ϕ). We are reminded that in this form the position vector does not define a unique point. Assuming that ρ ≡ ρ(t), ϕ ≡ ϕ(t), and z ≡ z(t), the two non-constant unit vectors must also be functions of t: e ρ ≡ e ρ (ϕ(t)) and e ϕ ≡ e ϕ (ϕ(t)). By the chain rule, KMA252 Vector Calculus.nb = d e ρ dt d e ρ d ϕ dϕ dt and = d e ϕ dt d e ϕ d ϕ dϕ dt Using the Cartesian forms of these unit vectors, we have d e ρ dϕ d e ϕ dϕ Then 7 . cos(ϕ) i + sin(ϕ) j = -sin(ϕ) i + cos(ϕ) j = e ϕ = d -sin(ϕ) i + cos(ϕ) j = -cos(ϕ) i - sin(ϕ) j = -e ρ . dϕ = d dϕ = d e ρ dt Velocity Vector dϕ dt d e ϕ e ϕ and dt = - dϕ dt e ρ . The parametric position vector in cylindrical coordinates now can be written r (t) = ρ(t) e ρ (t) + z(t) e z . Differentiating the position vector with respect to t yields the velocity vector v (t) = = = = ρ(t) e ρ (t) + z(t) e z d dt d dt ρ(t) e ρ (t) + d ρ(t) dt dρ dt d dt e ρ (t) + ρ(t) e ρ + ρ dϕ dt d e ρ (t) e ϕ + z(t) e z dt dz dt + e z . d z(t) dt e z (product rule) The function notation (t) has been dropped for clarity. We note that the t derivative has induced an extra vector component due to the non-constant unit vectors. Acceleration Vector Differentiating the velocity vector with respect to t yields the acceleration vector a (t) = = = d dt d dt = = dρ dt dρ dt d2 ρ d t2 d2 ρ d t2 d2 ρ 2 dt e ρ + e ρ + dϕ e + d z e z d t ϕ dt dϕ d ρ e + d dt d t ϕ dt e ρ + ρ d ρ d e ρ dt dt + dρ dϕ dt dt d z e z dt e ϕ + ρ d2 ϕ d t2 e ϕ + ρ d ϕ d e ϕ dt dt dρ dϕ dρ dϕ d2 ϕ dϕ dϕ e ϕ + e ϕ + ρ 2 e ϕ - ρ dt dt dt dt dt dt dt 2 2 dϕ 2 d ϕ dρ dϕ - ρ e ρ + ρ 2 + 2 e + d 2z e z . dt d t d t ϕ dt dt e ρ + + d2 z d t2 e ρ + e z d2 z d t2 e z Example As before, find the motion of a particle moving on a circular path of radius b about the z-axis, at a height h above the xy-plane, but now do it in cylindrical coordinates. 8 KMA252 Vector Calculus.nb With angular frequency ω, the angular position of the particle is ϕ = ω t ⇒ ⇒ d2 ϕ d t2 = 0. The particle is at constant cylindrical radius ρ = b ⇒ The particle is at constant height z = h ⇒ =0 ⇒ dz dt dρ dt =0 ⇒ = 0. d2 z d t2 d2 ρ d t2 dϕ dt =ω = 0. Substituting into the vectors above yields the following expressions. Position vector: r (t) = ρ e ρ + z e z Velocity vector: v (t) = = b e ρ + h e z . e ρ + ρ dρ dt dϕ dt e ϕ + dz dt = 0 e ρ + b ω e ϕ + 0 e z . Acceleration vector: a (t) = 2 - ρ e ρ + ρ dt dt d2 ρ dϕ 2 d2 ϕ d t2 = -b ω2 e ρ + 0 e ϕ + 0 e z . +2 e z 2 dρ dϕ e ϕ + d 2z dt dt dt e z The symmetry of the problem that was not evident in the Cartesian forms of these vectors is now plain to see. The acceleration vector only has a radial component and the negative sign says that it points toward the z-axis (cf. centripetal acceleration a = -ω2 r when h = 0). The velocity vector only has an angular component so it is always tangent to the circular path of the particle. Furthermore, the velocity and acceleration are always perpendicular to each other. Velocity and Acceleration in Spherical Coordinates We recall that the position vector in spherical coordinates takes the simple form r = r e r and that e r ≡ e r (θ, ϕ), e θ ≡ e θ (θ, ϕ), and e ϕ ≡ e ϕ (ϕ). Assuming that r ≡ r(t), θ ≡ θ(t), and ϕ ≡ ϕ(t), all three unit vectors must also be functions of t: e r ≡ e r (θ(t), ϕ(t)), e θ ≡ e θ (θ(t), ϕ(t)), and e ϕ ≡ e ϕ (ϕ(t)). Differentiating the unit vectors requires partial differentiation (introduced in the next section) and the chain rule. Without explanation, d e r dt = = ∂ e r d θ ∂θ dt dθ dt + ∂ e r d ϕ ∂ϕ d t e θ + sin(θ) dϕ dt e ϕ , KMA252 Vector Calculus.nb d e θ dt d e ϕ and dt The velocity vector becomes v = and the acceleration vector a = d r dt d v dt = ∂ e θ d θ ∂θ d t = d e ϕ d ϕ dϕ dt ∂ e θ d ϕ ∂ϕ d t + = - d θ e r + cos(θ) dt = - = -sin(θ) = dr dt = d + r dϕ dt e ϕ , e ρ e r - cos(θ) dϕ dt e r + r 2r d t2 dϕ dt dϕ dt e θ + r sin(θ) dθ dt - r d θ - r sin2 (θ) d2 θ d t2 2 +2 + r sin(θ) dt dr dθ dt dt d2 ϕ d t2 +2 e θ . dϕ dt e ϕ dϕ 2 e r dt - r sin(θ) cos(θ) dϕ dt 9 dr dt dϕ 2 e θ dt sin(θ) + r cos(θ) dθ e ϕ dt . The Partial Derivative We have looked at surfaces as the graph of a function z = f (x, y). We might want to know how fast the surface changes, and in what direction (unit vector) the maximum rate of change occurs. Suppose we fix y; i.e. y = c, c ϵ . We could calculate the rate of change of f with x (holding y constant) by taking the partial derivative of f with respect to x. ∂f ∂x (x, y) = limΔx→0 f (x+Δx,y) - f (x,y) Δx Similarly, we can hold x constant and define the partial derivative of f with respect to y as ∂f ∂y (x, y) = limΔy→0 f (x,y+Δy) - f (x,y) Δy Partial derivatives are often written using subscript notation: ∂f ∂x ≡ fx , ∂f ∂y ≡ fy . So how do we compute partial derivatives? As the definitions imply we hold one of the variables constant and differentiate with respect to the remaining variable. Example Compute the partial derivatives of f (x, y) = sin5 x3 - 3 y + e-7 x + e2 y + x2 y. When computing the partial derivative with respect to x we must treat y as a constant. Then ∂f ∂x = 15 x2 cos5 x3 - 3 y - 7 e-7 x + 2 x y. 10 KMA252 Vector Calculus.nb In computing the partial derivative we have essentially taken the following steps. 1. Let y = c, c ∈ ⇒ f (x, c) = sin5 x3 - 3 c + e-7 x + e2 c + x2 c. 2. Differentiate with respect to x: f x = 15 x2 cos5 x3 - 3 c - 7 e-7 x + 2 x c. 3. Replace c with y: f x = 15 x2 cos5 x3 - 3 y - 7 e-7 x + 2 x y. In a similar way, when computing the partial derivative with respect to y we must treat x as a constant. Then ∂f ∂y = -3 cos5 x3 - 3 y + 2 e2 y + x2 . Example A first-order partial differential equation (PDE) is an equation that algebraically combines independent and dependent variables with partial derivatives to a maximum of first order. The particular PDE, ∂h ∂t +c ∂h ∂x = 0, is known as a first-order wave equation. It arises in hydraulics, gas flow, etc where it describes the transport of a property h in the 1D spatial domain x, as time t progresses. Show that it is satisfied by any function of the form h ≡ h(x, t) = f (x - c t) . The easiest approach to this is to introduce a new variable η = x - c t. Now By the chain rule and ∴ ∂h ∂t +c ∂h ∂x ∂h ∂x ∂h ∂t h = f (η) . = = = -c = d f ∂η d η ∂x d f ∂η d η ∂t d f dη +c = d f dη d f dη d f dη (1) (-c) . = 0 , as required. This tells us that no matter the function f , so long as its argument is in the form x - c t, f (x - c t) will be a solution of the first-order wave equation. Exercise: Satisfy yourself that this is true for functions such as h(x, t) = x - c t or sin(x - c t). Meaning of the Partial Derivative For z = f (x, y), the partial derivative ∂f ∂x is the rate of change of height z, keeping y constant; i.e. how fast z changes across a cross section y = c. KMA252 Vector Calculus.nb 11 Alternatively, you can think of partial derivatives of z = f (x, y) as the rate at which you cross contours of f , in directions parallel to the axes. Partial Derivatives in More than Two Variables The process is simply an extension of the two variable case: hold all variables constant except for one, then differentiate with respect to the remaining variable. Example Suppose pressure in the atmosphere is given by P(x, y, z) = e-β z Pa - P1 e-αx Find all the partial derivatives of P. 2 +2 y2 . 12 KMA252 Vector Calculus.nb ∂P ∂x = 2 α x P1 e-αx ∂P ∂z = - β e-β z Pa - P1 e-αx ∂P ∂y 2 +2 y2 -β z e = 4 α y P1 e-αx 2 +2 y2 -β z e 2 +2 y2 = -βP. The Tangent Plane If z = f (x, y) is a smoothly curving surface (i.e. its partial derivatives f x and f y are continuous and well-behaved), then we expect that by looking at smaller and smaller portions of the surface it will look more and more like plane. At the global level the surface has whatever shape is described by the function, but at the local level the shape of the surface looks planar. [The flat earth community adopts the argument that what looks planar at the local level must be planar at the global level !!] X ◼ The plane will be tangent to the real surface at some particular point (x, y) = (x0 , y0 ). ◼ This plane is called the tangent plane. ◼ The tangent plane just meets the surface at the point (x, y, z) = (x0 , y0 , f (x0 , y0 )). ◼ The tangent is an approximation to the true surface z = f (x, y) near the point (x0 , y0 ). How do we find the equation of the tangent plan? We know ◼ the approximating plane must have the general form z = m x + n y + c , and ◼ the plane touches the true surface when x = x0 , y = y0 , z = f (x0 , y0 ). This implies that KMA252 Vector Calculus.nb f (x0 , y0 ) = m x0 + n y0 + c ⇒ c = f (x0 , y0 ) - m x0 - n y0 . The equation of the plane now becomes z = f (x0 , y0 ) + m(x - x 0 ) + n(y - y0 ) . We want the tangent plane to have the same slopes at (x0 , y0 ) that the real surface has, so slope in the x direction, m = and slope in the y direction, n = ∂f ∂x ∂f ∂y (x0 , y0 ) = f x (x0 , y0 ) (x0 , y0 ) = f y (x0 , y0 ) . The equation of the plane tangent to z = f (x, y) at (x0 , y0 ) becomes or z = f (x0 , y0 ) + f x (x0 , y0 ) (x - x0 ) + f y (x0 , y0 ) (y - y0 ) z = f (x0 , y0 ) + ∂f ∂ x (x0 ,y0 ) (x - x0 ) + ∂f ∂ y (x ,y ) 0 0 (y - y0 ) . Example Compute the plane tangent to the surface z = f (x, y) = x3 + y3 at the point (x0 , y0 ) = (1, 2). We begin by computing the partial derivatives: f x = 3 x2 and f y = 3 y2 . We then evaluate f , f x , f y at the expansion point (x0 , y0 ). f (1, 2) = 13 + 23 =9 f x (1, 2) = 3 x2 (1,2) = 3 So the tangent plane is f y (1, 2) = 3 y2 (1,2) = 12 z = f (x0 , y0 ) + f x (x0 , y0 ) (x - x0 ) + f y (x0 , y0 ) (y - y0 ) = 9 + 3 (x - 1) + 12 (y - 2) = 3 x + 12 y - 18 . 13 2 g