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 4, which is 2. One is going to be positive 2, the other will be negative 2. 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 8, 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 at the bottom. Now just to give you an idea of what partial fraction decomposition is, let's say if we have 1 over 4 plus 1 over 5. If we wish to add these two fractions, we would need to get common denominators. If we multiply this fraction by 5 over 5, it will become 5 over 20. If we multiply this by 4 over 4, it will become 4 over 20. So the sum of these two fractions, 1 over 4 plus 1 over 5, it's 9 over 20. Partial fraction decomposition allows us to start with this fraction, 9 over 20, and break it down into these two simpler fractions, 1 over 4 plus 1 over 5. 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 2 plus b over x minus 2. 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 what 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 it by x plus 2 x minus 2, the x plus 2 factors will cancel, leaving behind a times x minus 2. now let's take this fraction multiplied by those two factors So x minus 2 will cancel, and we're going to have b times x plus 2. Now when you have linear factors like x minus 2 and x plus 2, 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 2, this term becomes 0. So we're going to have 1 is equal to a times 2 minus 2. 2 minus 2 is 0. 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 2. If we plug in negative 2, 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 2 is negative 4. Dividing both sides by negative 4, we'll get that a is negative 1 over 4. So now we have the values of a and b. So going back to this expression, let's replace a with negative 1 fourth. And then let's replace b with positive 1 fourth. 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 gdx. Now let's talk about how we can integrate rational functions. The antiderivative of 1 over x is lnx.
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 5. If we have a constant on top of that, let's say 4 over x plus 7, this is going to be its ln x plus 7 but times 4. Now let's say if we have the antiderivative of 1 over 2x plus 7. This is going to be ln 2x plus 7, 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 2. It turns out this is going to be 1 half ln 2x plus 7. Likewise, if we want to find the antiderivative of 1 over 3x plus 8, 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 say 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 5. So it's 1 over 5 if we're dividing it. And then we have to multiply it by 7. So it's times 7 times 1 fifth ln 5x plus 9. So you're going to be using this a lot when dealing with 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 1 over x plus 2, that's simply going to be ln x plus 2. And the antiderivative of x minus 2 is going to be ln. I mean the antiderivative 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 1 over 4, we're going to get ln x minus 2 minus ln x plus 2. 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 ln B. We can write this as ln A over B. Or if we have ln A plus ln B, 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 antiderivative 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 1. So we need to find two numbers that multiply to the constant negative 15, but add to the middle coefficient 2. 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 can 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 going to be a over x plus 5, 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 5 times x minus 3, these will cancel. And we're going to get x minus 4 on the left side of the equation.
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 0. So we're going to have 3 minus 4. is equal to 0 plus b times 3 plus 5. Now 3 minus 4 is negative 1. 3 plus 5 is 8. Dividing both sides by 8, we're going to get that b is equal to negative 1 over 8. 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 5 equal to 0 and solve for x.
If you do, you get x is equal to negative 5. So that's what we're going to plug in. We're going to plug in negative 5. So this becomes negative 5 minus 4 is equal to a times negative 5 minus 3. And then negative 5 plus 5 will become 0. But you can write it out to show your work if you want to. Negative 5 minus 4 is negative 9. Negative 5 minus 3 is negative 8. And then negative 5 plus 5 is 0. Dividing both sides by negative 8. we get that a is equal to positive 9 over 8. 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 9 over 8, and this is going to be negative 1 over 8. So we can rewrite this as 9 over 8 times the integral of 1 over x plus 5 dx, and then minus 1 over 8 times the integral of 1 over x minus 3 dx. The antiderivative of 1 over x plus 5 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 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 9th power, but still within an absolute value symbol, and then minus 1 over 8 ln x minus 3 plus c. And then we can 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 1, but we also have a repeated linear factor x minus 2. So how can we set up this problem?
Well, what we're going to do is we're going to write 3 fractions instead of 2. We're going to have the integral of a over x minus 1. And then we're going to have the integral of b over the other linear factor, x minus 2. And since it's x minus 2 squared, we're going to have another fraction. This one's going to be c over x minus 2 squared. So that's what you need to do if you have 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 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 it 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 1 will cancel and we'll be left with a times x minus 2 squared. Next, we'll multiply these two. Only one of the two x minus 2 factors will cancel. So we're going to have b times x minus 1 times x minus 2. And finally, the x minus 2 squared terms will cancel, and we'll be left with c times the factor x minus 1. 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 what 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 2. 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 1 minus 1, which is also 0. 1 minus 2 squared. That's negative 1 squared, which is positive 1. So basically, a is equal to 1. Now, to get b, we need to plug in some other number that's not 1 or 2. So let's pick the next best number, which is 3. This is going to be 3, a, 3 minus 2 is 1, 1 squared is 1, and then 3 minus 1 is 2, 3 minus 2 is 1, and then 3 minus 1 is 2. Now we know a is 1, so that becomes 1, and c is 2, so 2 times 2 is 4, and 1 plus 4 is 5. That is, adding those two. Subtracting both sides by 5, we're going to have 3 minus 5, which is negative 2. And then if we divide both sides by 2, we'll get that b is equal to negative 1. So let's replace a with 1. And let's replace b with negative 1, and then C with 2. The antiderivative of 1 over x minus 1 is going to be ln. x minus 1 in 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 1 over x minus 2 squared. So we're going to make u equal to x minus 2. du is going to equal dx. So this becomes 2 times the integral of 1 over u squared.
Du moving the u variable to the top this becomes 2 integral u to the negative 2 Now we can integrate using the power rule So we're going to add 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 2, it becomes negative 2 over x minus 2. 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 1 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 9 over x squared minus 1 times x squared plus 4. So as always, you want to make sure that the denominator of the fraction is completely factored. We can't factor x squared plus 4, but we can factor x squared minus 1, since we have a difference of perfect squares.
The square root of x squared is x, the square root of 1 is 1. So we're going to have x plus 1 and x minus 1. So what we have here is two linear factors and a quadratic factor. So we can set this up as a over x plus 1 and then plus b over x minus 1. Now for the quadratic factor x squared plus 4, on top we're going to write cx 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 1 dx, and then plus the integral of b over x minus 1 dx, and then plus the integral of cx plus d over x squared plus 4. 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 1, x minus 1, and x squared plus 4. So these will completely cancel, leaving behind x squared plus 9 on the left side. And then this fraction times all of that, the x plus 1 factors will cancel, leaving behind a times x minus 1 times x squared plus 4. 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 going down the drain.
So it's going 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 1. Now, the term x squared plus 4 will always be greater than 0. So there's no x value that we can plug in to make that disappear. Now we do have some linear factors, x minus 1 and x plus 1. So we can plug in x equals positive 1 and x equals negative 1 to turn those linear factors into 0. So let's start by plugging in x equals positive 1 first. So we're going to have 1 squared plus 1, I mean 1 squared plus 9 rather. And then a times 1 minus 1 is going to be 0. So this entire term becomes 0. And then plus b, 1 plus 1 is 2. 1 squared plus 4, that's going to be 5. And here we have an x minus 1 factor, so when we plug in 1, that entire term here is going to be 0. So 1 plus 9 is 10, 2 times 5 is 10. So we have 10 is equal to 10b, dividing both sides by 10, we get that b is equal to 1. So let's go ahead and replace b with 1. So now that we use x equals 1, let's try plugging in x equals negative 1. 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 1 squared plus 4. That's going to be positive 1 plus 4, which is 5. When we plug in negative 1 into x plus 1, that's going to be 0. And this will be 0 as well. So we get 10 is equal to negative 10a. Dividing both sides by negative 10, we can see that a is negative 1. Now, what's the next x value that you think we should plug in? I would recommend plugging in x equals 0. We have the values for a and b.
We have to focus on c and d. If we plug in 0, 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 4. b is positive 1. 0 plus 1 is 1. And 0 squared plus 4, that's going to be 4 again. cx plus d. This is going to be c times 0. plus d.
0 plus 1 is 1. 0 minus 1 is negative 1. So this is 9. Negative 1 times negative 1 times 4 is 4. And then we have another 4. c times 0 plus d is just d. And then we have 1 times negative 1. So this is 9 is equal to 8 minus d. Subtracting both sides by 8, we have 9 minus 8, which is negative 1. And that's equal, actually that's positive 1. And that's equal to negative d.
So d is equal to negative 1. So let's put negative 1 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 2 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. D is negative 1. And then we have 2 plus 1, which is 3. 2 minus 1, which is 1. 2 squared is 4. 4 plus 9 is 13. And then we have negative 8 plus 24. And then if we distribute 3 to 2c minus 1, that becomes 6c minus 3. Negative 8 plus 24. 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 0. And so c is equal to 0. So this becomes 0x, which basically 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 1 over x plus 1, that's going to be negative ln absolute value x plus 1. And this is going to be plus the natural log absolute value x minus 1. 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 4, so therefore a is 2. Now we do have a negative 1, so we need to put a negative here. So this is going to be negative 1 over a, or negative 1 over 2, arc tangent, x over 2 plus c.
So that's going to 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, or 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 dx with 2 secant squared theta d theta. On the bottom we have 4 tan squared theta, and then plus 4. So I replaced x squared and dx. Now what we're going to do now is we're going to factor the 4. So then we're going to be left with tangent squared plus 1. 2 over 4 reduces to 1 half.
So I'm going to move the 1 half to the front. So we have negative 1 half integral secant squared d theta. 1 plus tan squared is equal to secant squared. So we could cancel secant squared.
So this becomes negative 1 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 arc tangent x over 2 is equal to arc tangent of tangent of theta. The arc tan and the tan cancel giving us theta. So theta is Arc tangent x over 2. 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 4 here So you can factor out a 4, get tan squared plus 1 And convert that into secant squared So if this was x squared plus 9 I would make x squared 9 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 going to put the positive one on top. So it's x minus 1 over x plus 1 and then minus 1 half arc tangent x over 2 plus c.
So that's the answer for this problem.