If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Integration using completing the square and the derivative of arctan(x)

Sometimes we can integrate rational functions by using the method of completing the square in the denominator and then integrating using u-substitution and our knowledge about the derivative of arctan(x).

Want to join the conversation?

  • blobby green style avatar for user guineapigg
    this was amazingly complicated compared to all the preceding videos
    (76 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user KEVIN
      I kind of agree; it seems complicated from the perspective of Sal not really discussing integrals of the inverse trig functions. When he said "... recognize arctan..." I was pretty sure I had not seen arctan in this context. If someone thinks I've missed something, please let me know.
      (44 votes)
  • hopper cool style avatar for user Iron Programming
    Why do they never give examples or questions using the anti-derivative or arccos(x) in the next skill?

    I want to be prepared of that in case someone were to ask me, or if I were to ever need the information myself.

    Thanks in advance,
    - ncochran2
    (13 votes)
    Default Khan Academy avatar avatar for user
    • leaf grey style avatar for user Alex
      By "anti-derivative", I'm assuming you mean the antiderivative of the inverse trig functions? Well, here they are:

      ∫ arcsin x dx = x arcsin x + √(1 - x²) + C
      ∫ arccos x dx = x arccos x - √(1 - x²) + C
      ∫ arctan x dx = x arctan x - ½ln(1 + x²) + C
      ∫ arccot x dx = x arccot x + ½ln(1 + x²) + C
      ∫ arcsec x dx = x arcsec x - ln(x + √(x² - 1)) + C
      ∫ arccsc x dx = x arccsc x + ln(x + √(x² - 1)) + C

      Now I don't know whether you're looking at the course from the general calculus page or the AP Calc AB / BC page, but I know that this content will not be on the AP Exam (if you're in the AP course).

      As for arccos, arccsc, and arccot, I wondered about that myself previously, and I found that it was simply due to mathematicians choosing the convention that arcsin, arcsec, and arctan were to be used for the integrals, as the other three are simply the negative of arcsin, arcsec, and arctan respectively.
      Hope that I helped.
      (14 votes)
  • leafers ultimate style avatar for user Samuel Rodriguez
    Is there a general pattern to look out for to know when completing the square will lead to an expression similar to trig derivatives?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • leafers ultimate style avatar for user jenneking
      Only the arc trig functions' derivatives are numerical. To spot these within integrals, I look for the pattern a^2 + b^2 or a^2 - b^2. If there is a + sign between the terms, the integral is likely to evaluate to something with either arctan or arccot. If there is a - sign instead, the result of the integral is likely to involve arcsin or arccos.

      Completing the square always results in one of those patterns.. so if there is something that resembles a quadratic in the denominator of your integral, then you end up with an integral that requires a process similar to that of the video's.
      (2 votes)
  • blobby green style avatar for user Shaheer Mir
    Ive gone through all the Calc videos before this. Never once have we covered derivative of arctan(x).
    (11 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user bk
    wha just hapend at ? why do we get ∫1/((x-3)/2^2)+1dx
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user elaw3670
    You don't need all that extra stuff to get your u. Much simpler to simply say: at 1/(x-3)^2 + 2^2, make u = x - 3. Then, when you take your antiderivative, you would get 1/5 (1/2 arctan (u/2) + C); distribute and unsubstitute for: 1/10 arctan (x+3)/2 + C.
    (5 votes)
    Default Khan Academy avatar avatar for user
  • primosaur ultimate style avatar for user Kelli Van Brunt
    Is using ln(x) another option to integrate this rational function instead of using arctan(x)? And how would you differentiate between the two cases? Or are they just two ways to do the same problem?

    For instance, with the problem Sal showed in the video, if you took the antiderivative as ln(x), you'd end up with ln(x^2-6x+13)/10(x-3), unless I'm mistaken. Is this equivalent to the result Sal got?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • duskpin seedling style avatar for user zahraa raafat
    at , why do we multiply the nominator by half?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • female robot grace style avatar for user raquelsanchezvant
    when taking out the 4, why do we multiply it by 1/5 if it being added in the equation.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user josephmvillegas14
    how do did you take out a 4 and then have 2^2 under x-3 at and why did you (2)^2 instead of (4)^2
    (2 votes)
    Default Khan Academy avatar avatar for user

Video transcript

- [Instructor] All right, let's see if we can find the indefinite integral of one over five x squared minus 30x plus 65 dx. Pause this video and see if you can figure it out. All right, so this is going to be an interesting one. And it'll be a little bit hairy, but we're gonna work through it together. So, immediately you might try multiple integration techniques and be hitting some walls. And what we're going to do here is actually try to complete the square in this denominator right over here. And then by completing the square, we're gonna get it in the form that it looks like the derivative of arctan. And 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. So I'm just gonna try to simplify this denominator so that my coefficient on my x squared term is a one. And so I could just factor a five out of the denominator. If I did that, then this integral will become 1/5 times the integral of one over, so I've factored a five out of the denominator so it is x squared minus six x plus 13 dx. And then as I mentioned I'm gonna complete the square down here. So let me rewrite it, so this is equal to 1/5 times the integral of one over, and so x squared minus six x is clearly not a perfect square the way it's written. Let me write this plus 13 out here. Now what could I add and then I'm gonna to have to subtract if I don't want to change the value of the denominator. In order to make, In order to make this part right over here a perfect square. Well we've done this before, you take half of your coefficient here, which is negative three and you square that. So you want to add a nine here. But if you add a nine then you have to subtract a nine as well. And so this part is going to be x minus three squared and then this part right over here is going to be equal to a positive four and we of course don't want to forget our dx out here. And so let me write it in this form. So this is going to be equal to 1/5 times the integral of one over, get myself some space, x minus three squared plus four, which we could also write as plus two squared. Actually let me do it that way, plus two squared dx. Now many of y'all might already say hey this looks a lot like arc tangent, but I'm gonna 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 gonna do some u substitution in order to do it. So the first thing I'm going to do is let's factor a four out of the denominator here. So if we do that, then this is going to become 1/5 times 1/4 which is going to be 1/20 times the integral of one over x minus three squared over two squared. And this is going to be a plus one, and of course we have our dx. And then we could write this as, and I'm trying to just do every step here. A lot of these you might have been able to do in your head. One over, and I'll just write this as, x minus three over two squared plus one. Plus one and then dx. And now the u substitution is pretty clear. I'm just going to make the substitution that u is equal to x minus three over two. Or we could even say that's u is equal to one half x minus three halves, that's just x minus three over two. And du is going to be equal to one half dx. And so what I can do here is, actually let me start to re-engineer this integral a little bit so that we see a one half here. So if I make this a one half and then I multiply the outside by two. So I divide by two multiply by two. It's one way to think about it. This becomes 1/10 and so doing my u substitution I get 1/10, that's the 1/10 there times the integral of. Well I have one half dx right over here which is the same thing as du. So I can put the du either in the numerator or I could put it out here. And then I have one over, this is u squared, u squared plus one. Now you might immediately recognize, what's the derivative of arctan of u? Well that would be one over u squared plus one. So this is going to be equal to 1/10 times the arc tangent of u, and of course we can't forget our big constant C because we're taking an indefinite integral. And 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 1/10 times the arc tangent of u. Well u is just x minus three over two, which could also be written like this. So arctan of x minus three over two and then plus C. And we are done.