Techniques of Integration

Similar documents
Techniques of Integration

Techniques of Integration

Chapter 7 Notes, Stewart 7e. 7.1 Integration by Parts Trigonometric Integrals Evaluating sin m xcos n (x)dx...

Chapter 6. Techniques of Integration. 6.1 Differential notation

Chapter 6. Techniques of Integration. 6.1 Differential notation

f(x) g(x) = [f (x)g(x) dx + f(x)g (x)dx

Methods of Integration

Chapter 8: Techniques of Integration

Section 4.4. Using the Fundamental Theorem. Difference Equations to Differential Equations

DRAFT - Math 102 Lecture Note - Dr. Said Algarni

1.4 Techniques of Integration

Integration by Parts. MAT 126, Week 2, Thursday class. Xuntao Hu

Calculus II. George Voutsadakis 1. LSSU Math 152. Lake Superior State University. 1 Mathematics and Computer Science

Chapter 7: Techniques of Integration

VII. Techniques of Integration

Integration by Parts

Access to Science, Engineering and Agriculture: Mathematics 2 MATH00040 Chapter 4 Solutions

Math Final Exam Review

MATH 250 TOPIC 13 INTEGRATION. 13B. Constant, Sum, and Difference Rules

Techniques of Integration

Integration 1/10. Integration. Student Guidance Centre Learning Development Service

b n x n + b n 1 x n b 1 x + b 0

Math 106: Review for Exam II - SOLUTIONS

SYDE 112, LECTURE 7: Integration by Parts

Practice Problems: Integration by Parts

Module M5.5 Further integration

Lecture 5: Integrals and Applications

7.1 Integration by Parts (...or, undoing the product rule.)

Partial Fractions. June 27, In this section, we will learn to integrate another class of functions: the rational functions.

10.7 Trigonometric Equations and Inequalities

Math 181, Exam 1, Study Guide 2 Problem 1 Solution. =[17ln 5 +3(5)] [17 ln 1 +3(1)] =17ln = 17ln5+12

Lecture 4: Integrals and applications

Homework Solutions: , plus Substitutions

Ordinary Differential Equations

10.7 Trigonometric Equations and Inequalities

Chapter 13: Integrals

8.3 Partial Fraction Decomposition

Practice Differentiation Math 120 Calculus I Fall 2015

Math 106: Review for Exam II - SOLUTIONS

Integrated Calculus II Exam 1 Solutions 2/6/4

Course Notes for Calculus , Spring 2015

The Product Rule state that if f and g are differentiable functions, then

TAMU 2009 Freshman-Sophomore Math Contest

Honors AP Calculus BC Trig Integration Techniques 13 December 2013

NOTES 10: ANALYTIC TRIGONOMETRY

Calculus II Lecture Notes

f(g(x)) g (x) dx = f(u) du.

106 Chapter 5 Curve Sketching. If f(x) has a local extremum at x = a and. THEOREM Fermat s Theorem f is differentiable at a, then f (a) = 0.

CHAPTER 7: TECHNIQUES OF INTEGRATION

Week 2 Techniques of Integration

Substitutions and by Parts, Area Between Curves. Goals: The Method of Substitution Areas Integration by Parts

How might we evaluate this? Suppose that, by some good luck, we knew that. x 2 5. x 2 dx 5

MAT 132 Midterm 1 Spring 2017

Next, we ll use all of the tools we ve covered in our study of trigonometry to solve some equations.

3 Algebraic Methods. we can differentiate both sides implicitly to obtain a differential equation involving x and y:

MATH 222 SECOND SEMESTER CALCULUS

Partial Fractions. (Do you see how to work it out? Substitute u = ax + b, so du = a dx.) For example, 1 dx = ln x 7 + C, x x (x 3)(x + 1) = a

Grade: The remainder of this page has been left blank for your workings. VERSION E. Midterm E: Page 1 of 12

Sequences and Series

7.2 Trigonometric Integrals

2.4 THE CHAIN RULE THE CHAIN RULE

8.7 MacLaurin Polynomials

8.4 Partial Fractions

Calculus I Review Solutions

Math 181, Exam 2, Study Guide 2 Problem 1 Solution. 1 + dx. 1 + (cos x)2 dx. 1 + cos2 xdx. = π ( 1 + cos π 2

Calculus II Practice Test Problems for Chapter 7 Page 1 of 6

Math 10860, Honors Calculus 2

Sequences and Series. 256 Chapter 11 Sequences and Series. and then lim 1 1 = 1 0 = 1.

Graphs of Antiderivatives, Substitution Integrals

6.6 Substitution with All Basic Forms

Final Exam Review Quesitons

MATH 101: PRACTICE MIDTERM 2

The Relation between the Integral and the Derivative Graphs. Unit #10 : Graphs of Antiderivatives, Substitution Integrals

1 Introduction; Integration by Parts

Main topics for the First Midterm

5.5. The Substitution Rule

Infinite series, improper integrals, and Taylor series

7x 5 x 2 x + 2. = 7x 5. (x + 1)(x 2). 4 x

10.7 Trigonometric Equations and Inequalities

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

7.5 Partial Fractions and Integration

MATHEMATICS Lecture. 4 Chapter.8 TECHNIQUES OF INTEGRATION By Dr. Mohammed Ramidh

Section 5.5 More Integration Formula (The Substitution Method) 2 Lectures. Dr. Abdulla Eid. College of Science. MATHS 101: Calculus I

1.1 Definition of a Limit. 1.2 Computing Basic Limits. 1.3 Continuity. 1.4 Squeeze Theorem

Name: AK-Nummer: Ergänzungsprüfung January 29, 2016

Inverse Trig Functions

Chapter 2 Overview: Anti-Derivatives. As noted in the introduction, Calculus is essentially comprised of four operations.

and verify that it satisfies the differential equation:

MATH 31B: MIDTERM 2 REVIEW. sin 2 x = 1 cos(2x) dx = x 2 sin(2x) 4. + C = x 2. dx = x sin(2x) + C = x sin x cos x

PARTIAL FRACTIONS: AN INTEGRATIONIST PERSPECTIVE

4. Theory of the Integral

UNIVERSITY OF SOUTHAMPTON. A foreign language dictionary (paper version) is permitted provided it contains no notes, additions or annotations.

X. Numerical Methods

MATH Section 210

1.5 Inverse Trigonometric Functions

MA1131 Lecture 15 (2 & 3/12/2010) 77. dx dx v + udv dx. (uv) = v du dx dx + dx dx dx

Chapter 7: Trigonometric Equations and Identities

MATH 408N PRACTICE FINAL

Core Mathematics 3 Differentiation

7.3 Hyperbolic Functions Hyperbolic functions are similar to trigonometric functions, and have the following

Transcription:

0 Techniques of Integration ½¼º½ ÈÓÛ Ö Ó Ò Ò Ó Ò Functions consisting of products of the sine and cosine can be integrated by using substitution and trigonometric identities. These can sometimes be tedious, but the technique is straightforward. Some examples will suffice to explain the approach. EXAMPLE 0.. Evaluate sin 5 xdx. Rewrite the function: sin 5 xdx = sinxsin 4 xdx = sinx(sin x) dx = sinx( cos x) dx. Now use u = cosx, du = sinxdx: sinx( cos x) dx = = ( u ) du ( u +u 4 )du = u+ 3 u3 5 u5 +C = cosx+ 3 cos3 x 5 cos5 x+c. 03

04 Chapter 0 Techniques of Integration EXAMPLE 0.. Evaluate sin 6 xdx. Use sin x = ( cos(x))/ to rewrite the function: sin 6 xdx = ( cosx) (sin x) 3 3 dx = dx 8 = 3cosx+3cos x cos 3 xdx. 8 Now we have four integrals to evaluate: and dx = x 3cosxdx = 3 sinx are easy. The cos 3 x integral is like the previous example: cos 3 xdx = cosxcos xdx = = = = cosx( sin x)dx ( u )du ) (u u3 3 ( ) sinx sin3 x. 3 And finally we use another trigonometric identity, cos x = (+cos(x))/: +cos4x 3cos xdx = 3 dx = 3 ( x+ sin4x ). 4 So at long last we get sin 6 xdx = x 8 3 6 sinx ( ) sinx sin3 x + 3 ( x+ sin4x ) +C. 6 3 6 4 EXAMPLE 0..3 Evaluate sin xcos xdx. Usetheformulassin x = ( cos(x))/ and cos x = (+cos(x))/ to get: cos(x) sin xcos xdx = +cos(x) dx. The remainder is left as an exercise.

0. Trigonometric Substitutions 05 Exercises 0.. Find the antiderivatives.. sin xdx. 3. sin 4 xdx 4. 5. cos 3 xdx 6. 7. cos 3 xsin xdx 8. 9. sec xcsc xdx 0. sin 3 xdx cos xsin 3 xdx sin xcos xdx sinx(cosx) 3/ dx tan 3 xsecxdx ½¼º¾ ÌÖ ÓÒÓÑ ØÖ ËÙ Ø ØÙØ ÓÒ So far we have seen that it sometimes helps to replace a subexpression of a function by a single variable. Occasionally it can help to replace the original variable by something more complicated. This seems like a reverse substitution, but it is really no different in principle than ordinary substitution. x EXAMPLE 0.. Evaluate dx. Let x = sinu so dx = cosudu. Then x cos dx = sin ucosudu = ucosudu. We would like to replace cos u by cosu, but this is valid only if cosu is positive, since cos u is positive. Consider again the substitution x = sinu. We could just as well think of this as u = arcsinx. If we do, then by the definition of the arcsine, π/ u π/, so cosu 0. Then we continue: cos ucosudu = +cosu cos udu = = arcsinx + sin(arcsinx) 4 du = u + sinu 4 +C. This is a perfectly good answer, though the term sin(arcsinx) is a bit unpleasant. It is possible to simplify this. Using the identity sinx = sinxcosx, we can write sinu = sinucosu = sin(arcsinx) sin u = x sin (arcsinx) = x x. Then the full antiderivative is arcsin x + x x 4 = arcsinx + x x +C. +C

06 Chapter 0 Techniques of Integration This type of substitution is usually indicated when the function you wish to integrate contains a polynomial expression that might allow you to use the fundamental identity sin x+cos x = in one of three forms: cos x = sin x sec x = +tan x tan x = sec x. If your function contains x, as in the example above, try x = sinu; if it contains +x try x = tanu; and if it contains x, try x = secu. Sometimes you will need to try something a bit different to handle constants other than one. EXAMPLE 0.. Evaluate 4 9x dx. We start by rewriting this so that it looks more like the previous example: 4 9x 4( (3x/) dx = )dx = (3x/) dx. Now let 3x/ = sinu so (3/)dx = cosudu or dx = (/3)cosudu. Then (3x/) dx = sin u(/3)cosudu = 4 cos udu 3 = 4u 6 + 4sinu = arcsin(3x/) 3 = arcsin(3x/) 3 = arcsin(3x/) 3 +C + sinucosu 3 +C + sin(arcsin(3x/))cos(arcsin(3x/)) 3 + (3x/) (3x/) 3 = arcsin(3x/) + x 4 9x +C, 3 using some of the work from example 0... +C +C +x EXAMPLE 0..3 Evaluate dx. Let x = tanu, dx = sec udu, so +x sec dx = +tan usec udu = usec udu. Since u = arctan(x), π/ u π/ and secu 0, so sec u = secu. Then sec usec udu = sec 3 udu. In problems of this type, two integrals come up frequently: Both have relatively nice expressions but they are a bit tricky to discover. sec 3 udu and secudu.

0. Trigonometric Substitutions 07 First we do secudu, which we will need to compute sec 3 udu: secudu = secu secu+tanu secu+tanu du sec u+secutanu = du. secu+tanu Now let w = secu + tanu, dw = secutanu + sec udu, exactly the numerator of the function we are integrating. Thus sec u+secutanu secudu = du = dw = ln w +C secu+tanu w Now for sec 3 udu: sec 3 u = sec3 u = sec3 u + sec3 u = sec3 u + secutan u + secu = ln secu+tanu +C. + (tan u+)secu = sec3 u+secutan u + secu. We already know how to integrate secu, so we just need the first quotient. This is simply a matter of recognizing the product rule in action: sec 3 u+secutan udu = secutanu. So putting these together we get sec 3 udu = secutanu + ln secu+tanu +C, and reverting to the original variable x: +x dx = secutanu + ln secu+tanu = sec(arctanx)tan(arctanx) +C + ln sec(arctanx)+tan(arctanx) = x +x + ln +x +x +C, using tan(arctanx) = x and sec(arctanx) = +tan (arctanx) = +x. +C

08 Chapter 0 Techniques of Integration Exercises 0.. Find the antiderivatives.. cscxdx. csc 3 xdx 3. 5. 7. 9.. x dx 4. x x dx 6. +x dx dx 0. x (+x ) x dx. x 9+4x dx x x dx 8. x +xdx x 4 x dx x 3 4x dx ½¼º ÁÒØ Ö Ø ÓÒ Ý È ÖØ We have already seen that recognizing the product rule can be useful, when we noticed that sec 3 u+secutan udu = secutanu. As with substitution, we do not have to rely on insight or cleverness to discover such antiderivatives; there is a technique that will often help to uncover the product rule. Start with the product rule: d dx f(x)g(x) = f (x)g(x)+f(x)g (x). We can rewrite this as f(x)g(x) = f (x)g(x)dx+ f(x)g (x)dx, and then f(x)g (x)dx = f(x)g(x) f (x)g(x)dx. This may not seem particularly useful at first glance, but it turns out that in many cases we have an integral of the form f(x)g (x)dx but that f (x)g(x)dx is easier. This technique for turning one integral into another is called integration by parts, and is usually written in more compact form. If we let u = f(x) and v = g(x) then

0.3 Integration by Parts 09 du = f (x)dx and dv = g (x)dx and udv = uv vdu. To use this technique we need to identify likely candidates for u = f(x) and dv = g (x)dx. EXAMPLE 0.3. Evaluate xlnxdx. Let u = lnx so du = /xdx. Then we must let dv = xdx so v = x / and xlnxdx = x lnx x x dx = x lnx x dx = x lnx x 4 +C. EXAMPLE 0.3. Evaluate xsinxdx. Let u = x so du = dx. Then we must let dv = sinxdx so v = cosx and xsinxdx = xcosx cosxdx = xcosx+ cosxdx = xcosx+sinx+c. EXAMPLE 0.3.3 Evaluate sec 3 xdx. Of course wealreadyknowtheanswer tothis, but we needed to be clever to discover it. Here we ll use the new technique to discover the antiderivative. Let u = secx and dv = sec xdx. Then du = secxtanxdx and v = tanx and sec 3 xdx = secxtanx tan xsecxdx = secxtanx (sec x )secxdx = secxtanx sec 3 xdx+ secxdx.

0 Chapter 0 Techniques of Integration At first this looks useless we re right back to sec 3 xdx. But looking more closely: sec 3 xdx+ sec 3 xdx = secxtanx sec 3 xdx = secxtanx+ sec 3 xdx = secxtanx+ sec 3 xdx = secxtanx = secxtanx + sec 3 xdx+ secxdx secxdx secxdx + ln secx+tanx secxdx +C. EXAMPLE 0.3.4 Evaluate x sinxdx. Let u = x, dv = sinxdx; then du = xdx and v = cosx. Now x sinxdx = x cosx + xcosxdx. This is better than the original integral, but we need to do integration by parts again. Let u = x, dv = cosxdx; then du = and v = sinx, and x sinxdx = x cosx+ xcosxdx = x cosx+xsinx sinxdx = x cosx+xsinx+cosx+c. Suchrepeateduseofintegrationbypartsisfairlycommon, butitcanbeabittediousto accomplish, and it is easy to make errors, especially sign errors involving the subtraction in the formula. There is a nice tabular method to accomplish the calculation that minimizes the chance for error and speeds up the whole process. We illustrate with the previous example. Here is the table: sign u dv x sinx x cosx sinx 0 cos x or u dv x x sinx cosx sinx 0 cosx

0.3 Integration by Parts To form the first table, we start with u at the top of the second column and repeatedly compute the derivative; starting with dv at the top of the third column, we repeatedly compute the antiderivative. In the first column, we place a in every second row. To form the second table we combine the first and second columns by ignoring the boundary; if you do this by hand, you may simply start with two columns and add a to every second row. To compute with this second table we begin at the top. Multiply the first entry in column u by the second entry in column dv to get x cosx, and add this to the integral of the product of the second entry in column u and second entry in column dv. This gives: x cosx+ xcosxdx, or exactly the result of the first application of integration by parts. Since this integral is not yet easy, we return to the table. Now we multiply twice on the diagonal, (x )( cosx) and ( x)( sinx) and then once straight across, ()( sinx), and combine these as x cosx+xsinx sinxdx, giving the same result as the second application of integration by parts. While this integral iseasy, wemayreturnyetoncemoretothetable. Nowmultiplythreetimesonthediagonal to get (x )( cosx), ( x)( sinx), and ()(cosx), and once straight across, (0)(cosx). We combine these as before to get x cosx+xsinx+cosx+ 0dx = x cosx+xsinx+cosx+c. Typically we would fill in the table one line at a time, until the straight across multiplication gives an easy integral. If we can see that the u column will eventually become zero, we can instead fill in the whole table; computing the products as indicated will then give the entire integral, including the +C, as above. Exercises 0.3. Find the antiderivatives.. xcosxdx. 3. xe x dx 4. 5. sin xdx 6. x cosxdx xe x dx lnxdx

Chapter 0 Techniques of Integration 7. xarctanxdx 8. 9. x 3 cosxdx 0.. xsinxcosxdx. 3. sin( x)dx 4. x 3 sinxdx xsin xdx arctan( x)dx sec xcsc xdx ½¼º Ê Ø ÓÒ Ð ÙÒØ ÓÒ A rational function is a fraction with polynomials in the numerator and denominator. For example, x 3 x +x 6, x + (x 3), x, are all rational functions of x. There is a general technique called partial fractions that, in principle, allows us to integrate any rational function. The algebraic steps in the technique are rather cumbersome if the polynomial in the denominator has degree more than, and the technique requires that we factor the denominator, something that is not always possible. However, in practice one does not often run across rational functions with high degree polynomials in the denominator for which one has to find the antiderivative function. So we shall explain how to find the antiderivative of a rational function only when the denominator is a quadratic polynomial ax +bx+c. We should mention a special type of rational function that we already know how to integrate: If the denominator has the form (ax + b) n, the substitution u = ax + b will always work. The denominator becomes u n, and each x in the numerator is replaced by (u b)/a, and dx = du/a. While it may be tedious to complete the integration if the numerator has high degree, it is merely a matter of algebra.

EXAMPLE 0.4. Find 0.4 Rational Functions 3 x 3 dx. Using the substitution u = 3 x we get (3 x) 5 x 3 (3 x) 5 dx = = 6 = 6 = 6 ( ) 3 u 3 u 5 du = 6 u 3 9u +7u 7 du u 5 u 9u 3 +7u 4 7u 5 du ( u 9u + 7u 3 3 ( (3 x) 9(3 x) ) 7u 4 +C 4 + 7(3 x) 3 3 ) 7(3 x) 4 +C 4 = 6(3 x) + 9 3(3 x) 9 6(3 x) + 7 3 64(3 x) +C 4 We now proceed to the case in which the denominator is a quadratic polynomial. We can always factor out the coefficient of x and put it outside the integral, so we can assume that the denominator has the form x +bx+c. There are three possible cases, depending on how the quadratic factors: either x +bx+c = (x r)(x s), x +bx+c = (x r), or it doesn t factor. We can use the quadratic formula to decide which of these we have, and to factor the quadratic if it is possible. EXAMPLE 0.4. Determine whether x +x+ factors, and factor it if possible. The quadratic formula tells us that x +x+ = 0 when x = ± 4. Since there is no square root of 3, this quadratic does not factor. EXAMPLE 0.4.3 Determine whether x x factors, and factor it if possible. The quadratic formula tells us that x x = 0 when x = ± +4 = ± 5. Therefore x x = ( x + 5 )( x 5 ).

4 Chapter 0 Techniques of Integration If x +bx+c = (x r) then we have the special case we have already seen, that can be handled with a substitution. The other two cases require different approaches. If x +bx+c = (x r)(x s), we have an integral of the form p(x) (x r)(x s) dx where p(x) is a polynomial. The first step is to make sure that p(x) has degree less than. x 3 EXAMPLE 0.4.4 Rewrite dx in terms of an integral with a numerator that has degree less than. To do this we use long division of polynomials to discover (x )(x+3) that so x 3 (x )(x+3) = x 3 x +x 6 x 3 (x )(x+3) dx = = x + 7x 6 x +x 6 = x + x dx+ The first integral is easy, so only the second requires some work. Now consider the following simple algebra of fractions: A x r + B x s = A(x s)+b(x r) (x r)(x s) 7x 6 (x )(x+3) dx. 7x 6 (x )(x+3), = (A+B)x As Br. (x r)(x s) That is, adding two fractions with constant numerator and denominators (x r) and (x s) produces a fraction with denominator (x r)(x s) and a polynomial of degree less than for the numerator. We want to reverse this process: starting with a single fraction, we want to write it as a sum of two simpler fractions. An example should make it clear how to proceed. x 3 7x 6 EXAMPLE 0.4.5 Evaluate dx. We start by writing (x )(x+3) as the sum of two fractions. We want to end up with 7x 6 (x )(x+3) = A x + B x+3. If we go ahead and add the fractions on the right hand side we get 7x 6 (x )(x+3) = (A+B)x+3A B. (x )(x+3) (x )(x+3) So all we need to do is find A and B so that 7x 6 = (A+B)x+3A B, which is to say, we need 7 = A+B and 6 = 3A B. This is a problem you ve seen before: solve a

0.4 Rational Functions 5 system of two equations in two unknowns. There are many ways to proceed; here s one: If 7 = A+B then B = 7 A and so 6 = 3A B = 3A (7 A) = 3A 4+A = 5A 4. This is easy to solve for A: A = 8/5, and then B = 7 A = 7 8/5 = 7/5. Thus 7x 6 8 (x )(x+3) dx = 5x + 7 5 x+3 dx = 8 7 ln x + 5 5 ln x+3 +C. The answer to the original problem is now x 3 (x )(x+3) dx = x dx+ 7x 6 (x )(x+3) dx = x x+ 8 7 ln x + 5 5 ln x+3 +C. Now suppose that x +bx+c doesn t factor. Again we can use long division to ensure that the numerator has degree less than, then we complete the square. x+ EXAMPLE 0.4.6 Evaluate dx. The quadratic denominator does not x +4x+8 factor. We could complete the square and use a trigonometric substitution, but it is simpler to rearrange the integrand: x+ x +4x+8 dx = x+ x +4x+8 dx x +4x+8 dx. The first integral is an easy substitution problem, using u = x +4x+8: x+ x +4x+8 dx = du u = ln x +4x+8. For the second integral we complete the square: ( (x+ ) x +4x+8 = (x+) +4 = 4 +), making the integral Using u = x+ we get 4 ( x+ 4 ) dx = + 4 ( x+ ) dx. + u + du = arctan The final answer is now x+ x +4x+8 dx = ln x +4x+8 arctan ( x+ ). ( ) x+ +C.

6 Chapter 0 Techniques of Integration Exercises 0.4. Find the antiderivatives.. dx. 4 x 3. dx 4. x +0x+5 x 4 5. dx 6. 4+x x 3 7. dx 8. 4+x 9. dx 0. x x 3 x 4 4 x dx x 4 x dx x +0x+9 dx x +0x+ dx x +3x dx ½¼º ÆÙÑ Ö Ð ÁÒØ Ö Ø ÓÒ We have now seen some of the most generally useful methods for discovering antiderivatives, and there are others. Unfortunately, some functions have no simple antiderivatives; in such cases if the value of a definite integral is needed it will have to be approximated. We will see two methods that work reasonably well and yet are fairly simple; in some cases more sophisticated techniques will be needed. Of course, we already know one way to approximate an integral: if we think of the integral as computing an area, we can add up the areas of some rectangles. While this is quite simple, it is usually the case that a large number of rectangles is needed to get acceptable accuracy. A similar approach is much better: we approximate the area under a curve over a small interval as the area of a trapezoid. In figure 0.5. we see an area under a curve approximated by rectangles and by trapezoids; it is apparent that the trapezoids give a substantially better approximation on each subinterval............. Figure 0.5. Approximating an area with rectangles and with trapezoids. As with rectangles, we divide the interval into n equal subintervals of length x. A typical trapezoid is pictured in figure 0.5.; it has area f(x i)+f(x i+ ) x. If we add up

0.5 Numerical Integration 7 the areas of all trapezoids we get f(x 0 )+f(x ) x+ f(x )+f(x ) ( f(x0 ) x+ + f(x n )+f(x n ) x = +f(x )+f(x )+ +f(x n )+ f(x n) ) x. This is usually known as the Trapezoid Rule. For a modest number of subintervals this is not too difficult to do with a calculator; a computer can easily do many subintervals. (x i,f(x i )).....(x i+,f(x i+ )) x i x i+ Figure 0.5. A single trapezoid. In practice, an approximation is useful only if we know how accurate it is; for example, we might need a particular value accurate to three decimal places. When we compute a particular approximation to an integral, the error is the difference between the approximation and the true value of the integral. For any approximation technique, we need an error estimate, a value that is guaranteed to be larger than the actual error. If A is an approximation and E is the associated error estimate, then we know that the true value of the integral is between A E and A + E. In the case of our approximation of the integral, we want E = E( x) to be a function of x that gets small rapidly as x gets small. Fortunately, for many functions, there is such an error estimate associated with the trapezoid approximation. THEOREM 0.5. Suppose f has a second derivative f everywhere on the interval [a,b], and f (x) M for all x in the interval. With x = (b a)/n, an error estimate for the trapezoid approximation is E( x) = b a M( x) = (b a)3 n M. Let s see how we can use this.

8 Chapter 0 Techniques of Integration EXAMPLE 0.5. Approximate 0 e x dx to two decimal places. The second derivative of f = e x is (4x )e x, and it is not hard to see that on [0,], (4x )e x. We begin by estimating the number of subintervals we are likely to need. To get two decimal places of accuracy, we will certainly need E( x) < 0.005 or () n < 0.005 (00) < n 6 00 5.77 3 < n With n = 6, the error estimate is thus /6 3 < 0.0047. We compute the trapezoid approximation for six intervals: ( f(0) +f(/6)+f(/6)+ +f(5/6)+ f() ) 6 0.745. So the true value of the integral is between 0.745 0.0047 = 0.7404 and 0.745 + 0.0047 = 0.7498. Unfortunately, the first rounds to 0.74 and the second rounds to 0.75, so we can t be sure of the correct value in the second decimal place; we need to pick a larger n. As it turns out, we need to go to n = to get two bounds that both round to the same value, which turns out to be 0.75. For comparison, using rectangles to approximate the area gives 0.777, which is considerably less accurate than the approximation using six trapezoids. In practice it generally pays to start by requiring better than the maximum possible error; for example, we might have initially required E( x) < 0.00, or () n < 0.00 (000) < n 6 500.9 3 < n Had we immediately tried n = 3 this would have given us the desired answer. The trapezoid approximation works well, especially compared to rectangles, because the tops of the trapezoids form a reasonably good approximation to the curve when x is fairlysmall. Wecan extendthis idea: what if wetryto approximatethecurve moreclosely,

0.5 Numerical Integration 9 by using something other than a straight line? The obvious candidate is a parabola: if we can approximate a short piece of the curve with a parabola with equation y = ax +bx+c, we can easily compute the area under the parabola. There are an infinite number of parabolas through any two given points, but only one through three given points. If we find a parabola through three consecutive points (x i,f(x i )), (x i+,f(x i+ )), (x i+,f(x i+ )) on the curve, it should be quite close to the curve over the whole interval [x i,x i+ ], as in figure 0.5.3. If we divide the interval [a,b] into an even number of subintervals, we can then approximate the curve by a sequence of parabolas, each covering two of the subintervals. For this to be practical, we would like a simple formula for the area under one parabola, namely, the parabola through (x i,f(x i )), (x i+,f(x i+ )),and(x i+,f(x i+ )). Thatis,weshouldattempttowritedowntheparabola y = ax +bx +c through these points and then integrate it, and hope that the result is fairly simple. Although the algebra involved is messy, this turns out to be possible. The algebra is well within the capability of a good computer algebra system like Sage, so we will present the result without all of the algebra; you can see how to do it in this Sage worksheet. To find the parabola, we solve these three equations for a, b, and c: f(x i ) = a(x i+ x) +b(x i+ x)+c f(x i+ ) = a(x i+ ) +b(x i+ )+c f(x i+ ) = a(x i+ + x) +b(x i+ + x)+c Not surprisingly, the solutions turn out to be quite messy. Nevertheless, Sage can easily compute and simplify the integral to get xi+ + x x i+ x Now the sum of the areas under all parabolas is ax +bx+cdx = x 3 (f(x i)+4f(x i+ )+f(x i+ )). x 3 (f(x 0)+4f(x )+f(x )+f(x )+4f(x 3 )+f(x 4 )+ +f(x n )+4f(x n )+f(x n )) = x 3 (f(x 0)+4f(x )+f(x )+4f(x 3 )+f(x 4 )+ +f(x n )+4f(x n )+f(x n )). This is just slightly more complicated than the formula for trapezoids; we need to remember the alternating and 4 coefficients; note that n must be even for this to make sense. This approximation technique is referred to as Simpson s Rule. As with the trapezoid method, this is useful only with an error estimate:

0 Chapter 0 Techniques of Integration (x i,f(x i ))....(x i+,f(x i+ )).......... x i x i+ x i+ Figure 0.5.3 A parabola (dashed) approximating a curve (solid). THEOREM 0.5.3 Suppose f has a fourth derivative f (4) everywhere on the interval [a,b], and f (4) (x) M for all x in the interval. With x = (b a)/n, an error estimate for Simpson s approximation is E( x) = b a 80 M( x)4 = (b a)5 80n 4 M. EXAMPLE 0.5.4 Let us again approximate 0 e x dx to two decimal places. The fourth derivative of f = e x is (6x 48x + )e x ; on [0,] this is at most in absolute value. We begin by estimating the number of subintervals we are likely to need. To get two decimal places of accuracy, we will certainly need E( x) < 0.005, but taking a cue from our earlier example, let s require E( x) < 0.00: 80 () n 4 < 0.00 00 3 < n4.86 [4] 00 3 < n So we try n = 4, since we need an even number of subintervals. Then the error estimate is /80/4 4 < 0.0003 and the approximation is (f(0)+4f(/4)+f(/)+4f(3/4)+f()) 3 4 0.746855. So the true value of the integral is between 0.746855 0.0003 = 0.746555 and 0.746855+ 0.0003 = 0.747555, both of which round to 0.75.

0.6 Additional exercises Exercises 0.5. In the following problems, compute the trapezoid and Simpson approximations using 4 subintervals, and compute the error estimate for each. (Finding the maximum values of the second and fourth derivatives can be challenging for some of these; you may use a graphing calculator or computer software to estimate the maximum values.) If you have access to Sage or similar software, approximate each integral to two decimal places. You can use this Sage worksheet to get started.. 3. 5. 7. 9. 3 4 5 0 xdx. x 3 dx 4. dx 6. +x x dx +x 8. x4 +dx 0. 3 0 3 0 0 4 x dx x dx x +xdx x3 +dx +/xdx. UsingSimpson sruleonaparabolaf(x), evenwithjusttwosubintervals, givestheexactvalue of the integral, because the parabolas used to approximate f will be f itself. Remarkably, Simpson s rule also computes the integral of a cubic function f(x) = ax 3 + bx + cx + d exactly. Show this is true by showing that x f(x)dx = x x 0 x 0 3 (f(x 0)+4f((x 0 +x )/)+f(x )). This does require a bit of messy algebra, so you may prefer to use Sage. ½¼º Ø ÓÒ Ð Ü Ö These problems require the techniques of this chapter, and are in no particular order. Some problems may be done in more than one way.. 3. 5. 7. 9.. (t+4) 3 dt. (e t +6)te t dt 4. tantsec tdt 6. dt 8. t(t 4) cos3t dt 0. sin3t e t et + dt. t(t 9) 3/ dt sintcostdt t+ t +t+3 dt dt (5 t ) 3/ tsec tdt cos 4 tdt

Chapter 0 Techniques of Integration 3. 5. 7. 9.. 3. 5. 7. dt 4. t +3t sec t dt 6. (+tant) 3 e t sintdt 8. t 3 dt 0. ( t ) 5/ arctant dt. +4t sin 3 tcos 4 tdt 4. dt 6. t(lnt) t 3 e t dt 8. t +t dt t 3 t +dt (t 3/ +47) 3 tdt t(9+4t ) dt t t +t 3 dt t 6t+9 dt t(lnt) dt t+ t +t dt