Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
These notes cover all of the mathematical background that you will need to Ph 1b and Ph 1c.
Trigonometry
Notation
A 2D vector A may be written in Cartesian coordinates as
A = Ax x + A y
A = A1 x + A2
A = Ax, A y
(1)
(2)
(3)
A = Ax x + A y
A = A1 x + A2
y + Az z
y + A3 z
A = Ax, A y, Az
A = A x x + A y y + A z z is A =
(4)
(5)
(6)
Definitions that appear for the first time are denoted by triple equal signs.
Vectors are denoted by an overfixed arrow (Ex: A). Unit vectors (vectors with norm 1) are denoted by an overfixed
written as f [x]. Therefore, Sin 2 = 1 and ArcTan[1] = 4 . The benefit is that you can type this code directly into
Mathematica and evaluate it
Sin
A B = Ax Bx + A y B y + Az Bz = A B Cos[]
A B = A y Bz - Az B y x + ( Az Bx - Ax Bz ) y + Ax B y - A y Bx z = A B Sin[] n
(7)
(8)
where n is a unit vector given applying the right-hand rule to A and B. A useful neumonic to remember the cross
product is
x y z
A B = Ax A y Az
B x B y Bz
(9)
The dot product of a vector A = A x x + A y y + A z z with a unit vector equals the length of A along that unit
If A A = 0, then A = 0
either A = 0 or B = C. Counter-example: A = k , B = i, C = i +k )
Distributive over addition. That is, any vectors A, B, C satisfy A B + C = A B + A C
Calculus
The calculus portion of this bootcamp closely follows David Griffiths book Introduction to Electrodynamics
Chapter 1.
Position
r = x x + y y + z z
with norm
(10)
r = (x2 + y2 + z2 )1/2
(11)
r=
r
r
x x+ y y+z z
x2+ y2+z 2
(12)
1/2
We define the infinitesimal displacement vector from the point (x, y, z) to the point (x + x, y + y, z + z) as
s = x x + y y + z z
(13)
(We could call this r , since that is what it is, but it is useful to reserve a special letter for infinitesimal
displacements.)
Derivatives
Given a function of one variable f [x], its derivative f tells us the rate of change of f ,
f
(14)
f = x x
In other words, if we change x by an amount x, then f will change by an amount f , with the derivative being the
proportionality factor. This has a nice geometrical interpretation as the slope of the function f [x].
A function of 3 variables T[x, y, z] requires us to generalize our definition of the derivative to
T
(15)
T = x x + y y + z z
where the notation
T
x
is the partial derivative of T with respect to x (which means that y and z are treated as con-
T
x
= 4 x y,
T
y
= 2 x2 , and
T
z
= 0)). We could
T = T s
(16)
where
(17)
s = x x + y y + z z
(18)
T
x
x+
T
y
y+
T
z
T = T s Cos[]
(19)
where is the angle between the vectors T and s. So if we fix the magnitude s and rotate it around to cover all
possible directions, then the maximum change in T will occur when = 0 (which implies that s points in the
same direction as T). Therefore, a geometric interpretation of the gradient is that
(20)
(21)
Using the above expression, we also immediately see that - T is the direction of maximum decrease of the function T, and that any direction perpendicular to T will result is no change to T (i.e. this plane will have a constant T
value). Of course, all of these statements only hold for an infinitesimal displacement s .
We can write
T =
x+
T
x
y+
T
y
T
z
= x
+y
+z
T
z
=x
+y
+z
(22)
where
(23)
is the del operator. (Only this once, I will write the unit vectors on the left so that you will not misinterpret this
statement as
x
x
Note that is not a normal vector, but instead an operator that acts upon a scalar to produce a vector (so T does
not mean ordinary multiplication). In face, we know of three ways that vectors can be multiplied:
Multiply vector A by a scalar c: c A
Take the dot product of two vectors A and B: A B
Take the cross product of two vectors A and B: A B
Correspondingly, the operator can act in three ways:
On a scalar function T: T (the gradient of T)
On a vector A via the dot product: A (the divergence of A)
On a vector A via the cross product: A (the curl of A)
The gradient was discussed above, so we now focus on the other two operations.
Divergence
Ax
x
Ay
y
y+
+
z Ax x + A y y + Az z
Az
z
(24)
Note that the divergence of a vector is a scalar (and there is no such thing as the divergence of a scalar)! Geometrically, the divergence of a vector A represents how much A spreads out from any point. More precisely, if you treat A
as describing the flow of a fluid and you put an infinitesimally small volume at a point r , then the volume will empty
out in time if the divergence is positive, fill up with time if the divergence is negative, and hold the same amount of
fluid if the divergence equals zero. In other words, the divergence measures the "amount of arrow" leaving an
infinitesimal volume at each point in space, with larger arrows counting more than smaller arrows.
Critical point: In this course, we will often work with vectors which are themselves functions of position. For
example, A = x x + y y is a different vector at each point and space (and it has a positive divergence at each point in
space). We can sample different points in space to get a feel for what this looks like, as shown below. These
"vectors" are actually called vector fields.
A = x x + y y
1.0
0.5
0.0
-0.5
-1.0
-1.0
-0.5
0.0
0.5
1.0
Example
Calculate the divergence of the vector field A = x + y.
Solution
Since this is a constant vector field, the amount of arrows entering any infinitesimal volume equals the number of
arrows exiting that volume.
A=x+y
1.0
0.5
0.0
-0.5
-1.0
-1.0
-0.5
0.0
And indeed, A =
0.5
1.0
[1] +
[1] = 0, as expected.
Example
2
A = x x + y y
1
0
-1
1
-1
-1
0
1
x
x
y2
y
This plot - while correct - is extremely cluttered. Because A does not depend upon z, we can simply take a cut of
this vector field at z = 0.
2
3
A = x x + y y + z z
1.0
0.5
0.0
-0.5
-1.0
-1.0
-0.5
0.0
0.5
1.0
Consider the point (0.4, 0) shown by the black square above. There are no vectors going in or out of it in the ydirection, but there are definitely larger vectors coming out of the square than going into it. This signifies that there
will be positive divergence, in line with the result (1 + 2 y) x=0.4, y=0 = 1 found above. Similarly, the green square
around (-0.5, -0.5) has larger vectors entering it than leaving it on the top and bottom and larger vectors leaving it
than entering it on its sides. These two effects seem rather equal, and indeed we find (1 + 2 y) x=-0.5, y=-0.5 = 0 from
above. Lastly, the purple square centered at (-0.3, 0.7) has divergence (1 + 2 y) x=-0.3, y=0.7 = 2.4 which agrees with
the fact that larger arrows are leaving the square than entering it. This shows the geometrical description of the
divergence, but be warned: you must use an infinitesimal squares for this to be correct (I only showed a large square
here for convenience!)
Example
Compute the divergence of the vector field A =
r
r2
Solution
Because r =
x, y,z
2
1/2
x + y2 +z2
and r 2 = x2 + y2 + z2 ,
A=
x
2
2 3/2
x + y +z
y
2
x + y +z 2
3/2
(25)
z
z x2+ y2+z 23/2
(26)
x2+ y2+z 2
3/2
Therefore,
A=
Computing the first of these terms,
x
x x2+ y2+z 23/2
x
x x2+ y2+z 23/2
=
=
1
2
2 3/2
x + y +z
3 x2
2
x + y2+z 2
5/2
(27)
-2 x2+ y2+z 2
x2+ y2+z 2
5/2
By symmetry (i.e. by redefining x y, y z, and z x), the other two terms must be
y
z
z x2+ y2+z 23/2
x2-2 y2+z 2
x2+ y2+z 2
2
x + y -2 z
x2+ y2+z 2
(28)
5/2
2
(29)
5/2
and therefore
(30)
A=0
That is pretty shocking, for if we draw this vector field (taking a cut at z = 0), what do we expect for its divergence
to be?
r
A=
r2
But upon closer inspection, maybe this isnt so crazy. Lets consider the area between a circle of radius r 1 and r2
where r1 < r2 . Note that the divergence represents the amount of the arrows leaving an infinitesimal infinitesimal
volume at each point in space, and not on a finitely large circle. However in the special case where the divergence
equals 0 everywhere,that means that at each infinitesimal volume in space, the amount of arrows leaving that point
equal the amount of arrows entering it, so in this case only the amount of arrows entering a finite volume should
equal the amount of arrows leaving a finite volume. Lets check this for the donut shown above.
The arrows enter the donut all along its inner perimeter, which has length 2 r 1 , and these arrows have magnitude
1
r21
1
r22
2
.
r1
2
.
r2
So we
expect that the divergence, which equals the weight of the arrows leaving the figure minus the weight of the arrows
entering the figure, should equal
went wrong?
2
r2
2
.
r1
Since r1 < r2 , this is a negative number, and certainly not zero. So what
The problem is that we are working in 2D, rather than 3D! Indeed, in 2D the divergence is negative (in fact, it is
1
- 3 ), but in 3D we have to take into account the surface area of the inner and outer spheres. Therefore, the the
r
weight of the arrows entering the inner sphere equals 4 r 12 2 = 4 while the weight of the arrows leaving the
r1
outer sphere equals 4 r22 2 = 4 , and these two contributions do indeed cancel to leave a net 0 divergence!
r2
Great, but we still have one more mystery to solve. While it may seem reasonable that the divergence of A =
r
r2
is 0
at every point, there is one point at which this cannot be so: the origin. For at the origin, there are vectors eminating
outwards in every direction, so putting an infinitesimal sphere at the origin must surely yield a positive divergence.
In fact, as it turns out, the divergence at the origin is infinitely large, and later in the course we will quantify this
infinity explicitely to determine the electric potential from a point charge.
Curl
Ax
x
A y
y
+y
. However, there is no analogy in 2D for the curl operator. In this class we will work almost
exclusively in 3D.
A =
A x A y Az
A
A
A
= yz - zy x + zx -
(31)
Az
y + xy -
Ax
z
y
Note that the curl of a vector yields another vector. You cannot take the curl of a scalar, or a 1D or 2D vector.
Therefore, when taking the curl of a vector such as A = x + y we will always assume it is a 3D vector with zero for
its z component.
The curl measures how much a vector field "curves around" a point. If an object in your vector field would rotate
(ignore its translation and just focus on rotation) then that point has a non-zero curl. For example, considering the
motion of water in a pond, a whirlpool would be a region of large curl with the direction of the curl given by the
right-hand rule.
Example
We expect from the shape of the vector field that there will be a curl in the +z direction.
A = -y x + x y
1.0
0.5
0.0
-0.5
-1.0
-1.0
-0.5
0.0
0.5
1.0
A y
And indeed, A = yz -
A
x + zx -
Az
y + xy -
Ax
z
y
statement about the origin, but the result means more than that, since A = 2 z implies that placing a small object
at any point will result in that object rotating at the same rate (although for any point that isnt the origin the object
will also translate).
Example
A = x x + y y + z z
1
0
-1
1
-1
-1
0
1
From our formula, A = 0. Does this make sense? Looking at the plane z = 0,
A = x x + y y + z z
1.0
0.5
0.0
-0.5
-1.0
-1.0
-0.5
0.0
0.5
1.0
we see that although any small object would certainly be pushed radially outwards, it will not rotate. For example,
placing a sphere - which in the z = 0 plane is a circle - at the point (0, 1) shows that the rotation on the points in the
10
left side of the sphere will be perfectly balanced by the rotation on the points in the right side of the sphere. Because
the sphere will not rotate, its curl must be zero. This applies to a circle at any other point by the symmetry of the
vector field.
Line Integral
A line integral is an expression of the form
v l
(32)
where v is a vector function, l is the infinitesimal displacement vector, and the integral is to be carried out along a
prescribed path . If the path forms a closed loop (i.e. its two endpoints are the same), the line integral is often
denoted as
vl
(33)
At each point on the path we take the dot product of v (evaluated at that point) with the displacement l to the next
point on the path. A familiar example of a line integral is the work done by a force F : W = F l .
Example
Calculate the line integral of the function v = y2 x + 2 x (y + 1) y from the point a = (1, 1, 0) to the point
b = (2, 2, 0) along the path (1) and (2) in the figure below. What is v l for the loop that goes from a to b along
(1) and then returns along (2)?
Solution
As always, l = ( x) x + ( y) y + ( z) z. Path 1 consists of two parts: part (i) is a horizontal line segment where
y = z = 0. Thus l = ( x) x and y = 1 so that v l = x + 4 x y ( x) x = x and hence
2
(i) v l = 1 x = 1
(34)
v l = y2 x + 4 (y + 1) y ( y) y = 4 (y + 1) y. Therefore
2
(ii) v l = 1 4 ( y + 1) y = 10
(35)
Putting the two paths together, we find that along path (1),
(1) v l = (i) v l + (ii) v l = 11
(36)
On path (2), define t as a variable that will range from 1 to 2, so that x = y = t along path (2). Then x = y = t
and z = 0 so that l = ( t) x + ( t) y and v l = t 2 x + 2 t (t + 1) y ( t) x + ( t) y = 3 t 2 + 2 t t. Thus
11
(37)
For the loop that goes out through (1) and comes back through path (2),
v l = (1) v l - (2) v l = 1
(38)
If we considered the loop in the reverse direction (out through path (2) and back through path (1)) then we would
have gotten the negative of this answer, so make sure to keep your orientation straight!
Surface Integral
A surface integral is an expression of the form
S v a
(39)
where v is again some vector function, and a is an infinitesimal patch of area, with direction perpendicular to the
surface, as shown in the figure below.
There are, of course, two directions perpendicular to any surface, so the sign of a surface integral is intrinsically
ambiguous. If the surface is closed (forming a "balloon"), then a surface integral may be written as
v a
(40)
By convention, the direciton "outward" is treated as positive for closed surfaces, but for closed surfaces it is arbi
trary. If v describes the flow of a fluid (mass per unit area per unit time), then S v a represents the total mass per
unit time passing through the surface - hence its alternative name, flux.
Example
Calculate the surface integral of v = 2 x z x + (x + 2) y + y z2 - 3 z over the square area shown below bounded by
the points (2, 0, 0), (2, 2, 0), (2, 2, 2), and (2, 0, 2). Let the direction + x denote the positive direction.
y
1.0
1.5
2.0
0.5
0.0
2.0
1.5
1.0
z
0.5
0.0
0
1
x
2
3
Solution
For this surface, x = 2 and a = y z x so that v a = 4 z y z. Therefore, the surface integral equals
12
2 2
S v a = 0 0 4 z y z = 16
(41)
Had we chosen the - x to denote the positive direction for the integral, we would have found the negative of this
answer.
Volume Integral
A volume integral is an expression of the form
(42)
T
where T is a scalar function and dr is an infinitesimal volume element. In Cartesian coordinates,
(43)
= x y z
For example, if T is the density of a substance (which might vary from point to point), then the volume integral
would give the total mass. You can also take the volume integral of a vector function
A = x A x + y A y + z A z
(44)
where the unit vectors come outside the integrals because they are constant.
Example
Calculate the volume integral of T = x y z2 over the prism shown below.
Solution
This is just plain calculus, but you need to keep track of your variable ranges carefully to ensure that you cover the
entire figure. You can take the integrals in any order (and doing so in multiple ways is often a great way to check
your work),
3
11
2
2
1- y
2
T = 0 z 0 y 0
= 0 z2 0
3 1
24
= 0
=
x x y z
y ( y - 1)2 y z
(45)
z z
3
8
1
3
cone whose base of radius r is centered about (0, 0, 0) and whose apex is at (0, 0, h).
13
Solution
The volume equals the volume integral of the constant function 1 over the entire cone. Taking slices of thickness z
along the z-axis,
1/2
z 2
z
2
2
h 1- r 1- h r - y
= 0 -1-hz r
1/2 x
z 2
-1- r2- y2
h
y z
(46)
z 2
= 0 1 - h r2 z
=
1
3
r 2 h3
z
We could also be a bit more clever and know that the bases will be (first order) cylinders with radius 1 - h r and
height z, and then just skip to the second step. Alternatively, we could do the calculation in Mathematica,
Integrate1, {z, 0, h}, y, - 1 -
1
3
z
h
r, 1 -
z
h
r, x, -
1-
z
h
r2 - y2 ,
1-
z
h
h r2
1
A very similar calculation shows that the volume of any prism with base area A and height h has volume 3 A h. If we
orient the prism so that its base lies at z = 0 and its tip at z = h, then from the second line in (46) we find that its
z 2
area at height z [0, h] equals A 1 - h . (One factor of 1 - h comes from contracting the base in the x-direction
and another from contracting the base in the y-direction.) Therefore the volume equals
z 2
V = 0 A 1 - h z
=
1
3
Ah
(47)
as desired.
Coordinate Systems
2D Polar Coordinates
A generic 2D vector in Cartesian coordinates is
A = Ax i + A y j
(48)
A = r Cos[] i + r Sin[] j
(49)
14
where
r=
A2x + A2y
A
= ArcTan Ay
x
(50)
(51)
When doing 2D integrals in Cartesian coordinates, we are familiar with the area element x y. We use this when
computing an integral f [x, y] x y. But where does x y come from? If we consider a generic point (x, y) and
infinitesimally displace it in the x-direction and y-direction by x and y, respectively, we find the points
(x + x, y), (x, y + y), and (x + x, y + y). What is the area of the region encompassed by these points? Simply
x y!
The situation is slightly more complicated for polar coordinates. Consider a generic point (r, ) and the infinitesimally displaced points found when we vary the first coordinate by r and the second coordinate by . Thus we
have four points (r, ), (r + r, ), (r, + ), and (r + r, + ). As shown in the figure below, the element of
this infinitesimal area equals ( r) (r ) = r r . Thus,
(52)
What does this imply? If we integrate f [r, ] over a region in polar coordinates, then the integral must take the form
f [r, ] r r
Example
Compute the area of a region R enclosed by the curve r [] and the rays = a and = b where 0 < b - a 2 .
(53)
15
Solution
To compute an area, we set f [r, ] = 1 in equation (53) and find the area
b r[]
a 0
r r =
1 b
r[]2
2 a
(54)
Solution
Orienting our ellipse as in the figure above, the equation of an ellipse is
x2
a2
y2
b2
(55)
=1
r2 Sin[]2
b2
(56)
=1
1 2
2
r []
2 0
r []2 =
1
Cos[]2
a2
Sin[]2
a2 b2
b Cos[]2+a2 Sin[]2
2
(57)
b2
Integrating over the top-half of the ellipse and multiplying by 2 (for the bottom half), the area of the ellipse equals
a2 b2
b2 Cos[]2+a2 Sin[]2
a Sin[] =
= a b ArcTan b Cos[]
=0
= a b-0 = a b
(58)
You must be very careful when taking the bounds on this integral, because of the branch cuts (i.e. the discontinuities) in ArcTan. When taking the bounds on this integral you must take the modulus of the ArcTan function so that
it becomes continuous. Moral of the story: check your answer with Mathematica (but note that even with Mathematica it is easy to get mixed up about the ArcTan branch cuts!)
16
Integrate
a2 b2
b2 Cos[]2 + a2 Sin[]2
ab
y2
b2
(59)
=1
we can integrate over the top-half of the ellipse in Cartesian coordinates (multiplying by 2 to account for the bottom
half)
a
2 -a b1 -
x2 1/2
a2
= b x 1 -
x2 1/2
a2
+ a ArcSin a
x=a
x=-a
(60)
= a b 2 - - 2 = a b
This integral is nasty, so you probably wont tackle the problem this way without Mathematica at your back.
However, it is nice to check that this method yields the same answer.
Method 3: A Clever Trick
By far the easiest way to find the area of an ellipse is to note that the equation
x2
a2
y2
b2
(61)
=1
becomes a circle if we stretch our coordinate system in the y-direction using the transformation y =
x2
a2
2
y
a2
b
a
y,
(62)
=1
This is the equation of a circle of radius a, and therefore of area a2 . An infinitesimal unit of area in our normal
b
coordinates, x y, is related to the infinitesimal unit of area in the new coordinates, x y = a x y. In other
a
words, any area that we measure in the x-y coordinate system will be b bigger than the corresponding area in the x-y
coordinate system. Therefore, the area of an ellipse in the x-y coordinate systems equals
b
a
a2 = a b.
3D Spherical Coordinates
A generic 3D vector in Cartesian coordinates is
A = A x i + A y j + Az k
(63)
(64)
where [0, 2 ) is the polar angle and [0, ] is the azimuthal angle.
Unfortunately, as seen above, physicists take the horrible convention where is the polar angle in 2D radial coordinates but is the polar angle in 3D spherical coordinates. Therefore, to regain polar coordinates from spherical
17
and then rename = . (Mathematicians, on the other hand, tend to switch the
r=
(65)
Ay
= ArcTan A
(66)
= ArcTan
1/2
A2x + A2y
Az
= ArcCos
Az
A2x + A2y + A2z
1/2
(67)
(I encourage you to verify that both of these expressions for are equal!)
In 3D Cartesian coordinates, we know that the volume element equals x y z. In spherical coordinates, we can
compute the volume element by considering a generic point (r, , ) and looking at the volume element found by
infinitesimally displacing its three coordinates by r, , and . As shown in the diagram below, the volume of
this element equals ( r) (r ) (r Sin[] ) = r 2 Sin[] r . Thus,
(68)
r d
We can also define at each point in space spherical coordinate unit vectors r , , and where r points radially
outward, points in the x-y plane along the polar angle, and points in the azimuthal direction. In certain situations, this can simplify the descriptions of systems. (For example, suppose that you had a vector associated with
each point in space that pointed radially outward with magnitude proportional to its distance from the origin. This
vector field could be described by x i + y j + z k using Cartesian coordinates or by the more intuitive r r using
spherical coordinates.) However, note that r , , and actually depend upon the location of the base point (more
precisely, they depend on and ). For example, when = 0 we find r = k but when = we find r = -k .
18
Notes:
- The unit vectors (i , j, k , r , , ) all have length 1
- Within any coordinate system, the unit vectors are all orthogonal to each other
- We always work in right-handed coordinate systems. In the language of the cross product, i j = k and r = .
3D Cylindrical Coordinates
Another 3D coordinate system that is occasionally convenient is cylindrical coordinates which has a radial distance
, a polar angle , and a height component z . Essentially, cylindrical coordinates extend 2D polar coordinates to 3D
A = Cos[] i + Sin[] j + z k
(69)
19
A2x + A2y
(70)
Ay
= ArcTan A
(71)
z = Az
(72)
As we did for spherical coordinates, we can find the volume element in cylindrical coordinates by considering a
generic point (, , z) and looking at the volume element found by infinitesimally displacing its three coordinates by
, , and z. As shown in the diagram below, the volume of this element equals ( ) ( ) ( z) = z.
Thus,
(73)
(Note that sometimes people use r instead of when using cylindrical coordinates, as in the diagram below.)
Cylindrical coordinates are useful in 3D problems with rotational symmetries about one axis, such as in this next
problem. (In problems with radial symmetry, then spherical coordinates are typically the easiest to work with.)
Example
In the "Volume Integral" section above, we computed the volume of a cone with base radius r and height h using
Cartesian coordinates. Repeat the problem using cylindrical coordinates and recover the answer V =
1
3
r 2 h.
Solution
Taking the volume integral of the constant function 1 times the volume element z,
z
h 2 1- h r
V = 0 0 0
h 21
z 2
1 - h r2
2
h
z 2
= 0 1 - h r2 z
1
= 3 r 2 h3
= 0 0
Note that in cylindrical coordinates, this integral is significantly easier to both setup and evaluate. That is the
(74)
20
reason why we use different coordinate systems: cylindrical coordinates let you utilize the symmetry of the problem.
Of course, we could have chosen to go wild and choose the z-axis to lie off the axis of the cone; the integral would
still yield the same answer, but the calculation would be significantly tougher. Many problems in physics are
ultimately solved by approaching the problem from the right perspective.