 As we continue our discussion of mathematics and data science and the foundational principles, the next thing we want to talk about is calculus. And I'm going to give a little more history right here. The reason I'm showing you pictures of stones is because the word calculus is Latin for stone, as in a stone used for tallying where people would actually have a little bag of stones and they would move them and they would use it to count sheep or whatever. And the system of calculus was formalized in the 1600s simultaneously independently by Isaac Newton and Gottfried Wilhelm Leibniz. And there are three reasons why calculus is important for data science. Number one, it's the basis of most of the procedures that we do. Things like least squares regression and probability distributions. They use calculus in getting those answers. Second one is if you're studying anything that changes over time. So if you're measuring quantities or rates that change over time, then you have to use calculus. Calculus is used in finding the maximum and the minimum of functions, especially when you're optimizing, which is something I'll show you separately. Also, it's important to keep in mind there are two kinds of calculus. The first is differential calculus, which talks about rates of change at a specific time. It's also known as the calculus of change. The second kind of calculus is integral calculus. And this is where you're trying to calculate the quantity of something at a specific time, given the rate of change. And it's also known as the calculus of accumulation. So let's take a look at how this works. And we're going to focus on differential calculus. So I'm going to graph an equation here. I'm going to do y is equal to x squared, a very simple one, but it's a curve, which makes it harder to calculate things like the slope. So let's take a point here, that's at minus two, that's my little red dot, we have it x is equal to minus two. And because y is equal to x squared, if we want to get the y value, all we got to do is take that negative two and square and that gives us four. So that's pretty easy. So the coordinates for that red pointer minus two on x and plus four on y. Here's a harder question. What is the slope of the curve at that exact point? Well, it's actually a little tricky because the curve is always curvy, and there's no flat part on it. But we can get the answer by getting the derivative of the function. Now, there are several different ways of writing this, I'm using the one that's easiest to type. And let's start by this, what we're going to do is the n here. And that is the squared part. So we had x squared. And you see that same n turns into the squared. And then we come over here and we put that same value two in right there. And we put the two in right here. And then we can do a little bit of subtraction two minus one is one and truthfully, you can just ignore that and you get two x. That is the derivative. So what we have here is the derivative of x squared is two x. That means the slope at any given point of the curve is two x. So let's go back to what we had a moment ago. Here's our curve. Here's our point at x minus two. And so the slope is equal to two x. Well, we put in the minus two and we multiply it and we get minus four. So that is the slope at this exact point on the curve. Okay, what if we choose a different point? Let's say we come over here to x is equal to three. Well, the slope is equal to two x. So that's two times three is equal to six. Great. And on the other hand, you might be saying to yourself, and why do I care about this? There's a reason that this is important. And what it is, is that you can use these procedures to optimize decisions. And if that seems a little too abstract to you, that means you can use them to make more money. And I'm going to demonstrate that in the next video. But for right now in some, let's say this calculus is vital to practical data science. It's the foundation of statistics and it forms the core that's needed for doing optimization.