TMV035 Analysis and Linear Algebra B, 2005

LECTURE 3.2

In this lecture we present analytical computation of integrals. This covers AMBS Ch 34.

1. Analytical computation of integrals

1.1. Primitive functions. F (x) is a primitive function of f(x) if F′(x) = f(x). Primitive functions are not unique: F (x) + C is also a primitive function because D(F (x) + C) = f(x). The Fundamental Theorem of Calculus shows how to construct primitive functions and how to compute them numerically (approximatively):

\{ \begin{matrix}u′(x) = f(x), x ∈ [a, b], \\ u(a) = u_{a}, \end{matrix}

with unique solution

u(x) = u_{a} + ∫_{a}^{x} f(y) dy.

This shows that every Lipschitz continuous function has a primitive function and that it is unique up to a constant, which can be determined by an initial condition.

In some books the primitive function is also written as an undetermined integral:

F (x) = ∫ f(x) dx

without integration limits. For example,

∫ x^{2} dx = \frac{x^{3}}{3} + C.

If we can find a primitive function to f (by some intelligent guess-work for example), then we can also compute integrals of f:

∫_{a}^{b} f(x) dx = [F (x)]_{a}^{b} = F (b) − F (a).

Notice that the constant disappears here.

By now we know a lot of functions and their derivatives. Then we also know a lot of primitive functions. For example,

D cos(x) = − sin(x)

Date: November 22, 2005, Stig Larsson, Mathematical Sciences, Chalmers University of Technology.

means that − cos(x) is a primitive function of sin(x). Here is a complete list:

f(x)  F (x)
(1)  x^{r}  \frac{x^{r+1}}{r + 1} (r ≠ −1)
(2)  x^{−1}  log(|x|)
(3)  \frac{h′(x)}{h(x)}  log(|h(x)|)
(4)  e^{x}  e^{x}
(5)  a^{x}  \frac{a^{x}}{log(a)} (a ≠ 1)
(6)  sin(x)  − cos(x)
(7)  cos(x)  sin(x)
(8)  \frac{1}{cos^{2}(x)}  tan(x)
(9)  \frac{1}{sin^{2}(x)}  − cot(x)
(10)  \frac{1}{\sqrt{a^{2} − x^{2}}}  arcsin (\frac{x}{a}) (a > 0)
(11)  \frac{1}{\sqrt{x^{2} + a}}  log(|x + \sqrt{x^{2} + a}|)
(12)  \frac{1}{a^{2} + x^{2}}  \frac{1}{a} arctan (\frac{x}{a})

Prove them by computing F′(x).

By analytical computation of integrals we mean the process of starting from known primitive functions from the list and combining them by means of rules for integration. In this way we can express some primitive functions by means of analytical formulas, i.e., combinations of the listed functions.

This can be done only in simple cases. In fact, most primitive functions cannot be expressed by such analytical formulas. For example,

F (x) = ∫_{0}^{x} e^{−y^{2}} dy

cannot be expressed by any combination of functions in the list. But it is a very useful and important function. Therefore it has been given a name: it is called the “error function”, erf(x) = ∫_{0}^{x} e^{−y^{2}} dy.

The most important techniques are:

• Partial integration

∫_{a}^{b} u′(x)v(x) dx = [u(x)v(x)]_{x=a}^{b} − ∫_{a}^{b} u(x)v′(x) dx.

Proof. (uv)′ = u′v + uv′ □

• Substitution of variable

∫_{a}^{b} f(g(y))g′(y) dy = \{ \begin{matrix}z = g(y) \\ dz = g′(y) dy \end{matrix}\} = ∫_{g(a)}^{g(b)} f(z) dz = [F (z)]_{g(a)}^{g(b)}.

Proof. DF (g(x)) = f(g(x))g′(x). □

• Partial fractions. This will be explained below.

LECTURE 3.2 3

1.2. Integration of rational functions. We want to find primitive functions of rational functions f(x) = \frac{p(x)}{q(x)}, where p and q are polynomials. We begin by considering four basic cases. Case 1.

f(x) = \frac{1}{x}, F (x) = log(|x|), x ≠ 0.

This is (2) in the list. Proof.

F (x) = \begin{cases}log(x), & x > 0 \\ log(−x), & x < 0 \end{cases}

F′(x) = \begin{cases}\frac{1}{x}, & x > 0 \\ \frac{1}{−x}(−1) = \frac{1}{x}, & x < 0 \end{cases}

□

More generally:

f(x) = \frac{1}{x + a}, F (x) = log(|x + a|), x ≠ −a.

The proof is similar. Example.

∫_{0}^{1} \frac{dy}{y − 3} = [ log(|y − 3|)]_{0}^{1} = log(| − 2|) − log(| − 3|) = log(2/3) = − log(3/2)

Example. The following integral is defined only for x < 3, because we cannot integrate past x = 3.

∫_{0}^{x} \frac{dy}{y − 3} = [ log(|y − 3|)]_{0}^{x} = log(|x − 3|) − log(| − 3|) = \{for x < 3\}
= log(3 − x) − log(3) = log (\frac{3 − x}{3}), x < 3.

Case 2.

f(x) = \frac{1}{(x + a)^{p}} , F (x) = \frac{1}{−p + 1} \frac{1}{(x + a)^{p−1}} , x ≠ −a, p = 2, 3, …

Proof. D(x + a)^{−p+1} = (−p + 1)(x + a)^{−p}. So this is (1). □ Example.

∫_{0}^{x} \frac{dy}{(y − 3)^{2}} = [\frac{−1}{y − 3}]_{0}^{x} = \frac{1}{3 − x} − \frac{1}{3}, x < 3.

Case 3.

f(x) = \frac{x}{x^{2} + b^{2}} , F (x) = \frac{1}{2} log(x^{2} + b^{2}), b ≠ 0.

Proof.

F′(x) = \frac{1}{2} \frac{1}{x^{2} + b^{2}} · 2x

Alternatively:

∫_{0}^{x} \frac{y}{y^{2} + b^{2}} dy = \{ \begin{matrix}z = y^{2} + b^{2} \\ dz = 2y dy \end{matrix}\} = \frac{1}{2} ∫_{b^{2}}^{x^{2}+b^{2}} \frac{1}{z} dz = \frac{1}{2}[ log(z)]_{b^{2}}^{x^{2}+b^{2}}
= \frac{1}{2} log(x^{2} + b^{2}) − \frac{1}{2} log(b^{2}) = \frac{1}{2} log(x^{2} + b^{2}) + C
□

More generally:

f(x) = \frac{x + a}{(x + a)^{2} + b^{2}} , F (x) = \frac{1}{2} log((x + a)^{2} + b^{2}), b ≠ 0.

Case 4.

f(x) = \frac{1}{x^{2} + b^{2}} , F (x) = \frac{1}{b} arctan (\frac{x}{b}), b ≠ 0.

This is (12). More generally:

f(x) = \frac{1}{(x + a)^{2} + b^{2}} , F (x) = \frac{1}{b} arctan (\frac{x + a}{b}), b ≠ 0.

1.3. The method of partial fractions. We now demonstrate how more general rational functions can be integrated analytically by decomposition into partial fractions (“partialbråksuppdelning”). All rational functions can be integrated in this way but we only demonstrate the method by some examples.

Example.

f(x) = \frac{x^{2} + x − 2}{x^{3} − 3x^{2} + x − 3}

Note that the degree of the nominator is 2 which less than the degree of the denominator which is 3. The first step is to factorize the denominator by real factors. To do this we seek the roots. By trying several x-values we find that x = 3 is a root. We divide by x = 3:

\frac{x^{3} − 3x^{2} + x − 3}{x − 3} = x^{2} + 1

So the other two roots are complex, x = ±i, and the denominator cannot be further factorized by real factors. We now have

f(x) = \frac{x^{2} + x − 2}{x^{3} − 3x^{2} + x − 3} = \frac{x^{2} + x − 2}{(x^{2} + 1)(x − 3)} = \frac{Ax + B}{x^{2} + 1} + \frac{C}{x − 3}

The last terms are called partial fractions. We determine the coefficients by putting the partial fractions back on a common denominator.

f(x) = \frac{x^{2} + x − 2}{(x^{2} + 1)(x − 3)} = \frac{Ax + B}{x^{2} + 1} + \frac{C}{x − 3} = \frac{(Ax + B)(x − 3) + C(x^{2} + 1)}{(x^{2} + 1)(x − 3)}

We identify the coefficients in the two nominators:

x^{2} :  A + C = 1
x^{1} :  −3A + B = 1
x^{0} :  −3B + C = −2

This is a system of 3 equations for 3 unknowns. The solution is A = 0, B = 1, C = 1 so that

f(x) = \frac{1}{x^{2} + 1} + \frac{1}{x − 3}

A primitive function (Case 4 and Case 1):

F (x) = arctan(x) + log(|x − 3|)

Example.

f(x) = \frac{1}{x^{2} − 4x + 3} = \frac{1}{(x − 1)(x − 3)} = \frac{A}{x − 1} + \frac{B}{x − 3} = \frac{A(x − 3) + B(x − 1)}{(x − 1)(x − 3)}

Identify coefficients in the nominators:

x^{1} :  A + B = 0
x^{0} :  −3A − B = 1

LECTURE 3.2 5

The solution is A = −\frac{1}{2}, B = \frac{1}{2} so that

f(x) = \frac{1}{x^{2} + 2x − 3} = −\frac{1}{2} \frac{1}{x − 1} + \frac{1}{2} \frac{1}{x − 3}
F (x) = −\frac{1}{2} log(|x − 1|) + \frac{1}{2} log(|x − 3|) = \frac{1}{2} log (\frac{|x − 3|}{|x − 1|}) = log (\sqrt{\frac{|x − 3|}{|x − 1|}})

We can also determine the coefficients in a quick and easy way (“handpålägggningsmetoden”):

\frac{1}{(x − 1)(x − 3)} = \frac{A}{x − 1} + \frac{B}{x − 3}

\frac{1}{x − 3} = A + \frac{B(x − 1)}{x − 3}, x = 1 ⟹ A = −\frac{1}{2}

\frac{1}{x − 1} = \frac{A(x − 3)}{x − 1} + B, x = 3 ⟹ B = \frac{1}{2}

Example.

f(x) = \frac{x^{2}}{x^{2} + 2x − 3}

Here the degree of the nominator is not less than the degree of the denominator so we begin by dividing. In this case this can be accomplished easily as follows:

f(x) = \frac{x^{2}}{x^{2} + 2x − 3} = \frac{x^{2} + 2x − 3 − (2x − 3)}{x^{2} + 2x − 3} = 1 + \frac{−2x + 3}{x^{2} + 2x − 3}

Partial fractions:

\frac{−2x + 3}{x^{2} + 2x − 3} = \frac{−2x + 3}{(x − 1)(x + 3)} = \frac{A}{x − 1} + \frac{B}{x + 3} = \frac{A(x + 3) + B(x − 1)}{(x − 1)(x + 3)}

Identify coefficients in the nominators:

x^{1} :  A + B = −2
x^{0} :  3A − B = 3

The solution is A = \frac{1}{4}, B = −\frac{9}{4}. Quick method:

\frac{−2x + 3}{(x − 1)(x + 3)} = \frac{A}{x − 1} + \frac{B}{x + 3}

\frac{−2x + 3}{x + 3} = A + \frac{B(x − 1)}{x + 3}, x = 1 ⟹ A = \frac{1}{4}

\frac{−2x + 3}{x − 1} = \frac{A(x + 3)}{x − 1} + B, x = −3 ⟹ B = −\frac{9}{4}

so that

f(x) = \frac{x^{2}}{x^{2} + 2x − 3} = 1 + \frac{1}{4} \frac{1}{x − 1} − \frac{9}{4} \frac{1}{x + 3}
F (x) = x + \frac{1}{4} log(|x − 1|) − \frac{9}{4} log(|x + 3|)

Example. If a factor is repeated in the denominator then we must repeat it in the partial fractions:

f(x) = \frac{1}{(x^{2} + 1)(x − 3)^{2}} = \frac{Ax + B}{x^{2} + 1} + \frac{C}{x − 3} + \frac{D}{(x − 3)^{2}}

= \frac{(Ax + B)(x − 3)^{2} + C(x^{2} + 1)(x − 3) + D(x^{2} + 1)}{(x^{2} + 1)(x − 3)^{2}}

= \frac{(Ax + B)(x^{2} − 6x + 9) + C(x^{2} + 1)(x − 3) + D(x^{2} + 1)}{(x^{2} + 1)(x − 3)^{2}}

We identify the coefficients in the two nominators:

x^{3} :  A + C = 0
x^{2} :  −6A + B − 3C + D = 0
x^{1} :  9A − 6B + C = 0
x^{0} :  9B − 3C + D = 1

This system is too large to be solved by hand so I use Matlab:

>> A=[1 0 1 0; -6 1 -3 1; 9 -6 1 0; 0 9 -3 1]
>> b=[0;0;0;1]
>> c=A\b

The result is c=[0.06; 0.08; -0.06; 0.1], i.e., A = \frac{6}{100}, B = \frac{8}{100}, C = −\frac{6}{100}, D = \frac{10}{100}, so that

f(x) = \frac{6}{100} \frac{x}{x^{2} + 1} + \frac{8}{100} \frac{1}{x^{2} + 1} − \frac{6}{100} \frac{1}{x − 3} + \frac{1}{10} \frac{1}{(x − 3)^{2}}
F (x) = \frac{3}{100} log(x^{2} + 1) + \frac{8}{100} arctan(x) − \frac{6}{100} log(|x − 3|) − \frac{1}{10} \frac{1}{x − 3}

This is Case 2, Case 4, Case 1, and Case 3.

Example.

f(x) = \frac{1}{x^{2} + 4x + 13}

The roots of the denominator are complex: −2 ± 3i, so it cannot be factorized with real factors. Instead we complete the square so that we can use Case 4:

f(x) = \frac{1}{x^{2} + 4x + 13} = \frac{1}{(x + 2)^{2} − 4 + 13} = \frac{1}{(x + 2)^{2} + 9}
F (x) = \frac{1}{3} arctan (\frac{x + 2}{3})

Example. Find a primitive function to the function:

f(x) = \frac{1}{x^{3} − 2x^{2} + 2x}

Solution:

f(x) = \frac{1}{x^{3} − 2x^{2} + 2x} = \frac{1}{(x^{2} − 2x + 2)x} = \frac{Ax + B}{(x − 1)^{2} + 1} + \frac{C}{x}

= \frac{−\frac{1}{2}x + 1}{(x − 1)^{2} + 1} + \frac{\frac{1}{2}}{x} = \frac{−\frac{1}{2}(x − 1) − \frac{1}{2} + 1}{(x − 1)^{2} + 1} + \frac{\frac{1}{2}}{x}

= −\frac{1}{2} \frac{x − 1}{(x − 1)^{2} + 1} + \frac{1}{2} \frac{1}{(x − 1)^{2} + 1} + \frac{1}{2} \frac{1}{x}

F (x) = −\frac{1}{4} log((x − 1)^{2} + 1) + \frac{1}{2} arctan(x − 1) + \frac{1}{2} log(|x|)

/stig