in this video we're computing a numerical approximation of the integral of tangent square
root one minus x squared on the interval negative one to one and the reason that we're using a
numerical integration approach here is because this function has no symbolic anti-derivative and
specifically we're going to use a trapezoid approximation and we're going to use 200
trapezoids to get this done and we can see already in the picture what a typical trapezoid would look
like i labeled the left side of it as x i minus 1. the right cut point for this trapezoid is x i the
height of the left side of that trapezoid would be f of x i minus 1 and the height of the right side
is f of x i and we're asked a whole series of questions here to help build up the summation
notation that we're ultimately going to put into a computer algebra system so in part a we're asked
for the sub interval width as a decimal so we take the width of the entire interval negative one to
one that width is two and we divide by the number of slices that we're slicing it into which is 200
and this gives us a nice round number that's exactly 1 out of 100 or 0.01
so each trapezoid is actually very very thin and the one in the picture is greatly exaggerated
just so we can see it in part b we're asked to write down the i cut point in terms of i
and i want to point out some of the notation here normally the very left side of the interval
we call x zero and in this particular problem our starting point is x zero equals negative
one and then the rightmost endpoint we normally call x n and in this particular problem n is two
hundred so that's our two hundredth cut point and that's equal to one now what about our i cut point
all we do is start with the starting point that's x zero and then we take i steps to the right and
the step width is what we call delta x so plugging in the numbers here my i cut point i start at the
starting point x zero that was negative one and i add to that i times the step width of 0.01
and it's probably nicer to write that as negative 1 plus 0.01 i in part c we're asked to express the
sum approximating the integral in terms of x i x i minus 1 and delta x so we're staying general in
this step of the problem we're not plugging in the actual function that we're integrating yet and the
area of a trapezoid is given by the average of the two heights so that's f of x i minus one added to
f of x i all divided by two and then we take that and multiply by the width of the trapezoid which
is delta x and then we need to set the starting point in the ending point of our sum appropriately
so that we start with the right first trapezoid and end with the correct last trapezoid and
starting at i equals 1 is what we want to do in this case because that would start me out
with f x zero for the height of the left side of the first trapezoid f of x one for the height of
the right side of the first trapezoid and then if i run this all the way to 200 that's going to give
me 200 trapezoids and the last one we'll have a left height of f of x 199 and a right side height
of f of x 200 now we can plug in our specific function f of x that's the tangent of the square
root of 1 minus x squared so f of x evaluated at x i minus 1 well to find x i minus 1 i have to
replace i with i minus 1 in my formula for part b and i have the tangent of the square root 1 minus
x i minus 1 which is negative 1 plus .01 times i minus 1 all squared and then i have plus my
function f of x again the tangent of square root 1 minus x squared evaluated at x i so i get 1 minus
and then looking back at part b x i is a negative 1 plus 0.01 i all squared and then my delta x
is 0.01 so this thing is ready to plug into a computer algebra system now and we'll add up
the areas of these 200 trapezoids and get a good approximation of the total area and one thing i'm
going to do to simplify what i'm typing in for the sum is i'm going to take these constants one-half
and .01 those are common to every single term in the sum so they can be factored out in front
and half of 0.01 is .005 so i'm just going to put a .005 in front of the whole thing
and then i don't have to write those constants for every term in the sum and the technology that
we're using for this is wx maxima that's a free open source computer algebra system and so we've
typed in our sum into maxima and i have that .005 out in front and then we're using the command sum
i typed in my function very carefully here the tangent of the square root of 1 minus
the quantity negative 1 plus 0.01 times i minus 1 quantity squared and so on and we're going to
sum this up as i goes from 1 to 200. now in this case it doesn't cause a problem but if maxima was
refusing to give a decimal approximation we could always put the command float around this entire
thing and it would turn it into a decimal but when we hit shift enter we get a decimal approximation
we're asked to do this to the thousandths place so we get 2.16 and so we've answered the question
but i want to check my work with the built-in numerical integration algorithms in maxima
and to do this we'll plug in our original integral and use the quad qag command to
do numerical integration on it so what we're telling maxima is give me the numerical integral
with respect to x on the given interval negative one to one but there's one more thing we have to
specify and it's the algorithm number to use for quad qag and any number between one and six is
perfectly fine for our purposes and i hit shift enter and the first argument there 2.1677 and so
on that's the numerical approximation given by maxima the second argument is the approximate
error in that approximation so you can see it's very precise so to the thousands place we get
2.168 from the built-in numerical integration package in other words our trapezoid sum
was slightly underestimating and if we go back to our original picture we can see why this function
is always concave down so every time we draw one of those trapezoids there's going to be a little
bit of area that we missed above the trapezoid so it's worth remembering that on an interval
where a function is concave down trapezoid sums underestimate on an interval where a function is
concave up trapezoid sums would overestimate okay so we're done getting our numerical approximation
of this integral using a trapezoid sum it was only good to the hundreds place when we compared to a
more powerful algorithm but we could always get more useful decimal places just by increasing
the value of n if we wanted to but not today and we're done if you enjoyed this video or
at least found it useful check out another one by clicking one of the links on the left
or click the zachslab logo on the right to explore dozens of physics and math playlists as always you
can leave your questions comments and requests in the comments section below and i'll get back to
you within 24 hours thanks for watching zach's lab and best of luck on your math and physics journey