Artificial Intelligence 🤖
Integration
Integration techniques

Integration techniques

Certain classes of functions can be integrated easily, like for instance, integrating powers of xx involves adding one to the exponent and dividing by the new exponent. Generally, however, integration can be tricky even for very simple functions. Moreover, there is no guarantee that an anti-derivative can be expressed in closed form, i.e. in terms of elementary functions. The integral of xtanxx \tan x is an example of this. In what follows, we look at several techniques that can be used to simplify the integrals.

1. Inspection

Sometimes it is clear enough to see that the integrand is the derivative of a simple function. In such a case, no elaborate technique is necessary.

For example, consider

xex2dx\int x e^{x^{2}} d x

We know that the integral must be proportional to x2x^{2} so it is easy to guess a function whose derivative is the integrand xex2x e^{x^{2}}. By the chain rule, we have

ddxex2=2xex2\frac{d}{d x} e^{x^{2}}=2 x e^{x^{2}}

and so

xex2=12ex2\int x e^{x^{2}}=\frac{1}{2} e^{x^{2}}

Note that this can be solved by substitution which we look at next in this section. Further, consider a function f(x)=g(x)/g(x)f(x)=g^{\prime}(x) / g(x) which can be expressed as a logarithmic derivative,

f(x)=g(x)g(x)=ddxlng(x).f(x)=\frac{g^{\prime}(x)}{g(x)}=\frac{d}{d x} \ln g(x) .

Then, the indefinite integral is given by

f(x)=lng(x)+c.\int f(x)=\ln g(x)+c .

For example,

x1+x2dx=12ln(1+x2)+c\int \frac{x}{1+x^{2}} d x=\frac{1}{2} \ln \left(1+x^{2}\right)+c

since

2x1+x2=g(x)g(x)\frac{2 x}{1+x^{2}}=\frac{g^{\prime}(x)}{g(x)}

with g(x)=1+x2g(x)=1+x^{2}. The factor 1/21 / 2 compensates for the 2 in the numerator.

2. Substitution

This is an application of the chain rule to integration problems. In computing

abf(x)dx\int_{a}^{b} f(x) d x

it is possible to expedite the calculation by writing xx as a function of a new variable uu and then integrating wrt uu. Writing x=g(u)x=g(u), where g(u)g(u) is a differentiable function,

g(c)g(d)f(x)dx=cdf(g(u))g(u)du\int_{g(c)}^{g(d)} f(x) d x=\int_{c}^{d} f(g(u)) g^{\prime}(u) d u

where g(u)=dg/dug^{\prime}(u)=d g / d u. To see this, we use F=fF^{\prime}=f and the Fundamental Theorem of Calculus. We start from the derivative of the composite function F(g(u))F(g(u)) given by,

ddu[F(g(u))]=F(g(u))g(u)=f(g(u))g(u)\frac{d}{d u}[F(g(u))]=F^{\prime}(g(u)) g^{\prime}(u)=f(g(u)) g^{\prime}(u)

Then, using the Fundamental Theorem of Calculus we have,

cdf(g(u))g(u)du=F(g(d))F(g(c)).\int_{c}^{d} f(g(u)) g^{\prime}(u) d u=F(g(d))-F(g(c)) .

We also have again from the Fundamental Theorem of Calculus,

g(c)g(d)f(x)dx=F(g(d))F(g(c)).\int_{g(c)}^{g(d)} f(x) d x=F(g(d))-F(g(c)) .

Since the RHS of two of these eqns are equal, then their LHS are equal which proves the step when we expedited the calculation by writing xx as a function of a new variable uu and then integrating wrt uu.

If gg is a 1 - 1 function then, u=g1(x)u=g^{-1}(x). Let a=g(c)a=g(c) and b=g(d)b=g(d); then c=g1(a)c=g^{-1}(a) and d=g1(b)d=g^{-1}(b). Accordingly, the substitution eqn becomes

abf(x)dx=g1(a)g1(d)f(g(u))g(u)du.\int_{a}^{b} f(x) d x=\int_{g^{-1}(a)}^{g^{-1}(d)} f(g(u)) g^{\prime}(u) d u .

Note that for an indefinite integral we have the result

f(x)dx=f(g(u))g(u)du\int f(x) d x=\int f(g(u)) g^{\prime}(u) d u

where x=g(u)x=g(u). Informally, to compute f(x)dx\int f(x) d x, we write f(x)f(x) as f(x(u))f(x(u)) and dxd x as dx(u)/dud x(u) / d u to arrive at

f(x(u))dx(u)dudu\int f(x(u)) \frac{d x(u)}{d u} d u

which gives a function of uu. Finally, rewrite uu as a function of xx (this step often involves taking inverses). Note that there is no general way to identify the correct substitution as this typically depends on the particular form of the integral.

Substitution Example

If we wanted to Evaluate the following integral:

11+x2dx\int \frac{1}{1+x^{2}} d x

We use the substitution x=tanux=\tan u as this allows us to simplify the denominator by application of the identity 1+tan2usec2u1+\tan ^{2} u \equiv \sec ^{2} u. So, with x=tanux=\tan u \Longrightarrow x2=tan2ux^{2}=\tan ^{2} u and the Eqn becomes

11+tan2u=1sec2u.\int \frac{1}{1+\tan ^{2} u}=\int \frac{1}{\sec ^{2} u} .

Next,

dx=dxdudu=sec2udud x=\frac{d x}{d u} d u=\sec ^{2} u d u

and so substituting in this eqn from before:

f(x(u))dx(u)dudu\int f(x(u)) \frac{d x(u)}{d u} d u

We have:

f(x(u))dx(u)dudu=1sec2usec2udu\int f(x(u)) \frac{d x(u)}{d u} d u=\int \frac{1}{\sec ^{2} u} \sec ^{2} u d u

This simplifies to

1du=u+c\int 1 d u=u+c

where cc is a constant. Finally, going back to the original xx variable, we have

11+x2dx=tan1x+c\int \frac{1}{1+x^{2}} d x=\tan ^{-1} x+c

since u=tan1xu=\tan ^{-1} x.

ℹ️

If f(x)f(x) is a rational function of cosx\cos x and/or sinx\sin x, consider the substitution u=tan(x/2)u=\tan (x / 2) which gives

cosx=1u21+u2,sinx=2u1+u2,dx=2du1+u2.\cos x=\frac{1-u^{2}}{1+u^{2}}, \quad \sin x=\frac{2 u}{1+u^{2}}, \quad d x=\frac{2 d u}{1+u^{2}} .

For example,

1sinxdx=1+u22u21+u2du=lnu+c=lntan(x/2)+c\int \frac{1}{\sin x} d x=\int \frac{1+u^{2}}{2 u} \frac{2}{1+u^{2}} d u=\ln |u|+c=\ln |\tan (x / 2)|+c

3. Integration by parts

Recall the integral:

xex2dx\int x e^{x^{2}} d x

this was easy to compute simply by inspecting that the integrand is the derivative of a simple function. Alternatively, we can use the substitution rule with u=x2,du/dx=2xu=x^{2}, d u / d x=2 x.

Now, consider instead the integral

xexdx\int x e^{x} d x

in this case we cannot find a substitution that we can use to evaluate the integral. To proceed, we use the integration by parts formula. Starting from the product rule formula,

ddx[u(x)v(x)]=u(x)v(x)+u(x)v(x)\frac{d}{d x}[u(x) v(x)]=u^{\prime}(x) v(x)+u(x) v^{\prime}(x)

and integrating both sides, i.e.

ddx[u(x)v(x)]dx=u(x)v(x)+u(x)v(x)dx\int \frac{d}{d x}[u(x) v(x)] d x=\int u^{\prime}(x) v(x)+u(x) v^{\prime}(x) d x

or

u(x)v(x)=u(x)v(x)dx+u(x)v(x)dxu(x) v(x)=\int u^{\prime}(x) v(x) d x+\int u(x) v^{\prime}(x) d x

where we split up the integral on the RHS by Property II in descibed here. Note that the constant of integration is omitted here since it can be absorbed in the constants resulting from the other two integrals. Rearranging gives the integration by parts formula as,

u(x)v(x)dx=u(x)v(x)u(x)v(x)dx.\int u(x) v^{\prime}(x) d x=u(x) v(x)-\int u^{\prime}(x) v(x) d x .

The integration by parts formula is typically remembered as follows,

udv=uvvdu\int u d v=u v-\int v d u

To use this formula, we will need to identify uu and vv and then compute dud u and dvd v. This method of integrating by parts is useful if the integral on the RHS is 'easier' than the integral on the LHS. Let us look at an example:

xsinxdx\int x \sin x d x

Solution We can use integration by parts by choosing u=xu=x and v=sinxv^{\prime}=\sin x. These make up the LHS of The integration by parts formula. For the RHS, we need uu^{\prime} and vv. Differentiating uu wrt xx gives u=1u^{\prime}=1 and integrating vv wrt xx gives v=cosxv=-\cos x (again, the constant of integration can be absorbed to the constant obtained when we perform the integral in the next step). Now, with u,dv,duu, d v, d u, and vv known, plugging in The integration by parts formula, yields

xsinxdx=xcosx1(cosx)dx=xcosx+sinx+c\int x \sin x d x=-x \cos x-\int 1(-\cos x) d x=-x \cos x+\sin x+c

Some integrals can be computed by repeated integration by parts like

x2sinxdx\int x^{2} \sin x d x

Here we choose u=x2u=x^{2} and v=sinxv^{\prime}=\sin x; then u=2xu^{\prime}=2 x and v=cosxv=-\cos x.

x2sinxdx=x2cosx+2xcosxdx\int x^{2} \sin x d x=-x^{2} \cos x+2 \int x \cos x d x

by integrating by parts again (on the coloured term),

xcosxdx=xsinxsinxdx=xsinx+cosx+c.\int x \cos x d x=x \sin x-\int \sin x d x=x \sin x+\cos x+c .

Finally, substituting back in

x2sinxdx=x2cosx+2(xsinx+cosx)+k.\int x^{2} \sin x d x=-x^{2} \cos x+2(x \sin x+\cos x)+k .

Similarly, to compute xnsinx\int x^{n} \sin x, we need to integrate by parts nn times. To compute xnexdx\int x^{n} e^{x} d x, integrate by parts nn times or, alternatively, define In=xnexdxI_{n}=\int x^{n} e^{x} d x and use integration by parts to find a relation between InI_{n} and In1I_{n-1}.

4. Partial fractions

We revisit the function f(x)=g(x)/g(x)f(x)=g^{\prime}(x) / g(x) which can be expressed as a logarithmic derivative:

f(x)=g(x)g(x)=ddxlng(x).f(x)=\frac{g^{\prime}(x)}{g(x)}=\frac{d}{d x} \ln g(x) .

f(x)f(x) is given by a quotient where the numerator is given as the derivative of the denominator or up to a constant multiple. Then, evaluating f(x)dx\int f(x) d x is quite simple. In situations where the numerator is not the derivative of the denominator however, integrating can be tricky. Suppose now that ff is a rational function. That is

f(x)=P(x)Q(x)f(x)=\frac{P(x)}{Q(x)}

where PP is a polynomial of degree mm and QQ is a polynomial of degree n1n \geq 1. To integrate ff, we can perform partial fraction decomposition.

Next, we outline some general rules for partial fraction decomposition assuming that the degree of P(x)P(x) is less than the degree of Q(x)Q(x), i.e. m<nm<n

Examples of partial fraction decomposition:

Rational formPartial fraction form
1.ax+b(xa1)(xa2)\frac{a x+b}{\left(x-a_{1}\right)\left(x-a_{2}\right)}Axa1+Bxa2\frac{A}{x-a_{1}}+\frac{B}{x-a_{2}}
2.ax+b(xa1)2\frac{a x+b}{\left(x-a_{1}\right)^{2}}Axa1+B(xa1)2\frac{A}{x-a_{1}}+\frac{B}{\left(x-a_{1}\right)^{2}}
3.ax2+bx+c(xa1)(xa2)(xa3)\frac{a x^{2}+b x+c}{\left(x-a_{1}\right)\left(x-a_{2}\right)\left(x-a_{3}\right)}Axa1+Bxa2+Cxa3\frac{A}{x-a_{1}}+\frac{B}{x-a_{2}}+\frac{C}{x-a_{3}}
4.ax2+bx+c(xa1)2(xa2)\frac{a x^{2}+b x+c}{\left(x-a_{1}\right)^{2}\left(x-a_{2}\right)}Axa1+B(xa1)2+Cxa2\frac{A}{x-a_{1}}+\frac{B}{\left(x-a_{1}\right)^{2}}+\frac{C}{x-a_{2}}
5.ax2+bx+c(xa1)(x2a2x+a3)\frac{a x^{2}+b x+c}{\left(x-a_{1}\right)\left(x^{2}-a_{2} x+a_{3}\right)}Axa1+Bx+Cx2a2x+a3\frac{A}{x-a_{1}}+\frac{B x+C}{x^{2}-a_{2} x+a_{3}}

Note that in cases 2 and 4 above, the factor can be a repeating factor of any order, not necessarily 2 . For a kk-repeating factor therefore, the partial fraction decomposition is made up of repeating factors with exponents 1k1 \cdots k. Moreover, in case 5, it is assumed that the quadratic factor x2a2x+a3x^{2}-a_{2} x+a_{3} cannot be factorised further. In the table above, A,BA, B, and CC are real numbers to be determined. The cover-up rule is often used to determine the constants.

For example, if we wanted to evaluate the integral:

x(x1)(x2)dx\int \frac{x}{(x-1)(x-2)} d x

The integrand is given by

P(x)Q(x)\frac{P(x)}{Q(x)}

with P(x)=xP(x)=x and Q(x)=(x1)(x2)Q(x)=(x-1)(x-2). We use the second case from the table to carry out the partial fraction decomposition as

x(x1)(x2)=Ax1+Bx2,\frac{x}{(x-1)(x-2)}=\frac{A}{x-1}+\frac{B}{x-2},

where AA and BB are constants to be determined. Using algebra, we have A=1A=-1, B=2B=2. Using the decomposition, the integral is

1x1+2x2dx=lnx1+2lnx2+c.\int \frac{-1}{x-1}+\frac{2}{x-2} d x=-\ln |x-1|+2 \ln |x-2|+c .

5. Complex numbers

Some integrals can be computed using complex numbers to simplify many of the integration formulae. Suppose we want to evaluate

eaxcos(bx)dx\int e^{a x} \cos (b x) d x

We have seen that the integration by parts technique can be used to solve such integrals. A much simpler approach is to use the exponential function and Euler's formula. The integrand eaxcosbxe^{a x} \cos b x is given by the real part of exp[(a+ib)x]\exp [(a+i b) x], denoted by

Re(exp[(a+ib)x])\operatorname{Re}(\exp [(a+i b) x])

and so we have

eaxcos(bx)dx=Re(exp[(a+ib)x])dx=Re(exp[(a+ib)x])dx=Re(1a+ibexp[(a+ib)x])+c\begin{aligned} \int e^{a x} \cos (b x) d x & =\int \operatorname{Re}(\exp [(a+i b) x]) d x \\ & =\operatorname{Re} \int(\exp [(a+i b) x]) d x \\ & =\operatorname{Re}\left(\frac{1}{a+i b} \exp [(a+i b) x]\right)+c \end{aligned}

To simplify, we multiply by (aib)/(aib)(a-i b) /(a-i b),

Re(1a+ibaibaibeax[cos(bx)+isin(bx)])+c,\operatorname{Re}\left(\frac{1}{a+i b} \cdot \frac{a-i b}{a-i b} \cdot e^{a x}[\cos (b x)+i \sin (b x)]\right)+c,

which, upon further simplification evaluates the integral as

eaxcos(bx)dx=aa2+b2eaxcos(bx)+ba2+b2eaxsin(bx)+c.\int e^{a x} \cos (b x) d x=\frac{a}{a^{2}+b^{2}} e^{a x} \cos (b x)+\frac{b}{a^{2}+b^{2}} e^{a x} \sin (b x)+c .