Page 1 of 1

## A Calculus Primer Part V- Techniques for Integration

### #1 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 12680
• Posts: 45,861
• Joined: 27-December 08

Posted 03 May 2011 - 05:44 PM

This tutorial will cover techniques and strategies for integrating more complex functions than going backwards from our derivative rules. The techniques covered in this tutorial include u substitution, trig substitution, partial fractions and integration by parts.

General Strategy for Integration
Integrals by nature can be significantly harder and uglier to compute than derivatives. So when evaluating integrals, the goal is to first simplify the function. Are there like terms? If so, combine them first. Finally, is it possible to use an integral identity covered in my last tutorial? If so, use one of those identities. If not, then either u substitution, trig substitution, integration by partial fractions, or integration by parts will have to be used.

U Substitution
As programmers, the concept of using variables to store values (objects, numbers, strings, arrays, and maybe even functions) should be very familiar. This is the entire concept of u substitution. The strategy here is to isolate a single term (or group of terms) whose derivative is also in the function. Then we set u = sub function, and du equal to its derivative. If du has a coefficient differing from the coefficient of the term(s) in the function, it is necessary to multiply the new integral by the reciprocal of that term. Next, the limits of integration on the original integral are run through the u function and adjusted. So given Integral(a, b, f(x)dx), the u substitution would be Integral(u(a), u(b), u du). If an indefinite integral is being evaluated, then it is necessary to convert back to the original function, rather than leaving it in terms of u.

Let's work through some examples to try it out:

1) Integral(0, pi/2, sin(x)cos(x) dx)

In this integral, there are three terms: sin(x), cos(x), and dx. Thinking back to the derivative identities, remember that the derivative of sin(x) is cos(x)dx (remember chain rule- differentiate the inside function x too). So u = sin(x), and du = cos(x)dx. Finally, we have to adjust our limits of integration. So u(0) = 0, and u(pi/2) = 1. Finally, let's evaluate our new integral: Integral(0, 1, u du). This is a much simpler integral to evaluate, as it is now possible to use the power rule. So the answer is 1/2 * u^2 | (x = 0, 1). Or more simply, just 1/2.

2) Integral(-pi/4, pi/4, tan(x) dx)

This is a u substitution problem in disguise. Not many people know the integral of tan(x) immediately. However, understanding that tan(x) = sin(x)/cos(x) makes things much easier. So let's examine our terms: sin(x), (cos(x))-1 (1/cos(x), not arccos(x)), and dx. The trap to avoid here is setting u = sin(x) because cos(x) is in the denominator. Instead, set u = cos(x), and du = -sin(x)dx. However, since sin(x) is a positive term in the original function, it is necessary to multiple the integral by -1 to get the correct answer. Now I can evaluate -1 * Integrate(-sqrt(2)/2, sqrt(2)/2, 1/u du) to get ln|u| |(x = -sqrt(2)/2, sqrt(2)/2). So using the rules of logs, that comes out to ln|sqrt(2)| - ln|2| - ln|sqrt(2)| + ln|2|, or more simply 0.

3) Integral(e^3x dx)

This is a problem where recognizing the chain rule can be used instead of u-substitution. However, let's work through it with u substitution anyways, setting u = 3x and du = dx/3. So simply 1/3 * Integral(e^u du), which comes out to 1/3 * e^3x + c. Notice how the answer is in terms of x instead of u since an indefinite integral is being evaluated.

Trig Substitution
Integration by trig substitution is a technique when a function is composed of trig functions. The purpose of trig substitution is to apply the trig identities where possible in order to simplify the function being integrated to the point where the other integral identities or techniques can be used. Let's look at a couple examples to see how this can help:

1) Integral(sin(x)cos(x)dx)

This was one of the examples for u-substitution. By simply recognizing that sin(2x) = 2sin(x)cos(x), the problem can be re-written as 1/2 * Integral(sin(2x) dx). Using the integral identity that Integral(sin(x)dx) = -cos(x) + c, and accounting for the chain rule, the answer comes out to be -1/4 * cos(2x) + c.

2) Integral((sin^4(x) + sin^2(x)cos^2(x))dx)

At first glance, this integral doesn't look easy to integrate. Let's factor out sin^2(x) from both terms though. The result is sin^2(x)(sin^2(x) + cos^2(x)), which can be simplified using a Pythagorean identity, leaving simply sin^2(x). Sin(x) can't be integrated using the power rule, due to inconsistencies where F'(x) != f(x). So instead, another trig identity is used- a power reduction formula. So sin^2(x) = (1-cos(2x))/2. That is a lot easier to integrate term-by-term. So the final integral being evaluated is 1/2 * Integral((1-cos(2x)dx), which results in 1/2 * (x- sin(2x)/2) + c.

For a more complete list of trig identities, check out this link. Not all of these identities are helpful when simplifying integrals, but many of them are. Certain identities, like the sum-difference formulas, won't be helpful until we cover integration by parts.

Partial Fractions
Partial fractions are used to break down rational functions that cannot be more easily simplified and solved using another integration technique. The idea behind partial fractions is that the denominator can be rationally factored into terms that are added together. The process of combining those terms provides a system of equations that are equal to the various terms in the numerator. The variables from this system of equations are the coefficients when integrating.

Let's look at an example:

Integral((x-1)/(x^2+x) * dx)

Let's start by factoring the denominator: x(x+1). Next, we will break the rational function into partial fractions: A/x + B/(x+1) = (x-1)/(x(x+1)). Next, let's combine the partial fractions so we can set up a system of equations:
[A(x+1) + B(x)]/(x^2+x) = (x-1)/(x^2+x)

Distributing A and B, we get the following system of equations:
x(A+b) = x
A = -1

Solving this, A = -1 and B = 2.

And since the partial fractions are equivelant to the orignal function, we can integrate those, which are a lot easier. So:
Integral((x-1)/(x^2+x) * dx) = -Integral(1/x * dx) + 2 * Integral(1/(x+1) * dx)
= -ln|x| + 2ln|x+1| + c

This was much easier than integrating the original rational function.

Integration By Parts
Integration by parts is used to integrate products that the other techniques don't handle well. It can also produce inconclusive answers. As such, it is the last-resort technique for integration. It is also the inverse of the product rule for derivatives. As such, let's examine its derivation:
d(uv) = udv + vdu
Integral(d(uv)) = uv = Integral(udv) + Integral(vdu)

Doing some simple algebra, we get:
Integral(udv) = uv - Integral(vdu)

When using integration by parts, the strategy is to take the function be integrated, and break its terms down into u and dv. The u term should be easily differentiated, and the dv term should get simpler when integrated. After finding the u, du, dv, and v terms, plug them into the formula.

Let's look at some examples:

1) Integral(xe^x dx)
```u = x       dv = e^x * dx
du = dx     v = e^x

```

Integral(udv) = x*e^x - Integral(e^xdx)
= x*e^x - e^x + c

Looking at this integral initially, there is no set of terms whose derivative is present, so u substitution is not feasible. There is no denominator, so partial fractions is out; and there is no trig function for trig substitution. Nor is there even an integral identity. So we are stuck with integration by parts. When examining the terms x, e^x, and dx, x is the obvious term for u because it gets simpler when differentiated, moreso than integrating it to get x^2/2. The e^x function is just as simple either way, so it is the dv term. After differentiating u and integrating dv, it becomes as simple as plugging into the formula.

2) Integrate(0, infinity, e^-t * t^(n-1) * dt)

This is one of those functions that causes problems with integration by parts. That is, it doesn't produce a clean, definitive answer the first time around. Let's evaluate it and see what happens:

u = t^(n-1)
du = (n-1) * t^(n-2) * dt
dv = e^-t * dt
v = -e^-t

Integral(0, infinity, udv) = -t^(n-1)/e^t |(x = 0, infinity) + Integral(0, infinity, e^-t * (n-1) * t^(n-2) dt)

When evaluating the uv term, it is practically negligible, since at t = 0, -0^(n-1) = 0; and at x = infinity, e^infinity grows faster than -infinity^(n-1), causing a net of 0.

Since (n-1) is a constant, it can be pulled out front, leaving:
Integral(0, infinity, udv) = (n-1) Integral(0, infinity, e^-t * t^(n-2) * dt)

As we continue to decompose this function using integration by parts, we will finally get Integral(0, infinity, e^-t * dt) as the base case, which evaluates to 1. Looking at a similar function, the factorial, notice how this integral is very similar to the factorial. In fact, this is the gamma function, which allows factorials to be evaluated for continuous values, rather than simply the integers. This also allows us to deal with the binomial theorem, a lot of combinatorics, and other fields in discrete mathematics continuously. Looking back at my earlier tutorial where we discuss continuity, remember that continuity is defined as a lot of discrete points very close together.

A lot of that math is certainly beyond the scope of this tutorial. However, the gamma function is a good introduction to seeing where problems occur with integration by parts, as well as pulling into other areas of mathematics.

Conclusion
This tutorial has covered the major integration techniques prior to multivariate calculus. My next tutorial will cover applications of integrals.

Is This A Good Question/Topic? 0

## Replies To: A Calculus Primer Part V- Techniques for Integration

### #2 sakshamkum

Reputation: 19
• Posts: 232
• Joined: 09-June 09

Posted 09 May 2011 - 10:16 AM

the gamma function is somewhat like Integration by Iteration

This post has been edited by sakshamkum: 09 May 2011 - 10:19 AM