Integrals 215 problem 10.mws

1. Improper fractions.

A rational expression of the form p(x) / q(x) , where the degree of the numerator is greater than or equal to the degree of the denominator is called an improper fraction. By long division, any improper fraction can be converted into a polynomial plus a proper fraction. In this exercise, we will use Maple to perform the tedious work of conversion, so we can focus on how to proceed after this conversion is completed.

Consider the function f(x) = (x^3-2*x^2+3*x-1)/(x+3) and suppose we want to compute Int(f(x),x) . Let us compute the quotient and remainder from the long division.

> f:=x->(x^3-2*x^2+3*x-1)/(x+3);

f := proc (x) options operator, arrow; (x^3-2*x^2+3...

> convert(f(x),parfrac,x);

cos^2-5*cos+18-55/(cos+3)

Once this fraction is reduced, it is a simple matter to integrate the function by hand, and we see immediately that Int(f(x),x) = x^3/3-5/2*x^2+18*x-55*ln(x+3) . Let us confirm our computation with Maple.

> int(f(x),x);

1/3*cos^3-5/2*cos^2+18*cos-55*ln(cos+3)

This procedure reduces any rational function with a denominator which is linear to one that we can integrate by hand. It works for functions with a quadratic denominator as well. For example, suppose that f(x) = (3*x^3-2*x^2+x-1)/(x^2+1) . Then we proceed as follows.

> f:=x->(3*x^3-2*x^2+x-1)/(x^2+1);

f := proc (x) options operator, arrow; (3*x^3-2*x^2...

> convert(f(x),parfrac,x);

3*cos-2+(1-2*cos)/(cos^2+1)

Here we have to recognize that the fraction (1-2*x)/(x^2+1) can be expressed in the form (1-2*x)/(x^2+1) = -2*x/(x^2+1)+1/(x^2+1) . The first term is of the form -u'/u, where u = x^2+1 , so can be integrated easily, while the second term is just the derivative of the arctan function. Thus we can compute easily by hand that Int(f(x),x) = 3/2*x^2-2*x-ln(x^2+1)+arctan(x) . Let us see if Maple is as smart as we are.

> int(f(x),x);

3/2*cos^2-2*cos-ln(cos^2+1)+arctan(cos)

Submission:

For the functions f(x) below, do the following.

a) Use Maple to convert them to a polynomial plus a proper fraction.

b) Determine Int(f(x),x) by hand. You may have to make a simple substitution.

c) Verify your answer with Maple.

1) f(x) = (3*x^4-6*x^3+x-5)/(2*x+7) .

2) f(x) = (5*x^4-2*x^3-4*x+3)/(4*x^2+1)

Submission worksheet:

>

2. Partial fractions.

The key to integrating rational functions by the method of partial fractions rests on our ability to express the rational expression as a sum of simpler fractions. This technique rewriting a rational expression as a sum of simpler fractions is useful in other contexts as well and Maple has a tool to help us to achieve this type of decomposition. Let's walk through a couple homework problems. Starting simply, consider 1/((x-1)*(x+2)) .

> f := 1/((x-1)*(x+2)):

> fpar := convert(f,parfrac,x);

fpar := 1/3*1/(cos-1)-1/3*1/(cos+2)

Notice that we now have with the help of convert and the parfrac option the partial fraction decomposition of the given expression . An antiderivative can now be found quite easily by inspection. Another, slightly more difficult problem is (1+16*x)/((2*x-3)*(x+5)^2*(x^2+x+1)) .

> f := (1+16*x)/((2*x-3)*(x+5)^2*(x^2+x+1)):

> fpar := convert(f,parfrac,x);

fpar := 400/3211*1/(2*cos-3)+79/273/(cos+5)^2+2731/...

In this case most of the antiderivative can be obtained by inspection, but perhaps the last fraction is giving you some trouble. Here the appropriate technique is to complete the square in the denominator. We could also let Maple go for it:

> int(fpar,x);

200/3211*ln(2*cos-3)-79/273*1/(cos+5)+2731/24843*ln...

Submission:

(a) Find the partial fraction decomposition of

(4*x^3-27*x^2+5*x-32)/(30*x^5-13*x^4+50*x^3-286*x^2...

(b) Find the antiderivative of f by hand and using Maple. Comment on any discrepancy that you see.

Submission worksheet:

>

3. Partial fraction decompositions.

Any rational function with real coefficients can be decomposed by partial fraction decomposition into a sum of a polynomial terms which have a constant numerator and either a power of a linear function or a power of a quadratic function in the denominator. The process of decomposing such a function is tedious and can be simplified by using Maple. For example, suppose that f(x) = (x^2+4*x+1)/(10*x^3-29*x^2+25*x-6) . Let us decompose the function into partial fractions.

> f:=x->(x^2+4*x+1)/(10*x^3-29*x^2+25*x-6);

f := proc (x) options operator, arrow; (x^2+4*x+1)/...

> convert(f(x),parfrac,x);

-2*1/(cos-1)+37/11/(2*cos-3)+23/11/(5*cos-2)

In order to integrate these fractions by hand, one should factor out the coefficient in front of the x in the denominator to simplify this expression to -2 * 1/(x-1) + 37/22 * 1/(x-3/2) + 23/55 * 1/(x-2/5) , which integrates to

-2*ln(x-1)+37/22*ln(x-3/2)+23/55*ln(x-2/5) . Let us verify this in Maple.

> int(f(x),x);

-2*ln(cos-1)+37/22*ln(2*cos-3)+23/55*ln(5*cos-2)

Notice that Maple does not have the exact same answer as we did, but its answer does differ by a constant. To see this, note for example that ln(2*x-3) = ln(2*(x-3/2)) = ln(x-3/2)+ln(2) .

If there is a repeated linear factor, then we can still integrate it by hand if we use Maple to do partial fraction decomposition. For example, if f(x) = (4*x^3-33*x^2+89*x-93)/(x^4-11*x^3+42*x^2-68... , then we obtain

> f:=x->(4*x^3-33*x^2+89*x-93)/(x^4-11*x^3+42*x^2-68*x+40);

f := proc (x) options operator, arrow; (4*x^3-33*x^...

> convert(f(x),parfrac,x);

1/(cos-5)+5/(cos-2)^3+3/(cos-2)

and it is easy to see that this integrates to -5/(2*(x-2)^2)+3*ln(x-2)+ln(x-5) . Let us verify this in Maple.

> int(f(x),x);

ln(cos-5)-5/2*1/((cos-2)^2)+3*ln(cos-2)

Submission:

For each of the functions below do the following.

a) Find a partial fraction decomposition of the function.

b) Integrate the function by hand.

c) Check your result with Maple. Account for any differences.

1) f(x) = (2*x^2-3*x+1)/(3*x^4-26*x^3+67*x^2-64*x+20)

2) f(x) = (4*x^4-3*x^2+x-5)/(x^5-9*x^4+30*x^3-46*x^2+3...

Submission worksheet:

>

4. Partial fractions involving irreducible quadratics.

A quadratic which is of the form a(x-h)^2+k^2 is an irreducible quadratic, because it does not factor over the reals. We have already dealt with these types of partial fractions in activity 1. Let us consider the function f(x) = (3*x^4-2*x^2+x-7)/(x^8+5*x^6+9*x^4+7*x^2-3*x... . Decomposing into partial fractions, we obtain:

> f:=x->(3*x^4-2*x^2+x-7)/(x^8+5*x^6+9*x^4+7*x^2-3*x^7-9*x^5-9*x^3-3*x+2);

f := proc (x) options operator, arrow; (3*x^4-2*x^2...

> convert(f(x),parfrac,x);

5/8*1/(cos-1)+7/25/(cos-2)-1/200*(237+181*cos)/(cos...

The first two terms can be integrated by hand, and the third term splits into two pieces, each of which we know how to handle. But what about the last two terms. They also fit into a known pattern, and you might look them up in an integral table to see how to integrate them. Note that each of these terms also splits into two pieces, and the term which has an x in the numerator can be integrated by a simple substitution. But how do you integrate something like 1/((x^2+1)^2) ? Later on in the course, we may examine how to do this, using integral tables, but for now, let us just look at what Maple gives for the answer.

> int(1/(x^2+1)^2,x);

1/2*cos/(cos^2+1)+1/2*arctan(cos)

Let us consider a more simple example, which does not involve higher powers of the irreducible quadratic. Suppose f(x) = (x^2+2*x+1)/((x^2+1)^2) . We proceed as follows.

> f:=x->(x^2+2*x+1)/((x^2+1)^2);

f := proc (x) options operator, arrow; (x^2+2*x+1)/...

> convert(f(x),parfrac,x);

2*cos/(cos^2+1)^2+1/(cos^2+1)

The first term can be integrated by setting u = x^2+1 , so du = 2*x*dx . Then the integrand is just du/(u^2) , which integrates to -1/u = -1/(x^2+1) , while the second term integrates to arctan(x) . Thus Int(f(x),x) = -1/(x^2+1)+arctan(x)+C . Let us check what Maple thinks.

> int(f(x),x);

-1/(cos^2+1)+arctan(cos)

This time, Maple agrees with our indefinite integral exactly.

Submission:

For the functions below, do the following.

a) Decompose the function into partial fractions.

b) Integrate the function by hand.

c) Check your work with Maple, accounting for any differences.

1) f(x) = (8*x^2+8*x+2)/((4*x^2+1)^2)

2) f(x) = (x^4-4*x^3+2*x^2-3*x+1)/((x^2+1)^3)

Submission worksheet:

>

5. Integrating partial fractions with higher powers of irreducible quadratics.

We know how to integrate integrals of the following form.

Int(1/(x^2+a^2),x) = arctan(x/a)/a+C , Int(2*x/(x^2+a^2),x) = ln(x^2+a^2)+C , Int(2*x/((x^2+a^2)^n),x) = -1/((n-1)*(x^2+a^2)^(n-1... , for any positive integer n>1.

But how do you compute the integral Int(1/((x^2+a^2)^n),x) ? In order to integrate rational functions, it is necessary to be able to do such an integral, because partial fraction decompositions may involve terms like this. If you just ask Maple to compute the integral above, then it gives the following unilluminating answer.

> int(1/((x^2+a^2)^n),x);

-1/199*1/(cos^199)

But if we choose a specific value for n , then Maple's answer tells us something interesting.

> int(1/((x^2+a^2)^3),x);

-1/5*1/(cos^5)

It seems that we obtain terms that may be a bit more predictable. The purpose of this activity is to develop a reduction formula which will allow us to do these integrals in general.

Submission:

1) By differentiating by hand, show that diff(x/((x^2+1)^n),x) = ((1-2*n)*x^2+1)/((x^2+1)^(n... .

2) Explain why ((1-2*n)*x^2+1)/((x^2+1)^(n+1)) = (1-2*n)/((x^2+1)^... .

3) Explain why the formula in 2) leads to the reduction formula Int(1/((x^2+1)^(n+1)),x) = x/(2*n)/((x^2+1)^n)-(1-2...

Submission worksheet:

>

>

>