Converting the TeX source when the DOM is ready

This page contains some inline TeX expressions like <span class="tex">\int_{a}^b f(x) d x = F(b) - F(a)</span> (inline mode) or <div class="tex">\int_0^{\pi} 2 \cos(\theta) - 3 \sin(\theta) d\theta = \left[ 2 \sin(\theta) + 3 \cos(\theta) \right]_{\theta=0}^\pi = -6</div> (display mode) that are converted into MathML by TeXZilla when the DOM is ready.

Copyright

    Copyright (C) 2013 Frédéric Wang

    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.3
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU
    Free Documentation License".

Basic Integration

Ideas

If FF is a primitive of ff then abf(x)dx=F(b)F(a)\int_{a}^b f(x) d x = F(b) - F(a), provided the integrand and integral have no singularities on the path of integration. As a consequence, we can use a table of derivatives:

FunctionDerivative
Linearity af+bga f + b g af+bga f' + b g'
Leibniz rule fgf g fg+gff' g + g f'
Reciprocal rule 1f\frac{1}{f} ff2-\frac{f'}{f^2}
Chain Rule fgf \circ g (fg)g(f' \circ g) g'
Inverse function rule f1f^{-1} 1ff1\frac{1}{f' \circ f^{-1}}
Elementary power rule xnx^n nxn1n x^{n-1}
Generalized power rule fg=egln(f)f^g = e^{g \ln(f)} fg(fgf+gln(f))f^g \left( f' \frac{g}{f} + g' \ln(f) \right)
Exponential expx\exp x expx\exp x
Logarithm lnx\ln x 1x\frac{1}{x}
Sine sinx\sin x cosx\cos x
Cosine cosx\cos x sinx-\sin x
Tangent tanx\tan x 1cos2x=1+tan2x\frac{1}{\cos^2 x} = 1+\tan^2 x

Examples

Using linearity and elementary power rule:

01u42u3+5u2+4du=[u552u44+5u33+4u]u=01=16130 \int_0^{1} u^4 - 2u^3 + 5u^2 + 4 du = \left[ \frac{u^5}{5} - 2 \frac{u^4}{4} + 5 \frac{u^3}{3} + 4u \right]_{u=0}^1 = \frac{161}{30}

Using linearity and sine/cosine:

0π2cos(θ)3sin(θ)dθ=[2sin(θ)+3cos(θ)]θ=0π=6\int_0^{\pi} 2 \cos(\theta) - 3 \sin(\theta) d\theta = \left[ 2 \sin(\theta) + 3 \cos(\theta) \right]_{\theta=0}^\pi = -6

Using Leibniz rule, Chain rule and Exponential/Power:

022xe3x3x2e3xdx=[x2e3x]02=4e12 \int_{0}^{2} 2x e^{-3x} - 3 x^2 e^{-3x} d x = \left[ x^2 e^{-3x} \right]_0^2 = \frac{4}{e^{12}}

Using the inverse function rule and tangent:

0111+x2dx=011tan(arctan(x))dx=[arctan(x)]01=π4 \int_{0}^{1} \frac{1}{1 + x^2} d x = \int_{0}^{1} \frac{1}{\tan'(\arctan(x))} d x = \left[ \arctan(x) \right]_0^1 = \frac{\pi}{4}

Using linearity, reciprocal rule and logarithm:

231v(ln(v))2dv=231v(ln(v))2dv=[1ln(v)]23=1ln21ln3 \int_{2}^{3} \frac{1}{v (\ln(v))^2} d v = - \int_{2}^{3} - \frac{\frac{1}{v}}{(\ln(v))^2} d v = - \left[ \frac{1}{\ln(v)} \right]_2^3 = \frac{1}{\ln 2} - \frac{1}{\ln 3}

Using the power rules and chain rule:

013t2(t3+1)5dt=1401(t3+1)4(3t24t3+1+0)dt=14[(t3+1)4]01=1564 \int_{0}^1 \frac{3t^2}{(t^3+1)^5} d t = -\frac{1}{4} \int_0^1 (t^3+1)^{-4} \left( 3t^2 \frac{-4}{t^3+1} + 0 \right) d t = -\frac{1}{4} \left[ (t^3+1)^{-4} \right]_0^1 = \frac{15}{64}

Integration by Substitution

Idea

Do a substitution x=g(y)x = g(y) to simplify an integral. We have dxdy=g(y)\frac{dx}{dy} = g'(y) and f(x)dx=f(g(y))g(y)dy\int f(x) dx = \int f(g(y)) g'(y) dy: this is the chain rule!

Example 1

01x(x21)dx \int_{0}^1 x (x^2 - 1) dx

Let y=x21y = x^2 - 1, dy=2xdxdy = 2 x dx then we get

12y=10ydy=[y24]y=10=14 \frac{1}{2} \int_{y=-1}^0 y dy = \left[\frac{y^2}{4}\right]_{y=-1}^0 = -\frac{1}{4}

We find the same result as

01x3xdx=[x44x22]x=01=1412=14 \int_{0}^1 x^3 - x dx = \left[ \frac{x^4}{4} - \frac{x^2}{2} \right]_{x=0}^1 = \frac{1}{4} - \frac{1}{2} = -\frac{1}{4}

Example 2

Consider

236x2cos(x32)dx \int_2^3 6x^2 \cos(x^3 - 2) d x

Let y=x32y = x^3 - 2, dy=3x2dxdy = 3x^2 dx so

236x2cos(x32)dx=2y=625cos(y)dy=2[sin(y)]y=625=2sin(25)2sin(6) \int_{2}^{3} 6 x^2 \cos(x^3 - 2) d x = 2 \int_{y=6}^{25} \cos(y) d y = 2 [\sin(y)]_{y=6}^{25} = 2 \sin(25) - 2 \sin(6)

Example 3

Consider

v=12dvv3e1v2 \int_{v=1}^2 \frac{dv}{v^3 e^{\frac{1}{v^2}}}

Let u=1v2u = -\frac{1}{v^2}, du=2v3dvdu = \frac{2}{v^3} dv:

v=12dvv3e1v2=12u=114eudu=12(1e41e) \int_{v=1}^2 \frac{dv}{v^3 e^{\frac{1}{v^2}}} = \frac{1}{2} \int_{u=-1}^{-\frac{1}{4}} e^{u} du = \frac{1}{2} \left(\frac{1}{\sqrt[4]{e}} - \frac{1}{e}\right)

Example 4

Consider

215t4t2dt \int_{-\sqrt{2}}^{-1} \frac{5t}{\sqrt{4 - t^2}} d t

Let t=2sinθt = 2 \sin \theta and so dt=2cosθdθdt = 2 \cos \theta d \theta. We have

3π47π610sinθ44sin2θ2cosθdθ=103π47π6sinθcosθcos2θdθ \int_{\frac{3\pi}{4}}^{\frac{7\pi}{6}} \frac{10 \sin \theta}{\sqrt{4 - 4\sin^2 {\theta}}} 2 \cos \theta d \theta = 10 \int_\frac{3\pi}{4}^{\frac{7\pi}{6}} \sin \theta \frac{\cos \theta}{\sqrt{\cos^2 \theta}} d \theta

We have 1<cosθ<0-1 < \cos \theta < 0 on [3π4,7π6]\left[\frac{3\pi}{4},\frac{7\pi}{6}\right] and so

215t4t2dt=103π47π6sinθdθ=10[cosθ]3π47π6=5(23) \int_{-\sqrt{2}}^{-1} \frac{5t}{\sqrt{4 - t^2}} d t = -10 \int_\frac{3\pi}{4}^{\frac{7\pi}{6}} \sin \theta d \theta = 10 \left[\cos \theta\right]_\frac{3\pi}{4}^{\frac{7\pi}{6}} = 5 (\sqrt{2} - \sqrt{3})

Example 5

Consider

32+dx2x26x+7 \int_{\frac{3}{2}}^{+\infty} \frac{dx}{2x^2 - 6x + 7}

We first write

2x26x+7=2(x23x+72)=2((x32)2+54)=52((x3254)2+1)2x^2 - 6x + 7 = 2\left(x^2 - 3x + \frac{7}{2}\right) = 2\left( \left(x - \frac{3}{2}\right)^2 + \frac{5}{4} \right) = \frac{5}{2} \left( \left(\frac{x - \frac{3}{2}}{\sqrt{\frac{5}{4}}}\right)^2 + 1 \right)

Now doing the substitution y=x3254y = \frac{x - \frac{3}{2}}{\sqrt{\frac{5}{4}}}, dy=dx54dy = \frac{dx}{\sqrt{\frac{5}{4}}} we get

0+54dy52(y2+1)=150+dyy2+1 \int_0^{+\infty} \frac{\sqrt{\frac{5}{4}} dy}{\frac{5}{2}(y^2+1)} = \frac{1}{\sqrt{5}} \int_0^{+\infty} \frac{dy}{y^2+1}

But we have already met this integral in the basic methods:

32+dx2x26x+7=15[arctany]y=0=π25 \int_{\frac{3}{2}}^{+\infty} \frac{dx}{2x^2 - 6x + 7} = \frac{1}{\sqrt{5}} [\arctan y]_{y=0}^{\infty} = \frac{\pi}{2 \sqrt{5}}

Example 6

Consider

π6π3tan(θ2)(1+cosθ)2sin3θdθ \int_{\frac{\pi}{6}}^{\frac{\pi}{3}} \tan\left(\frac{\theta}{2}\right) \frac{{(1 + \cos \theta)}^2}{\sin^3 \theta} d \theta

We do the substitution t=tan(θ2)t = \tan\left(\frac{\theta}{2}\right). We have dθ=2dt1+t2d \theta = \frac{2 dt}{1+t^2}, cosθ=1t21+t2\cos \theta = \frac{1-t^2}{1+t^2} and sinθ=2t1+t2\sin \theta = \frac{2t}{1+t^2}. Also, we have

tan(π12)=1cos(π6)1sin(π6)=23\tan\left(\frac{\pi}{12}\right) = \frac{1-\cos\left(\frac{\pi}{6}\right)}{1-\sin\left(\frac{\pi}{6}\right)} = 2 - \sqrt{3}

and so

2313t(21+t2)2(2t1+t2)32dt1+t2=23131t2dt=[1t]2313=1233 \int_{2 - \sqrt{3}}^{\frac{1}{\sqrt{3}}} t \frac{\left(\frac{2}{1+t^2}\right)^2}{\left( \frac{2t}{1+t^2}\right)^3} \frac{2 dt}{1+t^2} = \int_{2 - \sqrt{3}}^{\frac{1}{\sqrt{3}}} \frac{1}{t^2} dt = \left[ -\frac{1}{t} \right]_{2 - \sqrt{3}}^{\frac{1}{\sqrt{3}}} = \frac{1}{2-\sqrt{3}}-\sqrt{3}

and finally

π6π3tan(θ2)(1+cosθ)2sin3θdθ=2 \int_{\frac{\pi}{6}}^{\frac{\pi}{3}} \tan\left(\frac{\theta}{2}\right) \frac{{(1 + \cos \theta)}^2}{\sin^3 \theta} d \theta = 2

Integration by parts

Idea

Given a two function f,gf, g we have

fg=fgfg \int f g' = f g - \int f' g

this is Leibniz rule!

Example 1

Consider

0+(x2+x+1)e3xdx \int_{0}^{+\infty} (x^2 + x + 1) e^{-3x} d x

We consider f(x)=x2+x+1f(x) = x^2 + x + 1 and g(x)=e3x3g(x) = \frac{e^{-3x}}{-3} that is f(x)=2x+1f'(x) = 2x+1 and g(x)=e3xg'(x) = e^{-3x}. The integral can be written fgdx\int f g' dx and hence we get

[(x2+x+1)e3x3]0+0+(2x+1)e3x3dx=13+130+(2x+1)e3xdx \left[(x^2 + x + 1) \frac{e^{-3x}}{-3}\right]_{0}^{+\infty} - \int_{0}^{+\infty} (2x+1) \frac{e^{-3x}}{-3} d x = \frac{1}{3} + \frac{1}{3} \int_{0}^{+\infty} (2x+1) e^{-3x} d x

We now consider h(x)=2x+1,h(x)=2h(x) = 2x+1, h'(x)=2 the second integral can be written hgdx\int h g' dx and hence

0+(2x+1)e3xdx=[(2x+1)e3x3]0+0+2e3x3dx=13+230+e3xdx \int_{0}^{+\infty} (2x+1) e^{-3x} d x = \left[(2x + 1) \frac{e^{-3x}}{-3}\right]_{0}^{+\infty} - \int_{0}^{+\infty} 2 \frac{e^{-3x}}{-3} d x = \frac{1}{3} + \frac{2}{3} \int_{0}^{+\infty} e^{-3x} d x

We now recognize gg' in the last integral and so

0+e3xdx=[e3x3]0+=13 \int_{0}^{+\infty} e^{-3x} d x = \left[ \frac{e^{-3x}}{-3}\right]_{0}^{+\infty} = \frac{1}{3}

Finally,

0+(x2+x+1)e3xdx=13+13×(13+23×13)=1427 \int_{0}^{+\infty} (x^2 + x + 1) e^{-3x} d x = \frac{1}{3} + \frac{1}{3} \times \left( \frac{1}{3} + \frac{2}{3} \times \frac{1}{3} \right) = \frac{14}{27}

Example 2

12x3(2lnx+7arctanx)dx \int_1^2 x^3 (2\ln x + 7\arctan x) d x

We let f(x)=2lnx+7arctanxf(x) = 2\ln x + 7\arctan x and g(x)=x33g(x) = \frac{x^3}{3}. Hence f(x)=2x+71+x2f'(x) = \frac{2}{x} + \frac{7}{1+x^2} and g(x)=x3g'(x) = x^3. The integration by parts gives:

[x33(2lnx+7arctanx)]1212x33(2x+71+x2)dx \left[\frac{x^3}{3} \left(2\ln x + 7\arctan x\right) \right]_1^2 - \int_1^2 \frac{x^3}{3} \left(\frac{2}{x} + \frac{7}{1+x^2}\right) d x

The integral can be written

1223x2+73x(x2+1)xx2+1dx=2223x2+73x762xx2+1dx \int_1^2 \frac{2}{3} x^2 + \frac{7}{3} \frac{x(x^2+1) - x}{x^2+1} dx = \int_2^2 \frac{2}{3} x^2 + \frac{7}{3} x - \frac{7}{6} \frac{2x}{x^2+1} dx

Finally

12x3(2lnx+7arctanx)dx=[x33(2lnx+7arctanx)29x376x2+76ln(x2+1)]12=289ln(5)+8918ln(2)+563arctan(2)7π1230118 \int_1^2 x^3 (2\ln x + 7\arctan x) d x = \left[\frac{x^3}{3} \left(2\ln x + 7\arctan x\right) - \frac{2}{9} x^3 -\frac{7}{6} x^2 + \frac{7}{6} \ln (x^2 + 1) \right]_1^2 = \frac{28}{9} \ln(5) + \frac{89}{18} \ln(2) + \frac{56}{3} \arctan(2) - \frac{7 \pi}{12} - \frac{301}{18}

Example 3

Consider

I=0π2sin(3θ)e2θdθ I =\int_{0}^{\frac{\pi}{2}} \sin(3 \theta) e^{2 \theta} d \theta

We do an integration by parts with f(θ)=sin(3θ)f(\theta) = \sin(3 \theta) and g(θ)=e2θg'(\theta) = e^{2 \theta}:

I=[sin(3θ)e2θ2]0π2320π2cos(3θ)e2θdθ I = \left[\sin(3 \theta) \frac{e^{2 \theta}}{2}\right]_{0}^{\frac{\pi}{2}} - \frac{3}{2} \int_{0}^{\frac{\pi}{2}} \cos(3 \theta) e^{2 \theta} d \theta

We repeat a similar integration by parts on the remaining integral:

0π2cos(3θ)e2θdθ=[cos(3θ)e2θ2]0π2+320π2sin(3θ)e2θdθ\int_{0}^{\frac{\pi}{2}} \cos(3 \theta) e^{2 \theta} d \theta = \left[\cos(3 \theta) \frac{e^{2 \theta}}{2}\right]_{0}^{\frac{\pi}{2}} + \frac{3}{2} \int_{0}^{\frac{\pi}{2}} \sin(3 \theta) e^{2 \theta} d \theta

We note that we found the initial integral II. We get:

I=[sin(3θ)e2θ234cos(3θ)e2θ]0π294I I = \left[\sin(3 \theta) \frac{e^{2 \theta}}{2} -\frac{3}{4} \cos(3 \theta) e^{2 \theta} \right]_{0}^{\frac{\pi}{2}} - \frac{9}{4} I

Finally,

I=0π2sin(3θ)e2θdθ=413[(12sin(3θ)34cos(3θ))e2θ]0π2=32eπ13 I =\int_{0}^{\frac{\pi}{2}} \sin(3 \theta) e^{2 \theta} d \theta = \frac{4}{13} \left[\left(\frac{1}{2} \sin(3 \theta) -\frac{3}{4} \cos(3 \theta)\right) e^{2 \theta} \right]_{0}^{\frac{\pi}{2}} = \frac{3 - 2 e^\pi}{13}

Integration by Partial Fraction Decomposition

Idea

Given a rational function PQ\frac{P}{Q}, write its partial fraction decomposition and integrate each term.

Example 1

x=232x46x3+41x244x+126x518x4+18x36x2dx \int_{x=2}^{3} \frac{2x^4-6x^3+41x^2-44x+12}{6x^5-18x^4+18x^3-6x^2} d x

Clearly, we have 6x518x4+18x36x2=6x2(x33x2+3x1)6x^5-18x^4+18x^3-6x^2 = 6 x^2 (x^3-3x^2+3x-1) and 11 is a trivial root of the second factor so we can factor it by (x1)(x-1) and obtain:

6x518x4+18x36x2=6x2(x1)(x22x+1)=6x2(x1)36x^5-18x^4+18x^3-6x^2 = 6 x^2 (x-1) (x^2-2x+1) = 6x^2 (x-1)^3

Hence we search a decomposition of

F(x)=2x46x3+41x244x+126x2(x33x2+3x1)=Ax+Bx2+Cx1+D(x1)2+E(x1)3 F(x) = \frac{2x^4-6x^3+41x^2-44x+12}{6 x^2 (x^3-3x^2+3x-1)} = \frac{A}{x} + \frac{B}{x^2} + \frac{C}{x-1} + \frac{D}{(x-1)^2} + \frac{E}{(x-1)^3}

for some constants A,B,C,D,EA, B, C, D, E \in \mathbb{R}. We have

limx1(x1)3F(x)=E=26+4144+126=56 \lim_{x \rightarrow 1} (x - 1)^3 F(x) = E = \frac{2 - 6 + 41 - 44 + 12}{6} = \frac{5}{6} limx0x2F(x)=B=126=2 \lim_{x \rightarrow 0} x^2 F(x) = B = \frac{12}{-6} = -2 limx0(x2F(x))=A=44×112×36=43 \lim_{x \rightarrow 0} (x^2 F(x))' = A = \frac{-44 \times -1 - 12 \times 3}{6} = \frac{4}{3} limx+xF(x)=A+C=26C=2643=1 \lim_{x \rightarrow +\infty} x F(x) = A + C = \frac{2}{6} \rightarrow C = \frac{2}{6} - \frac{4}{3} = -1 F(2)=A2+B4+C+D+E=2×166×8+41×444×2+126×4=3D=323+12+156=3 F(2) = \frac{A}{2} + \frac{B}{4} + C + D + E = \frac{2\times16 - 6\times8+41\times4-44\times2+12}{6 \times 4} = 3 \rightarrow D = 3 - \frac{2}{3} + \frac{1}{2} + 1 - \frac{5}{6} = 3

Finally,

x=23F(x)dx=[43ln|x|+2xln|x1|3x15121(x1)2]x=23=43ln(3)73ln(2)+7148 \int_{x=2}^{3} F(x) d x = \left[ \frac{4}{3} \ln |x| + \frac{2}{x} - \ln |x - 1| - \frac{3}{x-1} - \frac{5}{12} \frac{1}{(x-1)^2} \right]_{x=2}^3 = \frac{4}{3} \ln(3) - \frac{7}{3} \ln(2) + \frac{71}{48}

Example 2

u=152u45u3+24u226u+50u54u4+14u320u2+25udu \int_{u=1}^{5} \frac{2u^4-5u^3+24u^2-26u+50}{u^5-4u^4+14u^3-20u^2+25u} d u

The denominator can be written u54u4+14u320u2+25u=u(u44u3+14u220u+25)u^5-4u^4+14u^3-20u^2+25u = u(u^4-4u^3+14u^2-20u+25). Evaluating the second factor at 0,±1,±20, \pm1, \pm2 we don't find any trivial roots. Hence we try to convert it to a depressed quartic by setting u=v44=v+1u = v - \frac{-4}{4} = v + 1. We find (u44u3+14u220u+25)=v4+8v2+16=(v2+4)2=(u22u+5)2(u^4-4u^3+14u^2-20u+25) = v^4 + 8v^2 + 16 = (v^2 + 4)^2 = (u^2-2u+5)^2. The discriminant of u22u+5u^2-2u+5 is 4(15)<04(1-5) < 0 so we have the decomposition in irreducible factors:

u54u4+14u320u2+25u=u(u22u+5)2 u^5-4u^4+14u^3-20u^2+25u = u (u^2-2u+5)^2

We now try to find A,B,C,D,EA, B, C, D, E \in \mathbb{R} such that

F(u)=2u45u3+24u227u+50u(u22u+5)2=Au+Bu+Cu22u+5+Du+E(u22u+5)2 F(u) = \frac{2u^4-5u^3+24u^2-27u+50}{u (u^2-2u+5)^2} = \frac{A}{u} + \frac{Bu+C}{u^2-2u+5} + \frac{Du+E}{(u^2-2u+5)^2} limu0uF(u)=A=503×25=2 \lim_{u \rightarrow 0} uF(u) = A = \frac{50}{3 \times 25} = 2 limu+uF(u)=A+B=2B=0 \lim_{u \rightarrow +\infty} uF(u) = A + B = 2 \rightarrow B = 0 limu+u2(F(u)Au)=C=limu+u22u45u32(u44u3)u×u4=3 \lim_{u \rightarrow +\infty} u^2\left(F(u) - \frac{A}{u}\right) = C = \lim_{u \rightarrow +\infty} u^2 \frac{2 u^4 - 5u^3 - 2(u^4-4u^3)}{u \times u^4} = 3 F(1)=114=2+34+D+E16D+E=443212=0 F(1) = \frac{11}{4} = 2 + \frac{3}{4} + \frac{D+E}{16} \rightarrow D+E = 44 - 32 - 12 = 0 F(2)=4225=1+35+2D+E252D+E=422515=2 F(2) = \frac{42}{25} = 1 + \frac{3}{5} + \frac{2D+E}{25} \rightarrow 2D + E = 42 - 25 - 15 = 2

From the two last equalities, we immediately get D=2D = 2 and E=2E = -2. Finally,

F(u)=2u+3u22u+5+2u2(u22u+5)2 F(u) = \frac{2}{u} + \frac{3}{u^2-2u+5} + \frac{2u - 2}{(u^2-2u+5)^2}

We have

u=152udu=[2ln|u|]u=15=2ln(5) \int_{u=1}^{5} \frac{2}{u} d u= \left[ 2 \ln|u| \right]_{u=1}^5 = 2 \ln(5) u=153u22u+5du=34u=15du(u12)2+1=32v=02dvv2+1=32arctan(2) \int_{u=1}^{5} \frac{3}{u^2-2u+5} d u= \frac{3}{4} \int_{u=1}^{5} \frac{d u}{(\frac{u-1}{2})^2+1} = \frac{3}{2} \int_{v=0}^{2} \frac{d v}{v^2+1} = \frac{3}{2} \arctan(2) u=152u2(u22u+5)2du=[1u22u+5]u=15=15 \int_{u=1}^{5} \frac{2u - 2}{(u^2-2u+5)^2} d u = \left[ - \frac{1}{u^2-2u+5} \right]_{u=1}^5 = \frac{1}{5}

hence

u=15F(u)du=2ln(5)+32arctan(2)+15 \int_{u=1}^5 F(u) d u = 2 \ln(5) + \frac{3}{2} \arctan(2) + \frac{1}{5}

Example 3

t=217t62t53t4+15t3+4t217t4+2t3t2dt \int_{t=2}^{17} \frac{t^6-2t^5-3t^4+15t^3+4t^2-17}{t^4+2t^3-t-2} d t

By polynomial long division we find that

X62x53X4+15X3+4X217=(X24X+5)(X4+2X3X2)+6X3+2X23X7 X^6-2x^5-3X^4+15X^3+4X^2-17 = (X^2-4X+5)(X^4+2X^3-X-2)+6X^3+2X^2-3X-7

and so

t62t53t4+15t3+4t217t4+2t3t2=t24t+5+6t3+2t23t7t4+2t3t2 \frac{t^6-2t^5-3t^4+15t^3+4t^2-17}{t^4+2t^3-t-2} = t^2-4t+5+\frac{6t^3+2t^2-3t-7}{t^4+2t^3-t-2}

The integral of the first term is:

t=217t24t+5dt=[t332t2+5t]t=217=1140 \int_{t=2}^{17} t^2-4t+5 d t = {\left[\frac{t^3}{3} - 2t^2 + 5t\right]}_{t=2}^{17} = 1140

First we search trivial roots for the denominator. If we evaluate t4+2t3t2t^4+2t^3-t-2 at t=0,1,1,2,2t=0,-1,1,-2,2 we find respectively 2,2,0,0,28-2, -2, 0, 0, 28. So we can factor X4+2X4X2X^4+2X^4-X-2 by (X1)(X+2)(X - 1)(X + 2). We get

X4+2X3X2=(X1)(X+2)(X2+X+1) X^4+2X^3-X-2 = (X - 1)(X + 2)(X^2+X+1)

The polynomial X2+X+1X^2+X+1 is irreducible on \mathbb{R} because its discrimant is 14=3<01 - 4 = -3 < 0. Hence we search a decomposition of

F(t)=6t3+2t23t7(t1)(t+2)(t2+t+1)=At1+Bt+2+Ct+Dt2+t+1 F(t) = \frac{6t^3+2t^2-3t-7}{(t - 1)(t + 2)(t^2+t+1)} = \frac{A}{t - 1} + \frac{B}{t + 2} + \frac{C t + D}{t^2+t+1}

for some constants A,B,C,DA, B, C, D \in \mathbb{R}. We have

limt1(t1)F(t)=A=6+2373×3=29 \lim_{t \rightarrow 1} (t - 1)F(t) = A = \frac{6+2-3-7}{3 \times 3} = - \frac{2}{9} limt2(t+2)F(t)=B=6×8+2×4+3×273×(42+1)=419 \lim_{t \rightarrow -2} (t + 2)F(t) = B = \frac{6\times-8+2\times4+3\times2-7}{-3 \times (4-2+1)} = \frac{41}{9} limt+tF(t)=A+B+C=6C=6+29419=53 \lim_{t \rightarrow +\infty} t F(t) = A + B + C = 6 \rightarrow C = 6 + \frac{2}{9} - \frac{41}{9} = \frac{5}{3} F(0)=A+B2+D=71×2×1D=72294118=1 F(0) = -A + \frac{B}{2} + D = \frac{-7}{-1 \times 2 \times 1} \rightarrow D = \frac{7}{2} -\frac{2}{9} - \frac{41}{18} = 1

So

F(t)=29(t1)+419(t+2)+53t+1t2+t+1 F(t) = -\frac{2}{9(t - 1)} + \frac{41}{9(t + 2)} + \frac{\frac{5}{3} t + 1}{t^2+t+1}

The integral of the two first terms is easy to compute:

t=21729(t1)+419(t+2)dt=29[ln|t1|]217+419[ln|t+2|]217=29ln(16)+419ln(19)419ln(4) \int_{t=2}^{17} -\frac{2}{9(t - 1)} + \frac{41}{9(t + 2)} d t = -\frac{2}{9} \left[\ln|t-1|\right]_{2}^{17} + \frac{41}{9} \left[\ln|t+2|\right]_{2}^{17} = -\frac{2}{9} \ln(16) + \frac{41}{9} \ln(19) - \frac{41}{9} \ln(4)

The last term can be split into two parts:

53t+1t2+t+1=562t+1t2+t+1+16×431(t+1234)2+1 \frac{\frac{5}{3} t + 1}{t^2+t+1} = \frac{5}{6} \frac{2t+1}{t^2+t+1} + \frac{1}{6} \times \frac{4}{3} \frac{1}{\left( \frac{t+\frac{1}{2}}{\sqrt{\frac{3}{4}}} \right)^2 + 1}

We have

t=217562tt2+t+1dt=56[ln|t2+t+1|]t=217=56ln(307)56log(7) \int_{t=2}^{17} \frac{5}{6} \frac{2t}{t^2+t+1} d t = \frac{5}{6} \left[ \ln |t^2 + t + 1| \right]_{t=2}^{17} = \frac{5}{6} \ln(307) - \frac{5}{6} \log(7)

and

t=21729dt(t+1234)2+1=29u=5335334duu2+1=133[arctanu]u=53353 \int_{t=2}^{17} \frac{2}{9} \frac{d t}{\left( \frac{t+\frac{1}{2}}{\sqrt{\frac{3}{4}}} \right)^2 + 1} = \frac{2}{9} \int_{u=\frac{5}{\sqrt{3}}}^{\frac{35}{\sqrt{3}}} \frac{\sqrt{\frac{3}{4}} d u}{u^2 + 1} = \frac{1}{3 \sqrt{3}} \left[ \arctan u \right]_{u=\frac{5}{\sqrt{3}}}^{\frac{35}{\sqrt{3}}}

Finally we get

t=217t62t53t4+15t3+4t217t4+2t3t2dt=114029ln(16)+419ln(19)419ln(4)+56ln(307)56log(7)+133arctan(353)133arctan(53) \int_{t=2}^{17} \frac{t^6-2t^5-3t^4+15t^3+4t^2-17}{t^4+2t^3-t-2} d t = 1140 -\frac{2}{9} \ln(16) + \frac{41}{9} \ln(19) - \frac{41}{9} \ln(4) + \frac{5}{6} \ln(307) - \frac{5}{6} \log(7) + \frac{1}{3 \sqrt{3}} \arctan\left(\frac{35}{\sqrt{3}}\right) - \frac{1}{3 \sqrt{3}} \arctan\left(\frac{5}{\sqrt{3}}\right)

Alternatively, we can write

G(t)=53t+1t2+t+1=Ett++Ftt G(t) = \frac{\frac{5}{3} t + 1}{t^2+t+1} = \frac{E}{t - t^+} + \frac{F}{t - t^-}

where t±=1±i32t^\pm = \frac{-1\pm i \sqrt{3}}{2} are the complex roots of t2+t+1t^2+t+1. We have

limtt+(tt+)G(t)=E=53+i63 \lim_{t \rightarrow t^+} (t-t^+) G(t) = E = \frac{5\sqrt{3}+i}{6 \sqrt{3}} limtt(tt)G(t)=F=53i63 \lim_{t \rightarrow t^-} (t-t^-) G(t) = F = \frac{5\sqrt{3}-i}{6 \sqrt{3}}

We have

217G(t)dt=[E(ln|tt+|+iarctant(t+)(t+))+F(ln|tt|+iarctant(t)(t))]217 \int_{2}^{17} G(t) d t = \left[ E \left( \ln |t - t^+| + i \arctan \frac{t - \Re(t^+)}{\Im(t^+)} \right) + F \left( \ln |t - t^-| + i \arctan \frac{t - \Re(t^-)}{\Im(t^-)} \right) \right]_{2}^{17}

After simplification, we get

217G(t)dt=56ln(307)56log(7)+133arctan(353)133arctan(53) \int_{2}^{17} G(t) d t = \frac{5}{6} \ln(307) - \frac{5}{6} \log(7) + \frac{1}{3 \sqrt{3}} \arctan\left(\frac{35}{\sqrt{3}}\right) - \frac{1}{3 \sqrt{3}} \arctan\left(\frac{5}{\sqrt{3}}\right)

as we already found above.

Contour Integration

Idea

Consider contour integral γf(z)dz\oint_\gamma f(z) d z along paths in complex plane to deduce integral along the real line.

Example 1

Consider the integral

02π6cos(2θ)4sin(θ)5dθ \int_{0}^{2 \pi} \frac{6 \cos(2 \theta)}{4 \sin(\theta) - 5} d\theta

Write z=eiθz = e^{i \theta}, dz=izdθd z = i z d \theta. The integral becomes

γ3(z2+z2)2i(zz1)5dziz=γ3(z4+1)2z2(z2i)(zi2)dz \oint_{\gamma} \frac{3 (z^2 + z^{-2})}{-2 i (z - z^{-1}) - 5} \frac{d z}{i z} = \oint_{\gamma} \frac{3(z^4+1)}{2 z^2 (z - 2 i)\left(z - \frac{i}{2}\right)} d z

where γ\gamma is the unit circle traversed counterclockwise. f:z3(z4+1)2z2(z2i)(zi2)f : z \mapsto \frac{3(z^4+1)}{2 z^2 (z - 2 i)\left(z - \frac{i}{2}\right)} has two singularities inside that circle: 00 and i2\frac{i}{2}. Hence the integral is the 2πi2 \pi i times the sum of the residues of ff at these points:

Res(f,0)=limz0d(z2f(z))dz=15i4 \mathrm{Res}(f, 0) = \lim_{z \rightarrow 0} \frac{d \left( z^2 f(z) \right)}{dz} = \frac{15 i}{4} Res(f,i2)=limz0(zi2)f(z)=17i4 \mathrm{Res}(f, \frac{i}{2}) = \lim_{z \rightarrow 0} \left( z - \frac{i}{2} \right) f(z) = -\frac{17 i}{4}

Hence

02π6cos(2θ)4sin(θ)5dθ=γf(z)dz=2πi(15i417i4)=π \int_{0}^{2 \pi} \frac{6 \cos(2 \theta)}{4 \sin(\theta) - 5} d\theta = \oint_{\gamma} f(z) d z = 2 \pi i \left( \frac{15 i}{4} -\frac{17 i}{4} \right) = \pi

Example 2

We want to know the value of the integral

+16sin(2x+π)5(x2+2x+5)2dx \int_{-\infty}^{+\infty} \frac{16 \sin(2x+\pi)}{5(x^2+2x+5)^2} dx

For that purpose, we introduce the function

f(z)=16e2πz5(z2+2z+5)2 f(z) = \frac{16 e^{-2\pi z}}{5(z^2+2z+5)^2}

We note that x(f(x))x \mapsto \Im(f(x)) is the integrand above. We also note that the poles of ff are z±=1±2iz^\pm = -1 \pm 2 i. By choosing the right contour, one can show that

+f(x)dx=2iπ(z)<0zresidueRes(f,z) \int_{-\infty}^{+\infty} f(x) dx = -2 i \pi \sum_{\stackrel{z \text{residue}}{\Im(z) < 0}} \mathrm{Res}(f, z)

We have

Res(f,z)=limzzd((zz)2f(z))dz=ie2i2e4 \mathrm{Res}(f, z^-) = \lim_{z \rightarrow z⁻} \frac{d \left( (z - z^-)^2 f(z) \right)}{dz} = \frac{i e^{2 i}}{2 e^4}

Hence

+16sin(2x+π)5(x2+2x+5)2dx=(+f(x)dx)=(2iπie2i2e4)=(πe2ie4) \int_{-\infty}^{+\infty} \frac{16 \sin(2x+\pi)}{5(x^2+2x+5)^2} dx = \Im\left(\int_{-\infty}^{+\infty} f(x) dx\right) = \Im\left(-2 i \pi \frac{i e^{2 i}}{2 e^4}\right) = \Im\left(\frac{\pi e^{2 i}}{e^4}\right)

Finally

+16sin(2x+π)5(x2+2x+5)2dx=πsin(2)e4 \int_{-\infty}^{+\infty} \frac{16 \sin(2x+\pi)}{5(x^2+2x+5)^2} dx = \frac{\pi \sin(2)}{e^4}