in this video we're going to talk about how to integrate rational functions using partial fraction decomposition so the first thing we want to do is make sure that this integral is completely factored on the bottom we have a difference of perfect squares and so we can factor that expression by taking the square root of x squared which is x and the square root of four which is two one is going to be positive two the other will be negative two so what we have on the bottom is two distinct linear factors now you might be wondering what is the difference between a linear factor and a quadratic factor linear factors include examples such as x 3x x plus 4 4x minus 5 those are linear factors quadratic factors they typically have an x squared so x squared x squared plus 4 that's a quadratic factor x squared plus 3x that's another one or x squared plus 2x plus 7. those are quadratic factors now to use the technique of partial fraction decomposition what we're going to do is we're going to break up this expression into two smaller fractions so here we have x plus 2 on the bottom we're going to have some constant over x plus 2 dx and here we have another linear factor on the bottom so we're going to have another constant on top over x minus 2 dx if we had a quadratic factor let's say like for instance x squared plus eight instead of putting a constant like a or b we would put a linear factor ax plus b or like bx plus c if we had a quadratic factor on the bottom now just to give you an idea of what partial fraction decomposition is let's say if we have 1 plus 4 i mean 1 over 4 plus 1 over five if we wish to add these two fractions we would need to get common denominators if we multiply this fraction by five over five it will become five over twenty if we multiply this by four over four it will become four over twenty so the sum of these two fractions one over four plus one over five it's nine over twenty partial fraction decomposition allows us to start with this fraction nine over twenty and break it down into these two simpler fractions one over four plus one over five so that's a good example of partial fraction decomposition we could take a single fraction and break it up into two smaller fractions it could be two or more smaller fractions it could be three fractions it could be four but that's the idea behind partial fraction decomposition we're taking a single fraction and break it up into multiple fractions so what we need to do here is we need to determine the value of a and b in this problem so for now i'm going to get rid of the integral symbol and the dx term and we're going to set this fraction equal to a over x plus two plus b over x minus two if we can calculate the value of a and b then we could use that to find the indefinite integral of those two expressions so we're going to do right now is we're going to multiply every term by the denominator on the left side so that is by x plus 2 and x minus 2. so when multiplying this fraction by these two factors this is going to cancel and we're going to be left with 1 on the left side of the equation if we take a over x plus 2 and multiply by x plus 2x minus 2 the x plus 2 factors will cancel leaving behind a times x minus two now let's take this fraction multiply by those two factors so x minus two will cancel and we're gonna have b times x plus two now when you have linear factors like x minus two and x plus two there's a shortcut technique that you could use in order to calculate the value of a and b and that is by plugging in certain x values if we were to plug in x equals two this term becomes zero so we're gonna have one is equal to a times two minus two two minus two is zero so this becomes 0 plus b and this is going to be 2 plus 2 which is 4. so what we have is 1 is equal to 4b and then dividing both sides by 4 we get that b is equal to 1 over 4. now another value that we can plug in is negative two if we plug in negative two negative 2 plus 2 becomes 0. so this whole thing becomes 0. and so what we're going to have is 1 is equal to a times negative 2 minus 2 and negative 2 minus two is negative four dividing both sides by negative four we'll get that a is negative one over four so now we have the values of a and b so going back to this expression let's replace a with negative 1 4 and then let's replace b with positive 1 4. now what we're going to do is we're going to take these constants and move them to the front so this is going to be negative 1 over 4 integral 1 over x plus 2 dx and then plus positive 1 over 4 integral 1 over x minus 2 dx now let's talk about how we can integrate rational functions the anti-derivative of one over x is ln x now we need to use an absolute value symbol because we can't have a negative value inside a natural log function it's not going to work it's going to be undefined so let's say if we want to integrate 1 over x plus 5 it's going to be the natural log of x plus five if we have a constant on top of that let's say four over x plus seven this is going to be it's ln x plus seven but times four now let's see if we have the anti-derivative of one over two x plus seven this is going to be ln two x plus seven but we need to take into account the 2 in front of the x the derivative of x is 1. so when you divide this by 1 the answer doesn't change the derivative of 2x is 2. so we need to divide this by two it turns out this is going to be one-half ln 2x plus seven likewise if we want to find the anti-derivative of one over three x plus eight this is going to be ln 3x plus 8 but then divided by the derivative of 3x which is 1 over 3. and of course all of these have plus c the constant of integration now let's see if we have 7 divided by 5x plus 9. so this one we have to be more careful this is going to be ln 5x plus 9 but we need to divide this by the derivative of 5x which is going to be five so it's one over five if we're dividing it and then we have to multiply it by seven so it's time seven times one fifth ln five x plus nine so you're going to be using this a lot when dealing with uh partial fraction integration so i want to just give you some ideas on how to integrate rational functions into natural logarithmic functions so the antiderivative of one over x plus two that's simply going to be ln x plus 2. and the anti-derivative of x minus 2 is going to be ln i mean the anti-derivative of 1 over x minus 2 is ln x minus 2. now let's add the constant of integration now what i'm going to do is i'm going to factor out 1 over 4 and i'm going to write the positive term first and the negative term second so factoring out one over four we're going to get ln x minus two minus ln x plus two now a property of logs is that we can convert two logs into a single log for instance let's say we have ln a minus lnb we can write this as ln a over b or if we have ln a plus lnb we can write this as a single log ln a times b but for this problem we have a minus sign so we're going to use that property of natural logs which applies for all logs so we could rewrite this answer as 1 over 4 times ln absolute value this is going to go on top since it's positive this is going to go on the bottom since it has a negative sign in front of it and then plus c so this is the final answer for this problem so that is the anti-derivative of 1 over x squared minus 4. so that's how we can get that answer using integration by partial fractions now let's work on a similar example for the sake of practice so feel free to pause the video if you want to try this example we have the integral of x minus 4 over x squared plus 2x minus 15. so go ahead and try this problem the first thing we need to do is we need to factor this expression completely particularly the denominator and what we have is a trinomial where the leading coefficient is one so we need to find two numbers that multiply to the constant negative 15 but add to the middle coefficient too so this is going to be positive 5 and negative 3. 5 plus negative 3 adds up to 2 but multiplies to negative 15. so to factor this expression it's going to be x plus 5 times x minus 3. so here we have two distinct linear factors so we can write this as the integral of a over x plus 5 dx plus the integral of b over x minus 3 dx so like last time we need to calculate the value of a and b and then we could find the answer so let's set this fraction equal to the two fractions that we have on the right just without the integral symbol so this is gonna be a over x plus five and then plus b over x minus 3. and just like before we're going to multiply everything by those two factors so multiplying this fraction by x plus five times x minus three these will cancel and we're gonna get x minus four on the left side of the equation and this fraction times those two factors x plus 5 will cancel and we're going to have a times x minus 3 left over and then when we multiply b over x minus 3 by these two factors the x minus 3 factor will cancel leaving behind b times x plus 5. so like before we're going to plug in x values to calculate the value of a and b so let's begin by plugging in 3. if we plug in x equals 3 this term goes to zero so we're going to have three minus four is equal to zero plus a b times three plus five now three minus four is negative one three plus five is eight dividing both sides by eight we're going to get that b is equal to negative one over eight so now let's go ahead and calculate a what x value do we need to plug in to get a to find that x value you could set x plus five equal to zero and solve for x if you do you get x is equal to negative five so that's we're gonna plug in we're gonna plug in negative five so this becomes negative five minus four is equal to a times negative five minus three and then negative five plus five will become zero we can write it out to show your work if you want to negative five minus four is negative nine negative five minus three is negative eight and then negative five plus five is zero dividing both sides by negative eight we get that a is equal to positive nine over eight the two negative signs will cancel so now that we have the values of a and b we can go ahead and plug it in into the original expression so this becomes nine over eight and this is going to be negative one over eight so we can rewrite this as nine over eight times the integral of one over x plus five dx and then minus one over eight times the integral of one over x minus three dx the anti-derivative of one over x plus five is going to be the natural log of x plus 5 and then the antiderivative of 1 over x minus 3 is going to be ln x minus 3. and then plus c since the constants in front of ln are different it might be good to leave it in this form now you could still combine it into its into a single log expression if you want to if you wish to do that what i would do is move the 9 here a property of logs allows you to move the coefficient to the exponent position for instance 2 ln x is equal to ln x squared you can move the 2 to the exponent position of x so first i would rewrite it as 1 over 8 ln and this would be x plus 5 to the ninth power but still within an absolute value symbol and then minus 1 over 8 ln x minus 3 plus c and then we could factor out 1 over 8 at this point and then write it as a single log expression so it's going to be 1 over 8 ln absolute value x plus 5 raised to the 9th power over x minus 3 and then plus c so you can write it like this as a single log if you wish so that's it for this problem so let's try a slightly harder problem so in this problem we have the linear factor x minus one but we also have a repeated linear factor x minus two so how can we set up this problem well what we're going to do is we're going to write three fractions instead of two we're going to have the integral of a over x minus one and then we're going to have the integral of b over the other linear factor x minus two and since it's x minus 2 squared we're going to have another a fraction this one's going to be c over x minus 2 squared so that's what you need to do if you have a repeated linear factors for instance let's say if we have 1 over x minus 3 to the third power to break it up using partial fractions this would be a over x minus 3 plus a b over x minus 3 squared and then plus c over x minus 3 cubed so that's how we would set up the problem if this was raised to the third power let's go ahead and work on this one so let's rewrite without the integral symbols so we're going to multiply every fraction by x minus 1 times x minus 2 squared so when multiplying these two these will completely cancel leaving behind x on the left side of the equation when multiplying these two x minus one will cancel and we'll be left with a times x minus two squared next we're multiplying these two only one of the two x minus two factors will cancel so we're gonna have b times x minus one times x minus two and finally the x minus two squared terms will cancel and we'll be left with c times the factor x minus one now what we're going to do is we're going to plug in some numbers let's focus on the x minus 2 factor so we're going to plug in is we're going to plug in x equals 2. this is going to be 2 and then this is going to be a 2 minus 2 is 0 and then b 2 minus 1 is 1 2 minus 2 is 0 and then plus c 2 minus 1 is 1. so we get 2 is equal to c because those they go to 0. so let's write that here c is equal to 2. now since we have some x minus 1 factors we're going to plug in x equals 1. so this is going to be 1 a and then 1 minus 2 squared plus b 1 minus 1 is 0. and for c it's one minus one which is also zero one minus two squared that's negative one squared which is positive one so basically a is equal to one now to get b we need to plug in some other number that's not one or two so let's pick the next best number which is three this is going to be three a three minus two is one one squared is one and then three minus one is two three minus two is one and then three minus one is two now we know a is one so that becomes one and c is two so two times two is four and one plus four is five that is adding those two subtracting both sides by five we're gonna have three minus five which is negative two and then if we divide both sides by two we'll get that b is equal to negative one so let's replace a with one and let's replace b with negative one and then c with two the antiderivative of one over x minus one is going to be ln x minus one and absolute value and then next this is going to be negative ln x minus 2. for this one we could use u substitution so i'm going to rewrite the expression as 2 times the integral of one over x minus two squared so we're going to make u equal to x minus two d u is going to equal dx so this becomes two times the integral of one over u squared d u moving the u variable to the top this becomes two integral u to the negative two now we can integrate using the power rule so we're going to add a 1 to the negative 2 exponent so it becomes u to the negative 1 and then we're going to divide it by negative 1. bringing u back to the bottom this becomes negative 2 over u and then replacing u with x minus two it becomes negative two over x minus two so this is the answer now if we want to we can write the two log expressions into a single log so we can write it as ln x minus one over x minus 2 and then minus 2 over x minus 2 plus c so we can leave the answer like this if we wish so that's it for problem number 3. go ahead and try this problem find the antiderivative of x squared plus nine over x squared minus one times x squared plus four so as always you wanna make sure that the denominator of the fraction is completely factored we can't factor x squared plus four but we can factor x squared minus one since we have a difference of perfect squares the square root of x squared is x the square root of one is one so we're gonna have x plus one and x minus one so what we have here is two linear factors and a quadratic factor so we can set this up as a over x plus one and then plus b over x minus one now for the quadratic factor x squared plus four on top we're going to write c x plus d instead of c or d by itself so that's how we can set up the partial fraction decomposition now on top we can write this as the integral of a over x plus one dx and then plus the integral of b over x minus one d x and then plus the integral of c x plus a d over x squared plus four now let's multiply both sides of the equation by this denominator here so i'm just going to write this on this side so we have x plus one x minus one and x squared plus four so these will completely cancel leaving behind x squared plus nine on the left side and then this fraction times all of that the x plus one fact the x plus one factors will cancel leave behind a times x minus one times x squared plus four next we're going to multiply this fraction by that x minus 1 will cancel and so we're going to have b times x plus 1 times x squared plus 4. it's important to be very careful with every step because if you make one mistake this is a long problem the whole problem is is going down the drain so it's good to take your time working with these problems so now multiplying this by what we have here x squared plus 4 will cancel leaving behind cx plus d times x plus 1 times x minus one now the term x squared plus four will always be greater than zero so there's no x value that we can plug in to make that disappear now we do have some linear factors x minus one and x plus one so we can plug in x equals positive one and x equals negative one to turn those linear factors into zero so let's start by plug in x equals positive one first so we're gonna have one squared plus one i mean one squared plus nine rather and then a times one minus one is going to be zero so this entire term becomes zero and then plus b one plus one is two one squared plus four that's gonna be five and here we have an x minus one factor so when we plug in one that entire term here is gonna be zero so one plus nine is ten two times five is ten so we have ten is equal to ten b dividing both sides by ten we get that b is equal to one so let's go ahead and replace b with one so now that we use x equals one let's try plugging in x equals negative one negative 1 squared is still 1 so we're going to have 1 plus 9 which is 10 on the left side and then it's going to be a 1 minus 1 is negative 2 negative one squared plus four that's going to be positive one plus four which is five when we plug in negative one into x plus one that's gonna be zero and this will be zero as well so we get 10 is equal to negative 10 a dividing both sides by negative 10 we can see that a is negative one now what's the next x value that you think we should plug in i would recommend plugging in x equals zero we have the values for a and b we have to focus on c and d if we plug in zero c disappears which means we'll only have d left over which means we could solve for d so on the left we're going to have 0 squared plus 9 this is going to equal a we know a is negative 1 and then 0 minus 1 is negative 1. 0 squared plus 4 that's four b is positive one zero plus one is one and zero squared plus four that's gonna be four again c x plus d this is gonna be c times zero plus d zero plus one is one zero minus one is negative one so this is nine negative one times negative one times four is four and then we have another four c times zero plus d is just a d and then we have one times negative one so this is nine is equal to eight minus d subtracting both sides by eight we have nine minus eight which is negative one and that's equal actually that's positive one and that's equal to negative d so d is equal to negative one so let's put negative one here for d now we need to calculate c to do that let's pick the next best x value and let's go with x equals two since we know a b and c i mean we know a b and d so now we can just find the missing constant c so plugging in 2 for x this is going to be 2 squared plus 9 a is negative 1 2 minus 1 is 1 2 squared plus 4 that's going to be 8 b is 1 2 plus 1 is 3 and 2 squared plus 4 is 8 again cx plus d we're looking for c we have x which is 2 so this is going to be c times 2 or 2c and d is negative 1. and then we have two plus one which is three two minus one which is one two squared is four four plus nine is thirteen and then we have negative eight plus twenty four and then if we distribute three to two c minus one that becomes six c minus three negative eight plus twenty four that's going to be 16 and then we have 16 minus 3 which is 13. subtracting 13 from both sides 13 minus 13 is zero and so c is equal to zero so this becomes zero x which basically it disappears so now that we have the values of a b c and d we can go ahead and determine the integral for this original expression so the integral of negative one over x plus one that's going to be negative ln absolute value x plus one and this is going to be plus the natural log absolute value x minus one now this part here there's a formula that can help us to integrate it if you wish to find the integral of dx over x squared plus a squared this is going to be 1 over a arc tangent x over a plus c so in this example we can see that a squared is four so therefore a is two now we do have a negative one so we need to put a negative here so this can be negative one over a or negative one over two arc tangent x over two plus c so that's gonna be the integral of that expression now if for some reason you're not allowed to use that formula and you have to show your work here's what you can do so i'm going to move the negative sign to the front so let's start with this expression we're going to use trig substitution so we're going to make x well rather we're going to make x squared equal to 4 tan squared so x is going to be 2 tangent theta dx is going to be 2 times the derivative of tangent which is secant squared theta and then times d theta so this is going to be we're going to replace the dx with 2 secant squared theta d theta on the bottom we have four tan square theta and then plus four so i replace the x squared and dx now what we're going to do now is we're going to factor the four so then we're going to be left with uh tangent squared plus one two over four reduces to one half so i'm going to move the one half to the front so we have negative one half integral secant squared d theta one plus tan squared is equal to secant squared so we could cancel secant squared so this becomes negative one half integral d theta which is the integral of d theta is simply theta now we need to find out what theta is equal to so in this equation i'm going to divide by 2 so we get x over 2 is equal to tangent theta if we take the arc tangent of both sides of this equation we'll get our tangent x over 2 is equal to our tangent of tangent of theta the arctan and the tan cancel giving us theta so theta is arc tangent x over two and then we could put plus c so that's how you can show your work converting this expression into an arc tangent expression but if you know the formula it'll save you time but at least you know what to do so what i recommend doing if you have to show your work is replace the x squared term with 4 tangent squared the reason why i chose 4 tangent squared is because of the four here so you can factor out a four get tan squared plus one and convert that into secant squared so if this was x squared plus nine i would make x squared nine tangent squared so now let's go ahead and finish this problem what we can do is combine this into a single log expression so this is going to be the natural log we're gonna put the positive one on top so it's x minus one over x plus one and then minus one half arc tangent x over two plus c so that's the answer for this problem you