课程: Probability Foundations for Data Science
Calculus review: Integrals
- [Instructor] In this video, you'll review integrals. Integrals measure the accumulation of quantities, and are used to find areas under curves. They're essentially the opposite of derivatives and how they operate. Integrals are defined by the following two methods. The first method on the left is what you call an indefinite integral. This is bound between negative infinity and positive infinity. Sometimes those values are actually put in the integral and other times, it's blank like this. So again, you'll have the integral with that kind of squiggle sign, and you'll have it be for f of x and dx. The other version is what is called a definite integral, and that is defined by concept bounds a to b. So you'll see you have your integral. Where is a to b for again, your function, d of x, d of x? There are three main rules when it comes to using integrals. First step is the power rule. You'll notice this rule, and many of the other rules are similar with how the derivative rules work but again, sometimes you're going in the opposite direction, as in the case of the power rule. So let's say you're integrating a variable x to the power of n. Once you do that, your result is going to be x to the power of n plus one instead of minus one. And this time, instead of multiplying it by that previous value, you're going to actually be dividing it. So you're going to be dividing it by n, and this time instead of just n, it's going to be n plus one. So again, your result of integrating x to the n is going to be x to the n plus one divided by n plus one. You'll also note that there is a plus C at the end of this. C represents an unknown concept value added to represent a potential concept term of the original expression. Since you do not know the original expression, that is why this plus C is often added. You'll note that sometimes in this course, it'll be used, but a lot of times, it'll just be implied. Next step is the sum rule. This rule means when you're integrating over functions f of x plus g of x, you can simply separate them and integrate them on their own to where you have it equal to the integral of f of x, and add that to the integral of g of x. Finally is the constant multiple rule. So this is, let's say you multiply a constant a by your function f of x, and you're integrating over it. You can simply move your constant a outside of the integral and multiply it by whatever you get for the integral of f of x. This can simplify some of your calculations by just moving out those constant multiples out to then deal with them at the end. Let's look at a simple example first. Let's integrate from five multiplied by x squared. In this case, you'll see it is an indefinite integral, so again, it's going to be integrated from negative infinity to positive infinity. So in this case, you typically just leave the results as is, and you don't plug in any constant values to solve for it. In this case, you will be using both the power rule and the constant multiple rule. So when you integrate this, you can bring five to the outside of your integral and deal with that later. And so you'll just be integrating over x squared. So if you remember earlier, you are now going to be having x squared become x cubed, and you're going to be dividing it by that new power, which is three. So when you bring five back in and put it all together, you'll get a result of five multiplied by x cubed divided by three. And in this case, because it's an indefinite integral, you would add your plus C. So again, sometimes you could add it in this plus C, sometimes you could just imply it. Let's look at a more complex, integral example. You'll sometimes need to perform what is called a double integral in this course. Essentially this means you just integrate twice. Usually this will be over two different variables, such as x and y. In this case, let's integrate over this following equation where you're integrating from zero to two for y and then zero to one for x. And this will be for the function four multiplied by x multiplied by y plus three multiplied by y squared. In general, when it comes to integrating multiple times, it doesn't necessarily matter which order you do it, it should have the same results. But in this case, we will start on the inside and go to the outside. Let's start off by integrating this function for x. So here's your function, and like you saw before with your sum rule, you can simply separate this integral out to where you are now integrating it from zero to one for four multiplied by x multiplied by y, and add that to the integral of zero to one for three multiplied by y squared. You'll notice we got rid of the dy because right now, we are just focusing on integrating for dx. So again, we don't need the dy and we don't need the integral from zero to two. We're just focusing on that x integral right now. For the first portion, when you integrate just for x, you can simply move four and y in this case on the outside because you are not doing any integrating on y, and you have your constant multiple of four. So you'll have four multiplied by y, and then you'll multiply that by your integral of x, which in this case, you're going to move up and power to x squared and divide it by that new power, which is two. So in this case, you'll be multiplying four times y times x squared over two, and you'll be evaluating that from the values of one to zero. The second portion of your integral that's being added is going to be three multiplied by y squared. So in this case, you could simply move all of that outside the integral and act like you're simply just integrating on the value of one. So your results, you'll have three multiplied by y squared and kind of like with derivatives earlier, how you notice x went to a one, it's essentially the opposite with integrals. One will now go to x, so you'll have three multiplied by y squared multiplied by x. And again, you're evaluating that from zero to one. Once you evaluate these, the way you go about it, for example, with the x squared over two is you'll have your formula there with four multiplied by y multiplied by x squared over two, and you'll plug in one for x. So essentially, you'll have 1/2 and then you'll do the same where you have it would be zero squared divided by two, which is going to zero that one out. So in this case, you're basically going to multiply four multiplied by y, multiplied by 1/2 to get a result of two multiplied by y. On the other side, you'll have three multiplied by y squared, and that's going to be multiplied by one for the one portion that you're filling in. And then for the zero portion, that's again going to zero it out. So your result is just going to be three times y squared on that side. Now that you have your new function derived for d of x, now you can drive it for d of y. So remember, you have this from zero to two, and this will be your new function, two multiplied by a y plus three multiplied by y squared. And again, this will be for dy this time. Like before, you can separate this out using your sum rule, and in this case, you'll have zero to two for two multiplied by y and zero to two for three multiplied by y squared. You'll do essentially the same thing like you did before, but now you're integrating for y. So again, with the first one, you can move two to the outside and multiply that by your integral for y, which should be y squared divided by two. And again, you're evaluating that from the values of zero to two and the second portion, you can move your three on the outside, integrate for y squared, which will then be y cubed over three. And again, evaluate for the values of two to zero. So like before, you'll plug in the value of two for y squared over two and the value of zero, which again is going to zero that out. And for the second portion, you'll plug in the value of two for y cubed divided by three and value of zero, which again is going to zero that out. Once you multiply all that together, you'll get four and then eight, add those together and you get a total result of 12. Hopefully you feel more confident in your calculus skills after going through some of the main calculus concepts you need to know for this course in this video. Note that I will thoroughly explain how to perform these calculations throughout the course to ensure you clearly understand how to use these concepts when you work with them with different probability functions. Now that you're good to go on calculus, let's get started on learning about probability.