Calculus

Lesson 25

Numerical Integration

Back to Dr. Nandor's Calculus Notes Page

 Back to Dr. Nandor's Calculus Page

 

 

            You need to be familiar with both Trapezoidal approximations and

                                    Simpson's Rule for the AP Exam.  Other than that, they are not that

                                    important!

 

 

 

                        The Trapezoidal Rule is an average of the small and large rectangular

                        approximations.

 

       
   
 
 
x1     x2

 

 

                        Note that the area of a trapezoid is the average length of the bases times the width

                                    so for each section, the area is:

 

 

                                               

 

                        If there were two sections, this would become:

 

 

Since  if we break the area up into equal parts, we can simplify this way:

                       

 

 

 

 

         Lastly, note that if our interval is from  to  that if we break the interval down into intervals, that each interval size is .  Also, since each part will be divided by 2, we can pull out the 1/2.  Finally, notice that except for the first and last sides, each side is counted twice. 

 

Hence, the formula for the trapezoidal rule area is:

 

           

 

 

            Notice the pattern 1, 2, 2, 2, 2, 2, 2, ..., 2, 2, 2, 1

 

 

            Examples (do each for n=4, 8 and check against fnint: 

 

 

 

 

            Simpson's Rule is similar, but instead of using straight lines between the two points that

            border each interval, we use a parabola to connect three points that border two intervals. 

            Note that there is a parabola that connects any three points.

 

 

 

 

           

 

            For Simpson's Rule, the pattern is 1, 4, 2, 4, 2, 4, 2, 4, 2, ..., 2, 4, 2, 4, 2, 4, 1.

 

 

 

            So for trapezoid, divide by 2 and the pattern is 1, 2, 2, 2, 2, 2, 2, ..., 2, 2, 2, 1.

            For Simpson's, divide by 3 and the pattern is 1, 4, 2, 4, 2, 4, 2, 4, 2, ..., 2, 4, 2, 4, 2, 4, 1.

            Also (Simpson's), you must have an odd number of points (an even number of intervals!)

 

            Do the same examples as before and compare them to trap and fnint.

 

            Also note that you get the exact answer for the quadratic with Simpson's!

 

 

 

 

 

Euler's Method

 

Newton's Method was for finding the x, given we want y=0.

 

For Euler's Method, we want to find the value of y, given that we know the value of x.

 

This is even more intuitive than Newton's Method!  To find the next x, imagine the curve is similar to a line (which is true if the interval is small enough).

 

 

 

 

Example:  .  We can easily tell what  is, but what is ?

Let's do it in 2 steps:                                                           And in 4 steps:

 

                 

 

 

 

Eight steps gives

Sixteen steps gives

Thirty-two steps gives

Sixty-four steps gives

 

 

This may seem like a silly thing to do for a function that we can actually evaluate, like the function above, but what about:

 

,  solve for  using one step and four steps.

 

, solve for  using two steps and four steps.

 

On to Lesson 26 - Ln(x) and Differentiation

Back to Dr. Nandor's Calculus Notes Page

 Back to Dr. Nandor's Calculus Page