Calculus/Multivariable calculus

From Wikibooks, open books for an open world
Jump to: navigation, search
← Lines and Planes in Space Calculus Ordinary differential equations →
Multivariable calculus

In your previous study of calculus, we have looked at functions and their behavior. Most of these functions we have examined have been all in the form

f(x) : RR,

and only occasional examination of functions of two variables. However, the study of functions of several variables is quite rich in itself, and has applications in several fields.

We write functions of vectors - many variables - as follows:

f : RmRn

and f(x) for the function that maps a vector in Rm to a vector in Rn.

Before we can do calculus in Rn, we must familiarize ourselves with the structure of Rn. We need to know which properties of R can be extended to Rn

Topology in Rn[edit]

We are already familiar with the nature of the regular real number line, which is the set R, and the two-dimensional plane, R2. This examination of topology in Rn attempts to look at a generalization of the nature of n-dimensional spaces - R, or R23, or Rn.

Lengths and distances[edit]

If we have a vector in R2, we can calculate its length using the Pythagorean theorem. For instance, the length of the vector (2, 3) is

\sqrt{3^2+2^2}=\sqrt{13}

We can generalize this to Rn. We define a vector's length, written |x|, as the square root of the sum of the squares of each of its components. That is, if we have a vector x=(x1,...,xn),

|\mathbf{x}| = \sqrt{x_1^2+x_2^2+\cdots+x_n^2}

Now that we have established some concept of length, we can establish the distance between two vectors. We define this distance to be the length of the two vectors' difference. We write this distance d(x, y), and it is

d(\mathbf{x}, \mathbf{y}) = |\mathbf{x} - \mathbf{y}| = \sqrt{\sum{(x_i-y_i)^2}}

This distance function is sometimes referred to as a metric. Other metrics arise in different circumstances. The metric we have just defined is known as the Euclidean metric.

Open and closed balls[edit]

In R, we have the concept of an interval, in that we choose a certain number of other points about some central point. For example, the interval [-1, 1] is centered about the point 0, and includes points to the left and right of zero.

In R2 and up, the idea is a little more difficult to carry on. For R2, we need to consider points to the left, right, above, and below a certain point. This may be fine, but for R3 we need to include points in more directions.

We generalize the idea of the interval by considering all the points that are a given, fixed distance from a certain point - now we know how to calculate distances in Rn, we can make our generalization as follows, by introducing the concept of an open ball and a closed ball respectively, which are analogous to the open and closed interval respectively.

an open ball
B(\mathbf{a}, r)
is a set in the form { xRn|d(x, a) < r}
a closed ball
\overline{B}(\mathbf{a}, r)
is a set in the form { xRn|d(x, a) ≤ r}

In R, we have seen that the open ball is simply an open interval centered about the point x=a. In R2 this is a circle with no boundary, and in R3 it is a sphere with no outer surface. (What would the closed ball be?)


Boundary points[edit]

If we have some area, say a field, then the common sense notion of the boundary is the points 'next to' both the inside and outside of the field. For a set, S, we can define this rigorously by saying the boundary of the set contains all those points such that we can find points both inside and outside the set. We call the set of such points ∂S

Typically, when it exists the dimension of ∂S is one lower than the dimension of S. e.g. the boundary of a volume is a surface and the boundary of a surface is a curve.

This isn't always true; but it is true of all the sets we will be using.


A set S is bounded if there is some positive number such that we can encompass this set by a closed ball about 0. --> if every point in it is within a finite distance of the origin, i.e there exists some r>0 such that x is in S implies |x|<r.

Curves and parameterizations[edit]

If we have a function f : RRn, we say that f's image (the set {f(t) | tR} - or some subset of R) is a curve in Rn and f is its parametrization.

Parameterizations are not necessarily unique - for example, f(t) = (cos t, sin t) such that t ∈ [0, 2π) is one parametrization of the unit circle, and g(t) = (cos at, sin at) such that t ∈ [0, 2π/a) is a whole family of parameterizations of that circle.

Collision and intersection points[edit]

Say we have two different curves. It may be important to consider

  • points the two curves share - where they intersect
  • intersections which occur for the same value of t - where they collide.

Intersection points[edit]

Firstly, we have two parameterizations f(t) and g(t), and we want to find out when they intersect, this means that we want to know when the function values of each parametrization are the same. This means that we need to solve

f(t) = g(s)

because we're seeking the function values independent of the times they intersect.

For example, if we have f(t) = (t, 3t) and g(t) = (t, t2), and we want to find intersection points:

f(t) = g(s)
(t, 3t) = (s, s2)
t = s and 3t = s2

with solutions (t, s) = (0, 0) and (3, 3)

So, the two curves intersect at the points (0, 0) and (3, 3).

Collision points[edit]

However, if we want to know when the points "collide", with f(t) and g(t), we need to know when both the function values and the times are the same, so we need to solve instead

f(t) = g(t)

For example, using the same functions as before, f(t) = (t, 3t) and g(t) = (t, t2), and we want to find collision points:

f(t) = g(t)
(t, 3t) = (t, t2)
t = t and 3t = t2

which gives solutions t = 0, 3 So the collision points are (0, 0) and (3, 3).

We may want to do this to actually model physical problems, such as in ballistics.

Continuity and differentiability[edit]

If we have a parametrization f : RRn, which is built up out of component functions in the form f(t) = (f1(t),...,fn(t)), f is continuous if and only if each component function is also.

In this case the derivative of f(t) is

ai = (f1′(t),...,fn′(t)). This is actually a specific consequence of a more general fact we will see later.


Tangent vectors[edit]

Recall in single-variable calculus that on a curve, at a certain point, we can draw a line that is tangent to that curve at exactly at that point. This line is called a tangent. In the several variable case, we can do something similar.

We can expect the tangent vector to depend on f′(t) and we know that a line is its own tangent, so looking at a parametrised line will show us precisely how to define the tangent vector for a curve.

An arbitrary line is f(t)=at+b, with  :fi(t)=ait+bi, so

fi′(t)=ai and
f′(t)=a, which is the direction of the line, its tangent vector.

Similarly, for any curve, the tangent vector is f′(t).



Angle between curves[edit]

Inner-product-angle.png

We can then formulate the concept of the angle between two curves by considering the angle between the two tangent vectors. If two curves, parametrized by f1 and f2 intersect at some point, which means that

f1(s)=f2(t)=c,

the angle between these two curves at c is the angle between the tangent vectors f1′(s) and f2′(t) is given by

\arccos{\mathbf{f}_1^\prime(s)\cdot\mathbf{f}_2^\prime(t) \over |\mathbf{f}_1^\prime(s)||\mathbf{f}_2^\prime(t)|}

Tangent lines[edit]

With the concept of the tangent vector as being analogous to being the gradient of the line in the one variable case, we can form the idea of the tangent line. Recall that we need a point on the line and its direction.

If we want to form the tangent line to a point on the curve, say p, we have the direction of the line f′(p), so we can form the tangent line

x(t)=p+t f′(p)


Different parameterizations[edit]

One such parametrization of a curve is not necessarily unique. Curves can have several different parametrizations. For example, we already saw that the unit circle can be parametrized by g(t) = (cos at, sin at) such that t ∈ [0, 2π/a).

Generally, if f is one parametrization of a curve, and g is another, with

f(t0) = g(s0)

there is a function u(t) such that u(t0)=s0, and g'(u(t)) = f(t) near t0.

This means, in a sense, the function u(t) "speeds up" the curve, but keeps the curve's shape.

Surfaces[edit]

A surface in space can be described by the image of a function f : R2Rn. f is said to be the parametrization of that surface.

For example, consider the function

f(α, β) = α(2,1,3)+β(-1,2,0)

This describes an infinite plane in R3. If we restrict α and β to some domain, we get a parallelogram-shaped surface in R3.

Surfaces can also be described explicitly, as the graph of a function z = f(x, y) which has a standard parametrization as f(x,y)=(x, y, f(x,y)), or implictly, in the form f(x, y, z)=c.

Level sets[edit]

The concept of the level set (or contour) is an important one. If you have a function f(x, y, z), a level set in R3 is a set of the form {(x,y,z)|f(x,y,z)=c}. Each of these level sets is a surface.

Level sets can be similarly defined in any Rn

Level sets in two dimensions may be familiar from maps, or weather charts. Each line represents a level set. For example, on a map, each contour represents all the points where the height is the same. On a weather chart, the contours represent all the points where the air pressure is the same.


Limits and continuity[edit]

Before we can look at derivatives of multivariate functions, we need to look at how limits work with functions of several variables first, just like in the single variable case.

If we have a function f : RmRn, we say that f(x) approaches b (in Rn) as x approaches a (in Rm) if, for all positive ε, there is a corresponding positive number δ, |f(x)-b| < ε whenever |x-a| < δ, with xa.

This means that by making the difference between x and a smaller, we can make the difference between f(x) and b as small as we want.

If the above is true, we say

  • f(x) has limit b at a
  • \lim_{\mathbf{x}\rightarrow\mathbf{a}} \mathbf{f}(\mathbf{x}) = \mathbf{b}
  • f(x) approaches b as x approaches a
  • f(x) → b as xa

These four statements are all equivalent.

Rules[edit]

Since this is an almost identical formulation of limits in the single variable case, many of the limit rules in the one variable case are the same as in the multivariate case.

For f and g, mapping Rm to Rn, and h(x) a scalar function mapping Rm to R, with

  • f(x) → b as xa
  • g(x) → c as xa
  • h(x) → H as xa

then:

  • \lim_{\mathbf{x}\rightarrow\mathbf{a}} (\mathbf{f} + \mathbf{g}) = \mathbf{b} + \mathbf{c}
  • \lim_{\mathbf{x}\rightarrow\mathbf{a}} (h\mathbf{f}) = H\mathbf{b}

and consequently

  • \lim_{\mathbf{x}\rightarrow\mathbf{a}} (\mathbf{f}\cdot\mathbf{g}) = \mathbf{b}\cdot\mathbf{c}
  • \lim_{\mathbf{x}\rightarrow\mathbf{a}} (\mathbf{f}\times\mathbf{g}) = \mathbf{b}\times\mathbf{c}

when H≠0

  • \lim_{\mathbf{x}\rightarrow\mathbf{a}} ({\mathbf{f}\over h}) = {\mathbf{b}\over H}

Continuity[edit]

Again, we can use a similar definition to the one variable case to formulate a definition of continuity for multiple variables.

If f : RmRn, f is continuous at a point a in Rm if f(a) is defined and

\lim_{\mathbf{x}\rightarrow\mathbf{a}} \mathbf{f}(\mathbf{x}) = \mathbf{f}(\mathbf{a})

Just as for functions of one dimension, if f, g are both continuous at p, f+g, λf (for a scalar λ), f·g, and f×g are continuous also. If φ : RmR is continus at p, φf, f/φ are too if φ is never zero.

From these facts we also have that if A is some matrix which is n×m in size, with x in Rm, a function f(x)=A x is continuous in that the function can be expanded in the form x1a1+...+xmam, which can be easily verified from the points above.

If f : RmRn which is in the form f(x) = (f1(x),...,fn(x) is continuous if and only if each of its component functions are a polynomial or rational function, whenever they are defined.

Finally, if f is continuous at p, g is continuous at f(p), g(f(x)) is continuous at p.

Special note about limits[edit]

It is important to note that we can approach a point in more than one direction, and thus, the direction that we approach that point counts in our evaluation of the limit. It may be the case that a limit may exist moving in one direction, but not in another.

Differentiable functions[edit]

We will start from the one-variable definition of the derivative at a point p, namely

\lim_{x\rightarrow p} {f(x)-f(p) \over x-p} = f'(p)

Let's change above to equivalent form of

\lim_{x\rightarrow p} {f(x)-f(p)-f'(p)(x-p) \over x-p} = 0

which achieved after pulling f'(p) inside and putting it over a common denominator.

We can't divide by vectors, so this definition can't be immediately extended to the multiple variable case. Nonetheless, we don't have to: the thing we took interest in was the quotient of two small distances (magnitudes), not their other properties (like sign). It's worth noting that 'other' property of vector neglected is its direction. Now we can divide by the absolute value of a vector, so lets rewrite this definition in terms of absolute values

\lim_{x\rightarrow p} \frac{\left|f(x)-f(p)-f'(p)(x-p)\right|}{\left|  x-p\right|} = 0

Another form of formula above is obtained by letting h=x-p we have x=p+h and if x \rightarrow p, the h = x - p \rightarrow 0, so

\lim_{h\rightarrow 0} \frac{\left|f(p+h)-f(p)-f'(p)h\right|}{\left| h\right|} = 0,

where h can be thought of as a 'small change'.

So, how can we use this for the several-variable case?

If we switch all the variables over to vectors and replace the constant (which performs a linear map in one dimension) with a matrix (which denotes also a linear map), we have

\lim_{\mathbf{x}\rightarrow\mathbf{p}} {|\mathbf{f}(\mathbf{x})-\mathbf{f}(\mathbf{p})-\mathbf{A}(\mathbf{x}-\mathbf{p})| \over |\mathbf{x}-\mathbf{p}|} = 0

or

\lim_{\mathbf{h}\rightarrow\mathbf{0}} {|\mathbf{f}(\mathbf{p}+\mathbf{h})-\mathbf{f}(\mathbf{p})-\mathbf{A}\mathbf{h}| \over |\mathbf{h}|} = 0

If this limit exists for some f : RmRn, and there is a linear map A : RmRn (denoted by matrix A which is m×n), we refer to this map as being the derivative and we write it as Dp f.

A point on terminology - in referring to the action of taking the derivative (giving the linear map A), we write Dp f, but in referring to the matrix A itself, it is known as the Jacobian matrix and is also written Jp f. More on the Jacobian later.

Properties[edit]

There are a number of important properties of this formulation of the derivative.

Affine approximations[edit]

If f is differentiable at p for x close to p, |f(x)-(f(p)+A(x-p))| is small compared to |x-p|, which means that f(x) is approximately equal to f(p)+A(x-p).

We call an expression of the form g(x)+c affine, when g(x) is linear and c is a constant. f(p)+A(x-p) is an affine approximation to f(x).

Jacobian matrix and partial derivatives[edit]

The Jacobian matrix of a function is in the form

\left(J_\mathbf{p} \mathbf{f}\right)_{ij} = \left.{\partial f_i \over \partial x_j}\right|_\mathbf{p}

for a f : RmRn, Jp f' is a n×m matrix.

The consequence of this is that if f is differentiable at p, all the partial derivatives of f exist at p.

However, it is possible that all the partial derivatives of a function exist at some point yet that function is not differentiable there, so it is very important not to mix derivative (linear map) with the Jacobian (matrix) especially in situations akin to the one cited.

Continuity and differentiability[edit]

Furthermore, if all the partial derivatives exist, and are continuous in some neighbourhood of a point p, then f is differentiable at p. This has the consequence that for a function f which has its component functions built from continuous functions (such as rational functions, differentiable functions or otherwise), f is differentiable everywhere f is defined.

We use the terminology continuously differentiable for a function differentiable at p which has all its partial derivatives existing and are continuous in some neighbourhood at p.

Rules of taking Jacobians[edit]

If f : RmRn, and h(x) : RmR are differentiable at 'p':

  • J_\mathbf{p} (\mathbf{f}+\mathbf{g}) = J_\mathbf{p} \mathbf{f} + J_\mathbf{p} \mathbf{g}
  • J_\mathbf{p} (h\mathbf{f}) = hJ_\mathbf{p} \mathbf{f} + \mathbf{f}(\mathbf{p}) J_\mathbf{p} h
  • J_\mathbf{p} (\mathbf{f}\cdot \mathbf{g}) = \mathbf{g}^T J_\mathbf{p} \mathbf{f} + \mathbf{f}^T J_\mathbf{p}\mathbf{g}

Important: make sure the order is right - matrix multiplication is not commutative!

Chain rule[edit]

The chain rule for functions of several variables is as follows. For f : RmRn and g : RnRp, and g o f differentiable at p, then the Jacobian is given by

\left( J_{\mathbf{f}(\mathbf{p})} \mathbf{g}\right) \left( J_\mathbf{p} \mathbf{f}\right)

Again, we have matrix multiplication, so one must preserve this exact order. Compositions in one order may be defined, but not necessarily in the other way.


Alternate notations[edit]

For simplicity, we will often use various standard abbreviations, so we can write most of the formulae on one line. This can make it easier to see the important details.

We can abbreviate partial differentials with a subscript, e.g.,

\partial_x h(x,y)= \frac{\partial h}{\partial x} \quad \partial_x \partial_y h= \partial_y \partial_x h

When we are using a subscript this way we will generally use the Heaviside D rather than ∂,

D_x h(x,y)= \frac{\partial h}{\partial x} 
\quad D_x D_y h= D_y D_x h

Mostly, to make the formulae even more compact, we will put the subscript on the function itself.

D_x h= h_x \quad h_{xy}=h_{yx}

If we are using subscripts to label the axes, x1, x2 …, then, rather than having two layers of subscripts, we will use the number as the subscript.

h_1 = D_1 h = \partial_1 h = \partial_{x_1}h = \frac{\partial h}{\partial x_1}

We can also use subscripts for the components of a vector function, u=(ux, uy, uy) or u=(u1,u2un)

If we are using subscripts for both the components of a vector and for partial derivatives we will separate them with a comma.

u_{x,y}=\frac{\partial u_x}{\partial y}

The most widely used notation is hx. Both h1 and ∂1h are also quite widely used whenever the axes are numbered. The notation ∂xh is used least frequently.

We will use whichever notation best suits the equation we are working with.

Directional derivatives[edit]

Normally, a partial derivative of a function with respect to one of its variables, say, xj, takes the derivative of that "slice" of that function parallel to the xj'th axis.

More precisely, we can think of cutting a function f(x1,...,xn) in space along the xj'th axis, with keeping everything but the xj variable constant.

From the definition, we have the partial derivative at a point p of the function along this slice as

{\partial \mathbf{f} \over \partial x_j} = \lim_{t\rightarrow 0} {\mathbf{f}(\mathbf{p}+t\mathbf{e}_j) - \mathbf{f}(\mathbf{p}) \over t}

provided this limit exists.

Instead of the basis vector, which corresponds to taking the derivative along that axis, we can pick a vector in any direction (which we usually take as being a unit vector), and we take the directional derivative of a function as

{\partial \mathbf{f} \over \partial \mathbf{d}} = \lim_{t\rightarrow 0} {\mathbf{f}(\mathbf{p}+t\mathbf{d}) - \mathbf{f}(\mathbf{p}) \over t}

where d is the direction vector.

If we want to calculate directional derivatives, calculating them from the limit definition is rather painful, but, we have the following: if f : RnR is differentiable at a point p, |p|=1,

{\partial \mathbf{f} \over \partial \mathbf{d}} = D_\mathbf{p} \mathbf{f}(\mathbf{d})

There is a closely related formulation which we'll look at in the next section.

Gradient vectors[edit]

The partial derivatives of a scalar tell us how much it changes if we move along one of the axes. What if we move in a different direction?

We'll call the scalar f, and consider what happens if we move an infintesimal direction dr=(dx,dy,dz), using the chain rule.

\mathbf{df}=dx\frac{\partial f}{\partial x} + 
dy\frac{\partial f}{\partial y}+dz\frac{\partial f}{\partial z}

This is the dot product of dr with a vector whose components are the partial derivatives of f, called the gradient of f

\operatorname{grad} \mathbf{f} = \nabla \mathbf{f} = 
\left(\frac{\partial \mathbf{f}(\mathbf{p})}{\partial x_1},\cdots,
\frac{\partial \mathbf{f}(\mathbf{p})}{\partial x_n}\right)

We can form directional derivatives at a point p, in the direction d then by taking the dot product of the gradient with d

{\partial \mathbf{f}(\mathbf{p}) \over \partial \mathbf{d}} =\mathbf{d} \cdot \nabla \mathbf{f}(\mathbf{p}).

Notice that grad f looks like a vector multiplied by a scalar. This particular combination of partial derivatives is commonplace, so we abbreviate it to

\nabla = \left( \frac{\partial }{\partial x}, 
\frac{\partial }{\partial y}, \frac{\partial }{\partial z}\right)

We can write the action of taking the gradient vector by writing this as an operator. Recall that in the one-variable case we can write d/dx for the action of taking the derivative with respect to x. This case is similar, but acts like a vector.

We can also write the action of taking the gradient vector as:

\nabla  = \left( \frac{\partial }{\partial x_1},
\frac{\partial }{\partial x_2}, \cdots \frac{\partial }{\partial x_n}\right)

Properties of the gradient vector[edit]

Geometry[edit]
  • Grad f(p) is a vector pointing in the direction of steepest slope of f. |grad f(p)| is the rate of change of that slope at that point.

For example, if we consider h(x, y)=x2+y2. The level sets of h are concentric circles, centred on the origin, and

 \nabla h = (h_x,h_y) = 2(x,y)= 2 \mathbf{r}

grad h points directly away from the origin, at right angles to the contours.

  • Along a level set, (∇f)(p) is perpendicular to the level set {x|f(x)=f(p) at x=p}.

If dr points along the contours of f, where the function is constant, then df will be zero. Since df is a dot product, that means that the two vectors, df and grad f, must be at right angles, i.e. the gradient is at right angles to the contours.

Algebraic properties[edit]

Like d/dx, ∇ is linear. For any pair of constants, a and b, and any pair of scalar functions, f and g

\frac{d}{dx} (af+bg)= a\frac{d}{dx}f + b\frac{d}{dx}g 
\quad \nabla (af+bg) = a \nabla f + b \nabla g

Since it's a vector, we can try taking its dot and cross product with other vectors, and with itself.

Divergence[edit]

If the vector function u maps Rn to itself, then we can take the dot product of u and ∇. This dot product is called the divergence.

\operatorname{div}\, \mathbf{u} = \nabla \cdot \mathbf{u} = 
\frac{\partial u_1}{\partial x_1} + \frac{\partial u_2}{\partial x_2} + \cdots \frac{\partial u_n}{\partial x_n}

If we look at a vector function like v=(1+x2,xy) we can see that to the left of the origin all the v vectors are converging towards the origin, but on the right they are diverging away from it.

Div u tells us how much u is converging or diverging. It is positive when the vector is diverging from some point, and negative when the vector is converging on that point.

Example:
For v=(1+x2, xy), div v=3x, which is positive to the right of the origin, where v is diverging, and negative to the left of the origin, where v is converging.

Like grad, div is linear.

\nabla \cdot \left( a\mathbf{u}+b\mathbf{v} \right) = 
a\nabla \cdot \mathbf{u}  + b\nabla \cdot \mathbf{v}

Later in this chapter we will see how the divergence of a vector function can be integrated to tell us more about the behaviour of that function.

To find the divergence we took the dot product of and a vector with on the left. If we reverse the order we get

\mathbf{u} \cdot \nabla = u_x D_x + u_y D_y + u_z D_z

To see what this means consider i· This is Dx, the partial differential in the i direction. Similarly, u· is the partial differential in the u direction, multiplied by |u|

Curl[edit]

If u is a three-dimensional vector function on R3 then we can take its cross product with ∇. This cross product is called the curl.

\operatorname{curl}\,\mathbf{u} = \nabla \times \mathbf{u} 
=\begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 
D_x & D_y & D_z \\ u_x & u_y & u_z \end{vmatrix}

Curl u tells us if the vector u is rotating round a point. The direction of curl u is the axis of rotation.

We can treat vectors in two dimensions as a special case of three dimensions, with uz=0 and Dzu=0. We can then extend the definition of curl u to two-dimensional vectors

\operatorname{curl}\,\mathbf{u} = D_y u_x-D_x u_y

This two dimensional curl is a scalar. In four, or more, dimensions there is no vector equivalent to the curl.

Example:
Consider u=(-y, x). These vectors are tangent to circles centred on the origin, so appear to be rotating around it anticlockwise.

\operatorname{curl}\,\mathbf{u} = D_y(-y)-D_x x= -2

Example
Consider u=(-y, x-z, y), which is similar to the previous example.

\operatorname{curl}\,\mathbf{u} = 
\begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 
D_x & D_y & D_z \\ -y & x-z & y \end{vmatrix}
=2\mathbf{i} + 2\mathbf{k}

This u is rotating round the axis i+k

Later in this chapter we will see how the curl of a vector function can be integrated to tell us more about the behaviour of that function.

Product and chain rules[edit]

Just as with ordinary differentiation, there are product rules for grad, div and curl.

  • If g is a scalar and v is a vector, then
the divergence of gv is
\nabla \cdot (g\mathbf{v})=g \nabla \cdot \mathbf{v} + (\mathbf{v} \cdot \nabla) g
the curl of gv is
\nabla \times (g\mathbf{v}) = g(\nabla \times \mathbf{v})+

(\nabla g) \times \mathbf{v}
  • If u and v are both vectors then
the gradient of their dot product is
\nabla ( \mathbf{u} \cdot \mathbf{v} ) = 
\mathbf{u} \times (\nabla \times \mathbf{v} ) + 
\mathbf{v} \times (\nabla \times \mathbf{u} ) + 
(\mathbf{u} \cdot \nabla) \mathbf{v} + (\mathbf{v} \cdot \nabla) \mathbf{u}
the divergence of their cross product is
\nabla \cdot ( \mathbf{u} \times \mathbf{v} ) =
\mathbf{v}\cdot ( \nabla \times \mathbf{u} ) -
\mathbf{u}\cdot ( \nabla \times \mathbf{v} )
the curl of their cross product is
\nabla \times ( \mathbf{u} \times \mathbf{v} ) =
(\mathbf{v} \cdot \nabla ) \mathbf{u} - (\mathbf{u} \cdot \nabla) \mathbf{v}
+ \mathbf{u}(\nabla \cdot \mathbf{v}) - \mathbf{v}(\nabla \cdot \mathbf{u})


We can also write chain rules. In the general case, when both functions are vectors and the composition is defined, we can use the Jacobian defined earlier.

 
\left. \nabla \mathbf{u}(\mathbf{v}) \right|_{\mathbf{r}}=
\mathbf{J}_{\mathbf{v}} \left. \nabla \mathbf{v} \right|_{\mathbf{r}}

where Ju is the Jacobian of u at the point v.

Normally J is a matrix but if either the range or the domain of u is R1 then it becomes a vector. In these special cases we can compactly write the chain rule using only vector notation.

  • If g is a scalar function of a vector and h is a scalar function of g then
\nabla h(g) = \frac{dh}{dg} \nabla g
  • If g is a scalar function of a vector then
\nabla = (\nabla g) \frac{d}{dg}

This substitution can be made in any of the equations containing

Second order differentials[edit]

We can also consider dot and cross products of with itself, whenever they can be defined. Once we know how to simplify products of two ∇'s we'll know out to simplify products with three or more.

The divergence of the gradient of a scalar f is

 \nabla^2 f(x_1,x_2,\ldots x_n) = \frac{\partial^2 f}{\partial x_1^2}+
\frac{\partial^2 f}{\partial x_2^2}+\ldots+\frac{\partial^2 f}{\partial x_n^2}

This combination of derivatives is the Laplacian of f. It is commmonplace in physics and multidimensional calculus because of its simplicity and symmetry.

We can also take the Laplacian of a vector,

 \nabla^2 \mathbf{u}(x_1,x_2,\ldots x_n) = 
\frac{\partial^2 \mathbf{u}}{\partial x_1^2}+ 
\frac{\partial^2 \mathbf{u}}{\partial x_2^2}+ \ldots +
\frac{\partial^2 \mathbf{u}}{\partial x_n^2}

The Laplacian of a vector is not the same as the divergence of its gradient

\nabla (\nabla \cdot \mathbf{u})- \nabla^2 \mathbf{u}=
\nabla \times (\nabla \times \mathbf{u})

Both the curl of the gradient and the divergence of the curl are always zero.

\nabla \times \nabla f=0 \quad \nabla \cdot (\nabla \times \mathbf{u})=0

This pair of rules will prove useful.

Integration[edit]

We have already considered differentiation of functions of more than one variable, which leads us to consider how we can meaningfully look at integration.

In the single variable case, we interpret the definite integral of a function to mean the area under the function. There is a similar interpretation in the multiple variable case: for example, if we have a paraboloid in R3, we may want to look at the integral of that paraboloid over some region of the xy plane, which will be the volume under that curve and inside that region.

Riemann sums[edit]

When looking at these forms of integrals, we look at the Riemann sum. Recall in the one-variable case we divide the interval we are integrating over into rectangles and summing the areas of these rectangles as their widths get smaller and smaller. For the multiple-variable case, we need to do something similar, but the problem arises how to split up R2, or R3, for instance.

To do this, we extend the concept of the interval, and consider what we call a n-interval. An n-interval is a set of points in some rectangular region with sides of some fixed width in each dimension, that is, a set in the form {xRn|aixibi with i = 0,...,n}, and its area/size/volume (which we simply call its measure to avoid confusion) is the product of the lengths of all its sides.

So, an n-interval in R2 could be some rectangular partition of the plane, such as {(x,y) | x ∈ [0,1] and y ∈ [0, 2]|}. Its measure is 2.

If we are to consider the Riemann sum now in terms of sub-n-intervals of a region Ω, it is

\sum_{i; S_i \subset \Omega} f(x^*_i)m(S_i)

where m(Si) is the measure of the division of Ω into k sub-n-intervals Si, and x*i is a point in Si. The index is important - we only perform the sum where Si falls completely within Ω - any Si that is not completely contained in Ω we ignore.

As we take the limit as k goes to infinity, that is, we divide up Ω into finer and finer sub-n-intervals, and this sum is the same no matter how we divide up Ω, we get the integral of f over Ω which we write

\int_\Omega f

For two dimensions, we may write

\int\int_\Omega f

and likewise for n dimensions.

Iterated integrals[edit]

Thankfully, we need not always work with Riemann sums every time we want to calculate an integral in more than one variable. There are some results that make life a bit easier for us.

For R2, if we have some region bounded between two functions of the other variable (so two functions in the form f(x) = y, or f(y) = x), between a constant boundary (so, between x = a and x =b or y = a and y = b), we have

\int_a^b\,\int_{f(x)}^{g(x)} h(x,y)\,dy dx

An important theorem (called Fubini's theorem) assures us that this integral is the same as

\int\int_\Omega f,

if f is continuous on the domain of integration.

Order of integration[edit]

In some cases the first integral of the entire iterated integral is difficult or impossible to solve, therefore, it can be to our advantage to change the order of integration.

\int_a^b\,\int_{f(x)}^{g(x)} h(x,y)\,dx dy

\int_c^d\,\int_{e(y)}^{f(y)} h(x,y)\,dy dx

As of the writing of this, there is no set method to change an order of integration from dxdy to dydx or some other variable. Although, it is possible to change the order of integration in an x and y simple integration by simply switching the limits of integration around also, in non-simple x and y integrations the best method as of yet is to recreate the limits of the integration from the graph of the limits of integration.

In higher order integration that can't be graphed, the process can be very tedious. For example, dxdydz can be written into dzdydx, but first dxdydz must be switched to dydxdz and then to dydzdx and then to dzdydx (as 3-dimensional cases can be graphed, this method would lack parsimony).

Parametric integrals[edit]

If we have a vector function, u, of a scalar parameter, s, we can integrate with respect to s simply by integrating each component of u separately.

\mathbf{v}(s)=\int \mathbf{u}(s)\,ds \Rightarrow v_i(s)=\int u_i(s)\,ds

Similarly, if u is given a function of vector of parameters, s, lying in Rn, integration with respect to the parameters reduces to a multiple integral of each component.

Line integrals[edit]

Line-Integral.gif In one dimension, saying we are integrating from a to b uniquely specifies the integral.

In higher dimensions, saying we are integrating from a to b is not sufficient. In general, we must also specify the path taken between a and b.

We can then write the integrand as a function of the arclength along the curve, and integrate by components.

E.g., given a scalar function h(r) we write

\int_C h(\mathbf{r}) \, d\mathbf{r} = 
\int_C h(\mathbf{r}) \frac{d\mathbf{r}}{ds}\,ds =
\int_C h(\mathbf{r}(s)) \mathbf{t}(s) \, ds

where C is the curve being integrated along, and t is the unit vector tangent to the curve.

There are some particularly natural ways to integrate a vector function, u, along a curve,

\int_C \mathbf{u}\, ds \quad 
\int_C \mathbf{u} \cdot d\mathbf{r} \quad 
\int_C \mathbf{u} \times d\mathbf{r} \quad 
\int_C \mathbf{u} \cdot \,\mathbf{n} ds

where the third possibility only applies in 3 dimensions.

Again, these integrals can all be written as integrals with respect to the arclength, s.


\int_C  \mathbf{u} \cdot d\mathbf{r} = \int_C  \mathbf{u} \cdot \mathbf{t} \, ds
\quad 
\int_C \mathbf{u} \times d\mathbf{r} = \int_C \mathbf{u} \times \mathbf{t}\, ds
\quad

If the curve is planar and u a vector lying in the same plane, the second integral can be usefully rewritten. Say,

\mathbf{u}=u_t \mathbf{t}+u_n \mathbf{n} + u_b \mathbf{b}

where t, n, and b are the tangent, normal, and binormal vectors uniquely defined by the curve.

Then

\mathbf{u} \times \mathbf{t}= -\mathbf{b} u_n + \mathbf{n} u_b

For the 2-d curves specified b is the constant unit vector normal to their plane, and ub is always zero.

Therefore, for such curves,

\int_C \mathbf{u} \times d\mathbf{r} =
\int_C \mathbf{u} \cdot \,\mathbf{n} ds

Green's Theorem[edit]

Green's-theorem-simple-region.svg

Let C be a piecewise smooth, simple closed curve that bounds a region S on the Cartesian plane. If two function M(x,y) and N(x,y) are continuous and their partial derivatives are continuous, then

\int \int_S  (\frac{\partial N}{\partial x} - \frac{\partial M}{\partial y})  dA = \oint_C M dx + N dy = \oint_C \mathbf{F} \cdot d\mathbf{r}

In order for Green's theorem to work there must be no singularities in the vector field within the boundaries of the curve.

Green's theorem works by summing the circulation in each infinitesimal segment of area enclosed within the curve.

Inverting differentials[edit]

We can use line integrals to calculate functions with specified divergence, gradient, or curl.

  • If grad V = u
V(\mathbf{p})=\int_{\mathbf{p}_0}^{\mathbf{p}} \mathbf{u} \cdot d\mathbf{r} + h(\mathbf{p})
where h is any function of zero gradient and curl u must be zero.
  • If div u = V
\mathbf{u}(\mathbf{p}) =\int_{\mathbf{p}_0}^{\mathbf{p}} V \, d\mathbf{r} + \mathbf{w}(\mathbf{p})
where w is any function of zero divergence.
  • If curl u = v
\mathbf{u}(\mathbf{p}) =
\frac{1}{2}\int_{\mathbf{p}_0}^{\mathbf{p}} \mathbf{v} \times d\mathbf{r} + \mathbf{w}(\mathbf{p})
where w is any function of zero curl.

For example, if V=r2 then

\operatorname{grad} V = 2(x, y, z) = 2 \mathbf{r}

and

\begin{matrix}
\int_{\mathbf{0}}^{\mathbf{r}} 2\mathbf{u} \cdot d\mathbf{u} & = & \int_{\mathbf{0}}^{\mathbf{r}} 2 \left( udu + vdv+ wdw \right) \\
& = & \left[ u^2 \right]_{\mathbf{0}}^{\mathbf{r}} + 
\left[ v^2 \right]_{\mathbf{0}}^{\mathbf{r}} +
\left[ w^2 \right]_{\mathbf{0}}^{\mathbf{r}} \\
& = & x^2 + y^2 + z^2 = r^2\\
\end{matrix}

so this line integral of the gradient gives the original function.

Similarly, if v=k then

\mathbf{u}(\mathbf{p}) =
\int_{\mathbf{p}_0}^{\mathbf{p}}  \mathbf{k} \times d\mathbf{r}

Consider any curve from 0 to p=(x, y', z), given by r=r(s) with r(0)=0 and r(S)=p for some S, and do the above integral along that curve.

\begin{matrix}
\mathbf{u}(\mathbf{p}) & = & 
\int_0^S  \mathbf{k} \times \frac{d\mathbf{r}}{ds} \, ds \\ & = & 
\int_0^S \left( \frac{dr_x}{ds} \mathbf{j}-\frac{dr_y}{ds} \mathbf{i} \right) \, ds \\ & = & 
\mathbf{j} \int_0^S \frac{dr_x}{ds} \, ds - 
\mathbf{i} \int_0^S \frac{dr_y}{ds} \, ds \\ 
& = & \mathbf{j} [r_x(s)]^S_0 - \mathbf{i} [r_y(s)]^S_0 \\ 
& = & p_x\mathbf{j} - p_y \mathbf{i} =  x\mathbf{j} - y \mathbf{i}
\end{matrix}

and curl u is


\frac{1}{2}\begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
D_x & D_y & D_z \\
-y & x & 0
\end{vmatrix} = \mathbf{k} = \mathbf{v}

as expected.

We will soon see that these three integrals do not depend on the path, apart from a constant.

Surface and Volume Integrals[edit]

Just as with curves, it is possible to parameterise surfaces then integrate over those parameters without regard to geometry of the surface.

That is, to integrate a scalar function V over a surface A parameterised by r and s we calculate

\int_A V(x,y,z) \, dS = \int \int_A V(r,s) \det J \, dr ds

where J is the Jacobian of the transformation to the parameters.

To integrate a vector this way, we integrate each component separately.

However, in three dimensions, every surface has an associated normal vector n, which can be used in integration. We write dS=ndS.

For a scalar function, V, and a vector function, v, this gives us the integrals

\int_A V \, \mathbf{dS} \quad \int_A  \mathbf{v} \cdot \mathbf{dS}
\quad \int_A  \mathbf{v} \times \mathbf{dS}

These integrals can be reduced to parametric integrals but, written this way, it is clear that they reflect more of the geometry of the surface.

When working in three dimensions, dV is a scalar, so there is only one option for integrals over volumes.

Gauss's divergence theorem[edit]

Divergence theorem.svg

We know that, in one dimension,

\int_a^b Df dx = f|_a^b

Integration is the inverse of differentiation, so integrating the differential of a function returns the original function.

This can be extended to two or more dimensions in a natural way, drawing on the analogies between single variable and multivariable calculus.

The analog of D is ∇, so we should consider cases where the integrand is a divergence.

Instead of integrating over a one-dimensional interval, we need to integrate over a n-dimensional volume.

In one dimension, the integral depends on the values at the edges of the interval, so we expect the result to be connected with values on the boundary.

This suggests a theorem of the form,

\int_V \nabla \cdot  \mathbf{u} \, dV = 
\int_{\partial V} \mathbf{n} \cdot  \mathbf{u} dS

This is indeed true, for vector fields in any number of dimensions.

This is called Gauss's theorem.

There are two other, closely related, theorems for grad and curl:

  • \int_V \nabla u \, dV = 
\int_{\partial V} u \mathbf{n} dS ,
  • \int_V \nabla \times  \mathbf{u} \, dV = 
\int_{\partial V} \mathbf{n} \times  \mathbf{u} dS ,

with the last theorem only being valid where curl is defined.

Stokes' curl theorem[edit]

Stokes' Theorem.svg

These theorems also hold in two dimensions, where they relate surface and line integrals. Gauss's divergence theorem becomes

\int_S \nabla \cdot  \mathbf{u} \, dS = 
\oint_{\partial S} \mathbf{n} \cdot  \mathbf{u}\, ds

where s is arclength along the boundary curve and the vector n is the unit normal to the curve that lies in the surface S, i.e. in the tangent plane of the surface at its boundary, which is not necessarily the same as the unit normal associated with the boundary curve itself.

Similarly, we get

\int_S \nabla \times  \mathbf{u} \, dS = 
\int_C \mathbf{n} \times  \mathbf{u} ds \quad (1),

where C is the boundary of S

In this case the integral does not depend on the surface S.

To see this, suppose we have different surfaces, S1 and S2, spanning the same curve C, then by switching the direction of the normal on one of the surfaces we can write

 \int_{S_1+S_2} \nabla \times  \mathbf{u} \, dS =
\int_S \nabla \times  \mathbf{u} \, dS - \int_S \nabla \times  \mathbf{u} \, dS 
\quad (2)

The left hand side is an integral over a closed surface bounding some volume V so we can use Gauss's divergence theorem.

 \int_{S_1+S_2} \nabla \times  \mathbf{u} \, dS =
\int_V \nabla \cdot \nabla \times  \mathbf{u} \, dV

but we know this integrand is always zero so the right hand side of (2) must always be zero, i.e. the integral is independent of the surface.

This means we can choose the surface so that the normal to the curve lying in the surface is the same as the curves intrinsic normal.

Then, if u itself lies in the surface, we can write

\mathbf{u}=\left( \mathbf{u} \cdot \mathbf{n} \right) \mathbf{n} + 
\left( \mathbf{u} \cdot \mathbf{t} \right) \mathbf{t}

just as we did for line integrals in the plane earlier, and substitute this into (1) to get

\int_S \nabla \times  \mathbf{u} \, dS = 
\int_C \mathbf{u} \cdot d\mathbf{r}

This is Stokes' curl theorem