This is the first of various videos on how to integrate rational functions.
A rational function is a quotient of polynomials.
As usual, I will explain this method through examples.
This is my first example.
I want to find an antiderivative for the function (x+3)/(x-1)(x+1).
This is a quotient of polynomials.
The key idea to integrate all rational functions (or quotients of polynomials)
is that there are a few easier rational functions
that I already know how to integrate,
and then I'm going to try to rewrite all the others in terms of the ones
that I already know how to integrate.
In this case, what makes this difficult to integrate is the denominator.
If it were simply one polynomial, it would be easy.
So here is something with a similar denominator, but simpler.
1/(x-1).
This is a function whose antiderivative I know.
It's ln |x-1|.
And similarly, if I only had x+1 as denominator and 1 as numerator,
I would also know how to integrate that.
So now the objective is, can I rewrite this one in terms of those two?
Specifically, can I write this as some number divided by x-1
plus some other number divided by x + 1?
And here I have used the letters A and B,
and they represent real numbers that I need to find out.
What I'm doing here is sort of undoing "reducing to common denominator".
If I started with this,
I could use reducing to common denominator to end up with that.
So can I go back? Why?
Because this is what I want to integrate,
and this I'll know how to integrate no matter what this number is,
and this I'll know how to integrate no matter what this number is.
So let's do this in detail.
How do I find out the values of A and B that satisfy this equation?
I'm going to start by rewriting the equation.
In particular, I'm going to reduce the right-hand side to common denominator
so it looks like the left-hand side.
This equation is equivalent to the original one.
For these two quotients to be the same,
since the denominators are the same, then the numerators must also be the same.
Now I have an identity between polynomials.
I can group together terms of the same kind (of the same exponent).
So I have two terms with x, so the coefficient of x is A + B.
And I have two independent terms, so the independent term is A - B.
And now this is again equivalent to the original equation.
Saying that these two polynomials are the same
is the same as saying that they have the same coefficient of x,
so 1 must be equal to A + B,
and they have the same independent term, so 3 must be equal to A - B.
So we have reduced the problem to solving a system of linear equations.
Use your favorite method for system of linear equations,
and you will conclude that there is exactly one answer,
and the answer is A = 2 and B = -1.
So this is the only pair of numbers that satisfy the original equation,
which we could verify.
This is fine; there is at least one more alternative way to do the algebra
(actually, there are probably many),
but here's another one that is quite common.
Starting from this identity here, this is an equality between two functions,
so these two functions must be equal when I evaluate at any value of x.
In particular, there are two values of x that are particularly simple.
When x = 1, this term here is 0, so it's going to simplify.
So when x = 1 I get 1 + 3, which is 4,
which is equal to A times 1 + 1, which is 2, plus 0.
And then the other useful value is when x = -1,
because when x = -1, on the left-hand side I have -1 + 3, which is 2,
and here I have 0, and here I have -2B.
And from here I can immediately conclude that A is 2 and B is -1.
So it's another way to do the algebra, same result.
And again, we can verify that this works by plugging A = 2 and B = -1 here
and see that this equality holds.
So we are done with the algebra part. Let's go back and finish the integration.
We've done the hard part. What is left is easy.
This is the function I want to integrate, and we had just figured out
that I can rewrite this function as 2/(x-1) - 1/(x+1).
And now it's the sum of two functions I know how to integrate.
So an antiderivative could be 2ln|x-1| - ln|x+1|
plus don't forget the integration constant.
This is often rewritten using properties of logarithms as follows:
this could be ln|(x-1)²/(x+1)|.
Both expressions are equally fine, and that's the final answer.
This same method works in many other cases.
Here is a more general example.
Let's say I want to integrate
a function which is the quotient of an arbitrary polynomial P
divided by x³ - 3x² + 2x, but P is any polynomial.
There is a first thing I can do to simplify this function
that I didn't need to do in the previous example.
If the polynomial has very high degree, let's execute the division.
Or more exactly, I can do long division
and this quotient can always be written as, well,
a quotient that will be some polynomial,
plus a remainder divided by the same denominator.
And this is the same thing we do when we have fractions.
If for example I have numbers 7 divided by 2, 7 into 2 is 3,
so I can write it as the quotient 3, plus the remainder 1, over 2.
So here I can do the same thing.
The quotient plus a remainder over the same denominator.
And what we know is that the remainder
will have degree smaller than the denominator,
so it has degree at most 2.
So it will be written something like
a number times x², plus a number times x, plus a number.
Okay, now, the quotient is a polynomial, and I know how to integrate it.
So I only have to worry about integrating expressions of this type
when the numerator has degree at most 2.
To use similar ideas to the previous example,
I'm going to factor the denominator. Use your favorite method for that.
In this case, the denominator factors nicely.
And now I'm going to look at this expression,
and I'm going to try to rewrite it
into simpler terms I know how to integrate.
And there are three quotients of polynomials related to that
that I know how to integrate.
I know how to integrate anything divided by x,
or a number divided by x - 1, or a number divided by x - 2.
So just like before, I'm going to try to come up with real numbers A, B, and C
such that this polynomial will be equal to this.
I will have to determine what those numbers are,
just like I did in the previous example.
And if I accomplish that,
then I know how to integrate each one of those three things,
so I know how to integrate this, so I know how to integrate the sum,
so I know how to integrate the original function.
And I can see why this is a good idea.
If you take this and reduce it to common denominator,
in the top I'm going to have a polynomial of degree 2,
so it seems to match up.
And here there are three arbitrary parameters
and here there are three coefficients to determine,
so the numbers match up.
The formal proof for why this always works requires using linear algebra.
I'm basically doing a change of basis in a vector space of dimension 3,
but I don't want to go into that now.
So this method will allow us to integrate a lot of quotients of polynomials,
as long as the denominator can be factored into terms of degree 1
and they're all different.
In the next videos I will show some examples of what to do
when this is not the case.