 In this very exciting video lecture I want to introduce you to the Feynman technique of integration. We're going to differentiate under the integral side. Now we're going to go through this step by step, but instead of me writing on the white board or writing it out by hand on paper, I'm just going to show you the equations on the screen here but we're going to go through them step by step. I am in the Mathematica programming environment here using the Wolfram language, which is a fantastic language if you're interested in doing your mathematics. Plus it can do so much more. And I'm just going to use one or two lines of code just as an illustration. But all the equations are here on the screen and we're going to go through them step by step. So we have here a problem set up for us. It's the definite integral in going from zero to infinity of the sine of x over x with respect to x. Now you can try any of the common techniques that you might have learned about. You are going to have problems trying to solve this. This little x here in the denominator is going to make life very difficult for you. There is a solution to this though and I've used the Wolfram language. I'm just going to use the integrate function sine of x over x and it's a definite integral with respect to x going from zero to infinity. And lo and behold I see that the answer is pi over 2. Now how to get to the pi over 2? Just as motivation for why there should be a solution. Let's plot this function. We create a graph of this function on this domain from zero to 12 pi. And you can see that it oscillates but it gets smaller and smaller so we are converging. So there should be a solution to this area under the curve. And indeed we see it is pi over 2. But how to do it? Feynman's technique of differentiating under the integral sine to the rescue. And we are going to set that up in a beautiful way as you can see here. We are going to introduce a new expression here inside of our integral as part of the integrand. And yes of course it totally changes the integrand but let me show you something very beautiful. Let's by introducing this new expression set this equal to something new a function that I am going to call i of a variable b to denote this new variable that I am introducing there b because look at this if we set b equal to zero this equation here this section here becomes 1 e to the power negative zero times x e to the power zero that is this one and we do indeed just have what we want. So imagine we could solve this little problem here instead of the original and eventually just put b equal to zero so we are going to solve this and eventually just put b equal to zero we are going to have a solution to our original problem. One thing though and it is going to come up later I put a negative bx there and I am putting the negative bx there because that means it goes into the denominator and the term actually disappears from here as b becomes very large because it is going to tend to zero so as not to influence what we have up here and why the e to the power negative bx well you can try lots of other expressions to put in there and indeed if someone shows you how to do this they might go through a couple and none of them work the e to the power negative bx that really works let's carry on with that now how to solve for this the next little trick up our sleeve is just to integrate both sides with respect to b so I have my equation here I am going to integrate both sides with respect to b and that is what we have down here I have the id b and because this is an integration with respect to b and not to x I am just using partial derivative notation here you needn't do that but just to show that I am taking the partial derivative of b I am taking the derivative of b with respect to b on both sides now without motivation or proof I am just going to use Leibniz's rule and I am going to move my differentiation here inside of the integral which is what we have down here and that is where the Feynman technique comes in differentiating under the integral sign because I am now doing a differentiation inside of the integration so let's just look at this little bit here which is what we have down here the partial derivative with respect to b of this expression x is a constant this is a very easy integral to do because the sign of x just stays there is a sign of x of x so I am just left with doing this integration here reminding myself that x is a constant so I am going to be left with e to the power negative bx and by the chain rule I still have to integrate my power here and that just leaves me with a negative x there and no and behold my x will now cancel because I have got an x in the numerator and the x in the denominator and I am left with this very beautiful so let's plug this back into this section here which is what we have done here except that I have bought the negative that I have there outside of my integral so that I have the derivative of i with respect to b equals negative this definite integral going from 0 to infinity with respect to x of this new integrand and if you look at this new integrand it is just very simply the product of two functions so I can use integration by parts no problem and what I have done for you here is just color code things remember this is how we do integration by parts it is just a matter of you might be more familiar with having this as the f of x g prime of x equals the f of x times the g of x minus the integral then of the f prime of x times the g of x I am using u and v they are functions of x the only choice now is which part is going to be u or f and which part is going to be v prime or g prime this is the way around I have done it and if that is u and that is v prime I should show you what u prime and v is or f prime and g and we plug that back into our little formula that we have up there so there is my u there is my v and there I have u prime and v all I want to do is just very quickly simplify things a little bit so the negative cosine x there I bring to the front here and I am going to bring out this b here to the front there and I note that in the negative times the negative is a positive so I am left with this you might suggest that I haven't really done anything because it is not easier but you have done integration by parts before and you know that we are just going to do integration by parts of this part once again and again this is going to be this first part it is going to be my u and this is going to be my v prime and we have set it up here so that you can see and we are just going to put that all the way back so there is my negative b my negative b is my negative b there so I am just doing inside of the square back so I am doing this integral here so again I have u and v and I have u prime and v there all I have done this time I have just bought the b out again so that it is there check by hand you will see this is this integration by parts of this section here what I want to do is just multiply this b out the b that I have put out in front there through this square bracket expression here so that I get a negative b there and a negative b squared there so I get the negative b squared over on that side so what happens from here on well if you notice very carefully just mind that I have bought that negative out as well and that is why that is a negative is that on the right hand side I have exactly what I have on the left hand side so I can bring this negative b squared with its integral over to the left hand side which means I have got my integral plus b squared times my same integral equals then the right hand side I can take my integral out here as a common factor which means I am left with 1-b squared on the left hand side and on the right hand side I can simplify by taking negative e to the power e-bx out as a common factor and I am left with cosine of x plus the b times the sine of x on the right hand side I can divide both sides by 1 over b squared 1 over b squared we have there so I am left with my original problem and I now have a solution to that problem I have a solution to that problem just to show you with a line of code again just to make sure that we are doing the right thing I am using integrate there negative e to the power bx times the sine of x with respect to x and I get exactly the same solution as we have up there using the warframe language no problem now we have to find a solution of our first derivative of we have it at least with respect to b and let's plug that in and don't forget the negative sign that we originally had so it's there and I must just remember there it is that this is x going from 0 to x going to infinity now let's plug in x to infinity and then x equals 0 to get this derivative of i with respect to b so I have plugged in infinity all over where we had b and you have plugged in 0 now this term here cosine and b times the sine remember that depending on what b is this is not the term that is going to drive this process remember b was a positive value so this actually goes inside of the denominator and I have already have this infinity term there so the denominator far outpaces the numerator yes so this whole term goes to 0 and I'm left with on the this side the negative which is the negative there and the cosine of 0 is 1 sine of 0 is 0 1 plus 0 squared is 1 so I'm left with this very simple equation that the derivative of i with respect to b is negative 1 over b squared plus 1 brilliant brilliant we're still interested really in the i of 0 not in the derivative of i with respect to b and that b being 0 no we need i so how do I get i back from this very easy I integrate both sides with respect to b so there we have the indefinite integral with respect to b and the indefinite integral with respect to b and if I use the Wolfram language it's this negative the arc tangent of b just a reminder that the Wolfram language assumes that you know that this was an indefinite integral and that you should put the constant of integration there yourself now let's just do this by hand we did integration by hand up there so let's just use trigonometric substitution to do this little integral here on the right hand side very easy to do we're going to let b equals the tangent of a new variable theta that means the theta is the arc tangent of b and b squared plus 1 the tangent squared of theta plus 1 and I use a trig identity to show that that's just equal to the secant square and if I take db d theta the first derivative of the tangent of theta with respect to theta is just the secant square of theta I'm just bringing this d theta over to the right hand side so I have db equals secant squared of theta d theta so I have everything here to do my trig substitution let's do that so that was my original problem I plug in everything for db I'm plugging in secant square theta d theta and for my b squared plus 1 I have the tangent squared plus 1 I should put that theta over there not over there delete that remember that the theta should be on this side let's just put it in I can't just leave that as such there we go tangent of theta remember that the tangent squared of theta plus 1 that's just the secant squared in definite integral of 1 d theta that is negative theta plus c but remember theta up there that's the arc tangent of b so it's negative the arc tangent of b plus some constant c so I have this back the i of b which is what I originally wanted negative the arc tangent of b plus c and that equals this original problem that I had I just have to plug in b equals 0 my problem is in the new constant there c and I have to get the solution to that constant now that's actually quite easy to do if you think about it remember right initially I said if we let b go to infinity we are actually going to make that term smaller and smaller and smaller so let's do that let's take i with b equals infinity that leaves me with negative the arc tan of infinity plus c and I just plug in infinity with b everywhere with b everywhere there and if I think about this e to the power of negative infinity x times x that goes into the denominator this term blows up and the sin of x just oscillates between 1 and negative 1 so this part here actually goes to this is actually just 0 e to the power infinity in the denominator means it's just 0 so I'm left with the fact that on the right hand side I have this definite integral in going of 0 dx and remember that's just equal to 0 just remember that negative the arc tan of infinity that's actually negative pi over 2 plus c equals 0 so lo and behold I have a solution for c just to show you that the arc tan of infinity is actually pi over 2 so we have the negative pi over 2 there and we have a solution for c so there we have it I have after all of that work I of b equals negative the arc tan of b plus pi over 2 c is pi over 2 and what did I want to do I wanted to set b equal to 0 because that was going to be a solution to my problem so we have a negative there negative the arc tan of 0 plus pi over 2 the arc tan of 0 is just 0 and I'm left with the pi over 2 I of 0 is the pi over 2 just before I let you go just remember what this looks like the arc tan arc tangent function we can see if this goes out to infinity we're going to get to pi over 2 but the arc tangent of 0 is 0 just to show you there and there we have our solution but the definite integral of going from 0 to infinity of the sin of x with respect to x is to pi over 2 Feynman's technique of differentiating under the integral sin it is beautiful indeed