Hi and welcome to the course. I'm Jane Wall, and in this course, Dr. Byrd and I will be talking about both integral calculus and some numerical analysis basics. We're just going to give you the basic idea of these fields so that you know when you see them in your data science courses how to use them. Our first lecture will be about integral calculus. Don't get too freaked out by that. What we're really going to do is talk about the area underneath a curve. For instance, if you imagine a function that looks like, let's just say, that's the number four, and so this is the simple function, f of x is equal to 4. Because everywhere it's four. If we want to look at the area under the curve, say between 0 and 2, that's not quite two, maybe that's two, then that's pretty easy. The area under the function f of x between 0 and 2 would be this distance times this distance, because it's a rectangle. The area under that curve would be 2 times 4. This is the x distance. I'll call that Delta x times the height, which is my f of x. So 2 times 4 a 8. That's a very simple function to analyze the area under the curve. Let's go to one that's a little more complicated. Let's look now at the curve x plus 2. That's a line. Here's f of x equals x plus 2. If we want to look at that, so here is the point 0, 2. That's a height of two, and then the point 2, 4 would be, well, I didn't do that to the scale, did I? Let's try it again. The point 2, and the point 2, 4. It'll look something like that. Here I'm at a height of two, and here I'm at a height of four, and x is 2. If I look at the area under this curve, I could look at it and I can do this geometrically because it's that area plus that area. Let's see. This part would be 2 times 2, a 4, and I can add it to this piece, which would be 1/2 the base, which is 2 times the height, which is another two. That's another two, so I'd have a total area of six. This is fairly simple if I've got a line of some sort that I want to look at the area under the curve. But let's suppose I have something a little more complicated. Suppose now my function is, let's just do x squared. I want to look at the area under the curve here, from say, 0-2. This would be a height then our four. In all these cases, at two, I have a height of four, but I have different curves that are going through that. If I look at that area, this is the area I want. All this area under here. How could I figure out what that is? Well, I could try putting some rectangles in it. I could do what we call the right endpoint. Let's say I did four rectangles. This would be the point 1,1, this would be the point 1/2, 1/4, and this would be the point 3/2. Let's see, 3/2 squared is 9/4. That would be a height of 9/4. If I looked at these rectangles, I could do the right endpoint, which would be giving me these rectangles. If I added up the area of those, I'd be overestimating my area. Let me see if I can get a different color here. I did the left endpoint, I'd be looking at this one, this one, this one, and this one. If I added up those, I would be underestimating. I could look at that and do both an upper bound and a lower bound and get at least approximation of what my area under the curve is. The idea of the integral is you take a whole bunch of these. If I took maybe a 100 rectangles under here and added them up. The more rectangles I take, the closer to my area that I get. What I'm doing in each of these cases is I'm taking that little distance, let's call this distance Delta x, just the difference in the x's, and the height there, and we'll do it x_i because it's at a point. My height there is f of that x_i. That gives me the area of that little rectangle. If I add all those up for n rectangles, then I get an approximation to the area under that curve. If I did a whole bunch of these, like if I take this into infinity, I think about this being a sum and that's my sum sign now. I'm going now from the endpoint 0 to the endpoint 2, and now this is my integral. The integral is just the limit as n goes to infinity of this sum. That's the basic idea of an integral and how you use that to approximate the area under the curve. Now one more thing before we move on is the notion that, what if my graph had gone below the axis? Now maybe I'm looking at a graph that looks like this. Then when I add up these guys, these are the sums of my f of x_i's. These are all positive. You want to add these guys up. These are all negative. This area is actually a negative number. If I actually want the area, I have to take the integral or the absolute value of the integral in order to get the area. The integral here would be a negative number, here would be a positive number. If I did the integral of this function from a-b, I would get approximately zero. Maybe exactly zero if it's a symmetric function. An integral can be negative or it can be positive, and the negative and the positives are going to offset each other. It's going to net out, so it's the net area under the curve really. Because when you think about it, when I'm adding up these f of x_i's, what I'm doing is I'm adding up negative numbers when it's below the curve. Come back for the next lecture. I'll see you soon.