Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 1 Summary: Primer on Integral Calculus: Part I 1. Integrating over a single variable: Area under a curve Properties of integrals logs and exponentials trigonometric functions transformation of variables (substitution) integration by parts 2. Double integrals: volume under a surface region of integration transformation of variables, the Jacobian 3. Triple integrals: volume enclosed by a surface mass of a solid object transformation of variables 4. Examples:
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 2 Suggested Reading: Stewart: Calculus, 5th Edition, Brooks/Cole, Belmont, CA, 2003 (presumably this was your Calculus textbook) Chapters 5, 6 and 8. Spiegel: Theory and Problems of Advanced Calculus (Schaum Outline Series), Chapters 5 and 9. Kreyszig: Chapter 9, pages 500-565 Gradshteyn and Ryzhik: Table of Integrals, Series and Products, Academic Press, New York, 1981. ISBN: 0-12-294760-6
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 3 Figure 1: Integrating over a single variable: Let f (x) be a function of the variable x defined and piece-wise continuous over the interval a x b (see Figure 1). The function shown in the figure has discontinuities at x = c and at x = b, but is otherwise continuous. Even in the presence of a finite number of such discontinuities we can
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 4 integrate this function over the range from a to b. b a f(x)dx = c + a b f(x)dx + d d c f(x)dx f(x)dx (1) = area under curve f(x) The integral of the function f(x) is really the antiderivative of f(x), i.e., it is the function, F (x) which you must differentiate with respect to x in order to generate the function f(x). If F (x) contains a constant term (i.e., a term which does not depend on x, the process of differentiation loses that term. Thus, the integral of f(x) is uncertain to within a constant term (a term independent of x). So, if f(x) is the derivative of some function F (x), then df (x) dx = f(x) and df f(x)dx = dx dx = df = F (x) + C (2) This is an example of an indefinite integral. If you specify the integral at any one value of x then
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 5 you have determined the constant C. Thus, the previous example, where the limits of integration were specified as a and b, is an example of a definite integral. The integral of a function of a single variable x is the limit of the Cauchy-Riemann sum (see Figure 2) n S n = f(ξ i ) x i (3) i=1 where f(x) is defined and piece-wise continuous over the region a x b, x i = x i x i 1 and the sequence x i is defined so that a = x 0 < x 1 < x 2 < < x n = b. Finally, f(ξ i ) is the function f(x) evaluated at x = ξ i where x i 1 < ξ i < x i. The integral of f(x) over the interval from a to b is then b a f(x)dx = lim n n f(ξ i ) x i (4) i=1 This suggests a numerical method for evaluating integrals by computer (Simpson s rule). If α and β are any constants (i.e., not functions of the variable x), and f(x) and g(x) are integrable
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 6 Figure 2: functions of x, then I = [αf(x) + βg(x)]dx = α f(x)dx + β g(x)dx (5) In other words, the integration operation is linear. This is a simple but extremely important property of integration.
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 7 Logs and Exponentials: Consider the infinite series f(x) = n=0 x n n! the integral of this function is just x n F (x) = { n! }dx = = = = = n=0 n=0 n=0 1 x n dx (6) n! 1 x n+1 n! n + 1 + C x k + C, (k = n + 1) k! + xk k! k0 0! + C x k k! + C k=1 k=0 k=0 This rather special function (the integral of which is equal to the function itself, to within a constant)
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 8 is the exponential function e x = exp(x) = n=0 x n n! It follows that the derivative of e x is also the function itself de x dx = ex We can use the following equation as the definition of the natural logarithm, x dt ln x = 1 t Example: Use this definition of the natural log to shown that ln(a b) = ln(a) + ln(b) a b dt ln(a b) = 1 t a dt = 1 t + a dt 1 t + a dt = 1 t + = ln a + ln b a b a b 1 b 1 dt t du u dt t with u = t/a (7)
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 9 It also follows, from the fundamental theorem of calculus, that d dx ln x = 1 x since d ln x dx dx = d ln x = ln x (8) 1 = x dx (9) so that we recover the definition of ln x. The exponential function exp(x) is the inverse of the ln x. I.e., exp[ln x] = x (10) and ln[exp(x)] = x (11) It follows that, if x 1 = ln y 1 and x 2 = ln y 2, then y 1 = exp(x 1 ) and y 2 = exp(x 2 ) so that and ln(y 1 y 2 ) = ln(y 1 ) + ln(y 2 ) = x 1 + x 2 exp(x 1 + x 2 ) = y 1 y 2 = exp(x 1 ) exp(x 2 )
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 10 Figure 3: Trigonometric functions: The trigonometric functions are defined in terms of the x and y components of the vector ~r, as shown in Figure 3. y x y sin θ = cos θ = tan θ = r r x 1 1 1 sec θ = cot θ = sin θ cos θ tan θ It is important to note that the sin θ is an odd csc θ =
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 11 function of θ, i.e., sin( θ) = sin θ and, that cos θ is an even function of θ cos( θ) = cos θ Since tan θ = sin θ cos θ the function tan θ is also an odd function of θ. tan( θ) = tan θ These functions are also all periodic in their argument θ, with period 2π sin(θ + 2π) = sin θ cos(θ + 2π) = cos θ tan(θ + 2π) = tan θ In addition to these symmetry properties there are a large number of trigonometric identities which are useful for simplifying expression containing trig functions are for transforming integrals into forms more easily solved (see any trig or calculus book for these). For example, most of you will remember sin 2 x + cos 2 x = 1
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 12 The power series expansions for sin and cos are very useful and should be remembered. cos x = ( 1) n x2n (2n)! and sin x = n=0 ( 1) n x2n+1 (2n + 1)! n=0 We also define the hyperbolic trig functions x 2n+1 sinh x = (2n + 1)! and cosh x = n=0 n=0 x 2n (2n)! The hyperbolic tangent can be defined by tanh x = sinh x cosh x and so on. There are a large number of identities involving the hyperbolic trig functions as well, for example, cosh 2 x sinh 2 x = 1 You will notice the difference from the corresponding identity for the normal trig functions. Beware!
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 13 Recalling the power series for the exponential function, exp(x), exp(x) = e x x n = n! we notice immediately that n=0 exp(x) = cosh x + sinh x Similarly, introducing the imaginary number i i = 1 we find, using the series expansions, that exp(ix) = cos x + i sin x this is called the Euler formula. Notice that, since sin x and cos x are periodic functions of x, with period 2π, so is exp(ix) exp(ix + 2π) = e i(x+2π) = e ix e 2πi = e ix i.e., exp(2πi) = 1. Additionally, exp(iπ/2) = 1 = i, exp(iπ) = 1 and exp(3iπ/2) = 1 = i. You probably recall that d d sin x = cos x and cos x = sin x dx dx
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 14 If not, these can easily be proven starting from the series expansions of sin and cos. Thus, if F (x) = sin x then df (x) = f(x) = cos x dx and, by the fundamental theorem of calculus, f(x) dx = F (x) + C or, cos x dx = sin x + C In the same fashion, sin x dx = cos x + C (note the minus sign!) Transformation of variables: How do we calculate q p sin(ax) dx We used a simple substitution of variables. Let u = ax, then, du = adx or dx = du/a. Since we are changing the integration variable, we also have to change the range over which we are integrating,
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 15 i.e., we have to change the limits of integration from x = p and x = q to u = ap and u = aq. Thus, we have the new integral q p sin(ax) dx = 1 a Example: Calculate 2π 0 aq ap sin u du (12) = 1 [cos(aq) cos(ap)] a 2π 0 cos x dx cos x dx = [sin x 2π 0 = [sin(2π) sin(0)] = 0 0 = 0 The integral of either sin x or cos x over an entire period (or an integer number of periods) is precisely 0. Since cos x is also an even function of x, we have a a cos x dx = [sin x a a = [sin(a) sin( a)] = 2 sin(a) Similarly, since sin x is an odd function of x, we have a a sin x dx = [cos x a a = [cos(a) cos( a)] = 0 If the argument of sin is, for example, ax + b
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 16 then the integral π sin(ax + b) dx 0 is readily evaluated by simple change of variables to u = ax + b with du = adx π 0 sin(ax + b) dx = 1 a = 1 a aπ+b b sin u du [cos u aπ+b b (13) = 1 [cos(aπ + b) cos(b)] a You will very often see integrals of the form π 0 R(sin θ, cos θ) sin θ dθ either by itself, or as part of a double or triple integral. A very useful substitution is u = cos θ with du = d cos θ = sin θdθ. Then, this integral becomes π 0 R(sin θ, cos θ) sin θ dθ = 0 1 R( 1 u 2, u)du = 1 0 R( 1 u 2, u)du
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 17 For example π sin θ dθ = 0 1 0 du = 2 Another simple example of substitution is sin θ du tan θ dθ = cos θ dθ = u = ln u Example: Calculate π/2 π/2 cos 2 x dx Here it will be useful to use one of the familiar trigonometric identities. One of the half angle (or double angle, if you prefer) formulas is cos 2 x = 1 2 + 1 2 cos(2x) With this substitution we have π/2 π/2 cos 2 x dx = 1 2 π/2 π/2 π/2 = 1 dx + 1 2 π/2 2 = 1 2 [π 2 + π 2 ] + 1 1 2 2 [1 + cos(2x)] dx π/2 π/2 π π cos(2x) dx cos y dy = π 2 + 1 4 [sin π sin( π)] = π 2
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 18 The other half angle formula sin 2 x = 1 2 1 2 cos(2x) immediately allows us to evaluate b [ 1 sin 2 x dx = 2 x 1 sin 2x 4 a in the same manner. The trig identities sin x sin y = 1 [cos(x y) cos(x + y)] 2 sin x cos y = 1 [sin(x + y) + sin(x y)] 2 cos x cos y = 1 [cos(x y) + cos(x + y)] 2 cos x sin y = 1 [sin(x + y) sin(x y)] 2 will make it easy to evaluate integrals involving the products of sin s and cos s. You need to use your imagination sometimes. Inverse trig functions: Let y be the angle whose sin is x, then y = arcsin(x) = sin 1 π (x), 2 y π 2 b a
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 19 To evaluate the integrals of these inverse trig functions it is useful to use the definition of the integral as the anti-derivative. Then, for arcsin, x = sin y d dx (sin y) = dx dx = 1 cos y dy dx = 1 cos y = 1 sin 2 y = 1 x 2 dy dx = 1 cos y = 1 1 x 2 d or dx (arcsin x) = 1 1 x 2 Similarly, we can easily show that y = arccos x d dx (arccos x) = 1 1 x 2
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 20 and y = arctan x d d (tan y) = dx dx (sin y = cos y d dx cos y ) d (sin y) sin y dx cos 2 y = cos2 y + sin 2 y cos 2 y dy dx (cos y) = 1 dy cos 2 y dx = 1 recall that tan y = x. Then, dy dx = cos2 y = 1 sec 2 y = 1 1 + tan 2 y d 1 (arctan x) = dx 1 + x 2 On the other hand, if y = arccot x then we would have dy dx = 1 1 + x 2 etc. Having defined all of these derivatives, we can now take the anti-derivatives (i.e., the integrals) { dx = arcsin x + C, or, (14) 1 x 2 arccos x + C
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 21 and dx 1 + x = arctan x + C 2 If we make the substitution x = iy so that x 2 = y 2 we obtain dy = arctanh y + C 1 y2 so we have similar expressions for the hyperbolic trig functions. Example: Evaluate the integral dx a 2 + x 2 let ay = x, then dy = dx/a and dx a 2 + x = a dy 2 a 2 + a 2 y 2 a dy = a 2 1 + y = 1 dy 2 a 1 + y 2 = 1 a tan 1 y + C = 1 a tan 1 x a + C Transformation of variables: Formally, when we make a transformation of variables (for functions of a single variable) we are fol-
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 22 lowing the prescription f(x) f(x(u)) = F (u) where the function f(x) of the variable x is defined over some range x 1 x x 2 and the function F (u) is defined over the corresponding range of the variable u, u 1 u u 2. Then, the integral x2 x 1 f(x) dx = u2 u 1 Calculate the integral x 2 dx x 3 + 1 f(x(u)) dx du du Here, the function being integrated is f(x) = x2 x 3 + 1 If we let u = x 3 + 1, then, du = 3x 2 dx and x(u) = 1/3 u 1, and dx du = 1 (u 1) 2/3 3 Also, f(x(u)) = ( 1/3 u 1) 2 u
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 23 so the integral can be written x 2 dx x 3 + 1 = f(x) dx = ( 1/3 u 1) 2 = u = 1 3 f(x(u)) dx du du 1 3 (u 1) 2/3 du du u = 1 3 ln u + C = 1 3 ln(x3 + 1) + C In this case, and most other simple substitutions, it would have been easier to simply note that u = x 3 + 1 and 3x 2 dx = du so that du u = 1 3 ln u + C x 2 dx x 3 + 1 = 1 3 Example: Evaluate the integral sin x dx 1 sin 2 x Here the substitution u = cos x and du = d cos x = sin x dx is useful again sin x dx du 1 sin 2 x = = u 1 + C u 2 Example: Evaluate the integral x 1 + x 2 dx
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 24 Let u = 1+x 2 then du = 2x dx and the integral becomes x 1 + x 2 dx = 1 u 1 du = 2 3 u3/2 +C = 1 3 (1+x2 ) 3/2 +C Integration by Parts: The chain rule for differentiating the product of two functions is d(u v) = u dv + v du Integrating this expression we have d(u v) = u v = u dv + v du This suggests a mechanism of evaluating certain integrals where the integrand can be expressed as the product of two functions u dv = u v v du This is an extremely powerful tool. Consider the integral x 2 e x dx = u dv
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 25 if we take u = x 2, then du = 2x dx. At the same time we define dv = e x dx which means v = e x. In this fashion we have broken up the first integral into the product of the two new variables and a simpler integral x 2 e x dx = x 2 e x 2 x e x dx Of course, we still have to solve this second integral. Making a new substitution u = x so that du = dx and again dv = e x dx so that v = e x, we reduce this integral to one which we know x 2 e x dx = x 2 e x 2 x e x dx = x 2 e x 2x e x + 2 e x dx = x 2 e x 2x e x + 2e x + C Now consider the integral e x sin x dx = u dv If we let u = e x then du = e x dx leaving dv = sin x dx so that v = cos x Integration by parts then gives e x sin x dx = e x cos x + e x cos x dx
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 26 This integral looks very similar to the first so it might seem we haven t accomplished anything, but let s take one more step: e x cos x dx = u dv Here we will take u = e x, giving du = e x dx and dv = cos x dx which gives v = sin x. Then, this second integral becomes e x cos x dx = e x sin x e x sin x dx Collecting all of this together we get e x sin x dx = e x cos x+e x sin x e x sin x dx which reduces to e x sin x dx = 1 2 [sin x cos x]ex + C (the additive constant arises as always because this is an indefinite integral). Integration by parts is particularly useful for repetitive or recursive evaluation of certain classes of integrals. For example, sin n x dx = u dv
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 27 Let u = sin n 1 x and dv = sin x dx. Then, du = (n 1) cos x sin n 2 x dx and v = cos x sin n x dx = cos x sin n 1 x + (n 1) cos 2 x sin n 2 x dx Substitute cos 2 x = 1 sin 2 x to get sin n x dx = cos x sin n 1 x (n 1) sin n x dx + (n 1) sin n 2 x dx Here again we can combine the integrals in sin n x to obtain finally sin n x dx = cos x sinn 1 x n (n 1) + sin n 2 x dx n This process can be repeated again for the integral
Physics 2460 Electricity and Magnetism I, Fall 2006, Primer on Integration: Part I 28 on the right to give sin n x dx = cos x sinn 1 x n + (n 1) n [ cos x sin n 3 x n 2 + n 3 sin n 4 x dx ] n 2 This process is repeated as many times as necessary to end up with an integral which can be evaluated directly. Exercise: Evaluate the integral sin 5 x dx by parts using the results quoted above.