Integration using completing the square and the derivative of arctan(x) | Khan Academy
All right, let's see if we can find the indefinite integral of ( \frac{1}{5x^2 - 30x + 65} , dx ). Pause this video and see if you can figure it out.
All right, so this is going to be an interesting one. It'll be a little bit hairy, but we're going to work through it together. So immediately, you might try multiple integration techniques and be hitting some walls. What we're going to do here is actually try to complete the square in this denominator right over here. By completing the square, we're going to get it in a form that looks like the derivative of arcTan. If that's a big hint to you, once again, pause the video and try to move forward.
All right, now let's do this together. I'm just going to try to simplify this denominator so that my coefficient on my ( x^2 ) term is a 1. I can just factor a 5 out of the denominator. If I did that, then this integral will become ( \frac{1}{5} \int \frac{1}{x^2 - 6x + 13} , dx ).
As I mentioned, I'm going to complete the square down here, so let me rewrite it. This is equal to ( \frac{1}{5} \int \frac{1}{\left( x^2 - 6x \right) + 13} , dx ). Clearly, ( x^2 - 6x ) is not a perfect square the way it's written. Let me write this ( + 13 ) out here.
Now, what could I add and then subtract if I don't want to change the value of the denominator in order to make this part a perfect square? Well, we've done this before. You take half of your coefficient here, which is (-3), and you square that. So, you want to add a 9 here, but if you add a 9, then you have to subtract a 9 as well.
This part is going to be ( (x - 3)^2 ) and then this part right over here is going to be equal to a positive 4. And of course, we don't want to forget our ( dx ) out here. Let me write it in this form. So this is going to be equal to ( \frac{1}{5} \int \frac{1}{(x - 3)^2 + 4} , dx ), which I could also write as ( + 2^2 ).
Actually, let me do it that way: ( + 2^2 dx ). Now, many of y'all might already be saying, "Hey, this looks a lot like arc tangent," but I'm going to try to simplify it even more, so it becomes very clear that it looks like arc tangent is going to be involved. I'm actually going to do some ( u ) substitution in order to do it.
The first thing I'm going to do is let's factor a ( 4 ) out of the denominator here. If we do that, then this is going to become ( \frac{1}{5} \cdot \frac{1}{4} \int \frac{1}{\frac{(x - 3)^2}{2^2}} , dx ). This is going to be a ( + 1 ), and of course, we have our ( dx ).
Then we could write this as ( \frac{1}{(x - 3)^2/2^2 + 1} ) and ( dx ). Now, the ( u ) substitution is pretty clear. I am just going to make the substitution that ( u ) is equal to ( \frac{x - 3}{2} ) or we could even say that's ( u = \frac{1}{2} x - \frac{3}{2} ). That's just ( \frac{x - 3}{2} ), and ( du ) is going to be equal to ( \frac{1}{2} dx ).
What I can do here is actually, let me start to re-engineer this integral a little bit so that we see a ( \frac{1}{2} ) here. If I make this a ( \frac{1}{2} ) and then I multiply the outside by 2, so I divide by 2 and multiply by 2 is one way to think about it. This becomes ( \frac{1}{10} ).
Doing my ( u ) substitution, I get ( \frac{1}{10} ) times the integral of, well, I have ( \frac{1}{2} dx ) right over here, which is the same thing as ( du ), so I could put the ( du ) either in the numerator or put it out here, and then I have ( \frac{1}{(u^2 + 1)} ).
Now, you might immediately recognize, what's the derivative of ( \text{arctan}(u) )? Well, that would be ( \frac{1}{u^2 + 1} ). So this is going to be equal to ( \frac{1}{10} \text{arctan}(u) ), and of course, we can't forget our big constant ( C ) because we're taking an indefinite integral.
Now, we just want to do the reverse substitution. We know that ( u ) is equal to this business right over here. So we deserve a little bit of a drum roll. This is going to be equal to ( \frac{1}{10} \text{arctan}\left( \frac{x - 3}{2} \right) + C ).
And we are done!