In today's video, we introduce and illustrate an important and useful method for anti-differentiation, known as integration by substitution. This method is closely related to the Chain Rule one, of the differentiation rules that we discussed in the previous module. This method provides us with a tool for reducing complexity of a given integral, by making an intelligent or judicious choice of substitution of variables, followed by algebraic manipulation of the integrand and differential. The word integration has several meanings, usually clear from context. It may refer to the process of finding an indefinite integral which is an anti-derivative of the integrand, producing a function. It can also refer to the process of finding a definite integral, which is the area under a given curve over a given interval, producing a real number. The expression integration by substitution, typically refers to a rule or method for anti-differentiation closely related to the chain rule for differentiation. As you'll see, it makes free reign of differentials and takes full advantage of the utility of Leibniz notation. There's also a version of this method involving definite integrals, and special care needs to be taken with keeping track of the correct terminals. Before formalizing the method, let's look at the following example, and follow our instincts for manipulating expressions in particular those involving differentials. Our aim is to anti-differentiate four x times x squared plus one. A direct method is to expand the integrand, and then anti-differentiate each piece. Noting that four x cubed is the derivative of x to the fourth, and four x is the derivative of two x squared. Putting the pieces together with a constant of integration. The second method is indirect and avoids the initial expansion. The complicated part of the integrand, appears to be x squared plus one, so let's see what happens if we put u equal to this. The derivative of u with respect to x is two x, and we get the equation of differentials du equals 2x, dx. The aim is to express everything if possible in terms of u, in order to simplify the integral. So, we move a factor of two x in integrand, to sit next to the differential dx. And notice that the expression becomes integral of two u, du, replacing x squared plus one by u, and 2x dx by du. The problem simplifies to anti-differentiating 2u with respect to u, which is just u squared plus a constant say, C dash, to make a comparison in a moment with an earlier solution that used plain C. Expressing everything in terms of x, because the final solution x squared plus one all squared, plus C dash. So, let's compare our two solutions. On the face of it, they appear to be different. In fact the differences, and the way things are expressed, create an illusion. If we expand out the second solution, we reproduce the first solution by gathering together the constants and pulling C equal to one plus C dash. When one anti-differentiates using different pathways, it's quite common to end up with expressions that look superficially different but which in fact, represent the same function as you carefully examine the constants that appear. Let's look at an example involving the circular functions. As you know, an anti-derivative of cos x is sin x. What about an anti-derivative of cos 2x? We can guess, that it should look something like sine 2x. If we differentiate sine two x with respect to x, using the chain rule and a substitution of u equals 2x, we quickly get two cos two x. Which is two times more than the integrand cos two x above. So, we compensate by dividing sin two x by two. Yielding finally the anti-derivative sine two x over two, plus C. This is called the guess and check method, which usually works well when you have to handle constant multiples of variables. For a more thorough systematic approach, we make a substitution upfront by putting u equal to two x. So that du dx equals two, so that du equals two dx, which we can rearrange as dx equals a half du. The aim is to convert everything involving x, to something simpler involving u. So cos two x becomes cos u, and we can replace dx by half du. We can bring the constant a half out the front, of a simpler integral involving u. So that we get half of sine u plus a constant, we can call C dash. Which becomes sine two x two plus C, where C is a half C dash, giving the same answer that we obtained using the guess and check method. With practice, we usually skip the two steps involving a constant C dash, which I included just so you can see exactly how it all fits together. Let's develop a general framework for examples like these, called a substitution rule for integration. Recall the chain rule for differentiation, which says dy dx equals dy du times du dx where we think of the differentials du canceling in the numerator and denominator as though these expressions were ordinary fractions. Suppose that y happens to be an anti-derivative with respect to a variable u, for some function with rule f of u, that is dy du equals f of u. Which can be expressed as an indefinite integral. The integral of f of u with respect to u, is y plus C for some constant C, since the general anti-derivative is formed by adding constants to any particular anti-derivative. Now, we can get the variable x into the game by using the chain rule. So that dy dx equals dy du times du dx, which equals f of u times du dx. Which tells us that y is also an anti-derivative to the expression f of u du dx, whatever it might be, but with respect to the variable x. This can be expressed also as an indefinite integral, namely, the integral of f of u, du dx all brackets together, as the integrand with respect to x, which becomes again y plus C, and there's no harm in using the same general C as before. So, y plus C appears in two places, linking the two indefinite integrals together. Thus, we get equality of these two integrals, known as integration by substitution formula. Brackets are usually deleted, which makes the formula very easy to remember because you can think of the differentials as canceling. Treating the derivative as an ordinary fraction, just as we do in remembering the chain rule. The formula can also be written using function notation for the derivative. If u equals g of x, the rule for some function g with input x, then we can rewrite the formula using g dash of x for du dx, and f of g of x, for f of u. You often see the expressions written down in the opposite order, the reason being that one tries if possible, to recognize some complicated integral as the left hand side, which dissolves by the formula into the much simpler right hand side. There's also a version using definite integrals, where we add terminals, say a and b for the variable x on the left-hand side, and g of a, and g of b for the corresponding variable u on the right hand side. The use of the terminals is quite delicate and takes some care, and one needs to accurately match the terminals to the variable that appears in the differential use to form the definite integral. It's common to make errors in manipulating terminals, or to overlook the need to change them as one switches between variables. Consider the following example, which is to find the area under the curve y equals cos pi x on two for x going from minus one to one. We'll approach the solution in two different ways. In the first solution, we start off by working with an indefinite integral and only later introduce the terminals. We remove the terminals, and try to find the integral of cos pi x on two with respect to x. In fact, we quickly get two on pi times sin of pi x onto plus C, using a guess and check method by an appropriate adjustment of the constant out the front. The derivative of sin pi x on two, one can quickly say is pi on two times cos pi x on two. So, the adjustment required to get the anti-derivative above is to multiply by two over pi. Because the anti-derivative is a function of x, we just put the terminals back in, to get the original definite integral and evaluate it in the usual ways using the fundamental theorem of calculus. We substitute one for x, minus one for x, and take the difference. And see that, it quickly evaluates to four over pi. Alternatively, we can solve this using definite integrals all the way through. We use a substitution u for pi x on two, so that du dx is pi on two, and u is pi on two times dx. Which we can rearrange to get dx equal to 2 on pi times du. We'll express everything in terms of u, including the terminals. So x equals one, the original upper terminal, converts to u equal to pi on two, and x equal to minus one the original lower terminal, converts to u equal to negative pi on two. We now rewrite the original definite integral, by replacing pi x on two in integrand by u. The differential dx by two on pi times du. The upper terminal by pi on two and the lower terminal by negative pi on two. The constant term pi can come out the front, and then we evaluate in the usual way by the fundamental theorem of calculus. Using sin u as an anti-derivative of cos u with respect to u. And replacing u by pi on two, u by negative pi on two and taking the difference. Which quickly simplifies to form pi, agreeing with the answer we found by the first solution. Using either method, we find the green shaded area under the curve turns out to be four on pi.