Introduction to Probability

Multivariable Calculus

Algorithms: Part II

Algorithms: Part I

Introduction to Software Design and Architecture

Calculus Two: Sequences and Series

LAFF Linear Algebra

Stanford Machine Learning

Calculus One

Computational Thinking

Effective Thinking Through Mathematics

CS50 Introduction to Computer Science


Week 15 - Techniques of Integration

Integration by Parts

  • Every differentiation rule has a corresponding integration rule.
  • The rule that corresponds to the Product Rule for differentiation is called the rule for integration by parts.
  • The Product Rule states that if f and g are differentiable functions, then $$\frac{d}{dx}[f(x)g(x)] = f(x)g’(x) + f’(x)g(x)$$
  • In the notation for indefinite integrals this equation becomes $$\int [f(x)g’(x) + f’(x)g(x)] dx = f(x)g(x)$$
  • We can rearrange this equation as $$\int f(x)g’(x) dx = f(x)g(x) - \int f’(x)g(x)$$
  • Let u=f(x)u = f(x) and v=g(x)v = g(x), we can simplify the equation: $$\int u\ dv = uv - \int v\ du$$


  1. xex\int x e^x
    • Let u=xu = x and dv=exdxdv = e^x dx
    • xex=xexxex=xexex+C\int x e^x = x e^x - \int x \cdot e^x = x e^x - e^x + C
  2. logxdx\int \log{x} dx
    • Let u=logxu = \log{x} and dv=dxdv = dx
    • logxdx=xlogxddxlogxxdx=xlogx1 dx=xlogxx\int \log{x} dx = x\log{x} - \int \frac{d}{dx}\log{x} \cdot x dx = x\log{x} - \int 1\ dx = x\log{x} - x
  3. excosxdx\int e^x \cos{x} dx
    • Let u=exu = e^x and dv=cosx dxdv = \cos{x}\ dx
    • cosxex dx=exsinxexsinx dx\int \cos{x} e^x\ dx = e^x \cdot \sin{x} - \int e^x \cdot \sin{x}\ dx
    • Let’s calculate the part exsinx dx\int e^x \cdot \sin{x}\ dx
      • Let u=exu = e^x and dv=sinx dxdv = \sin{x}\ dx
      • exsinx dx=ex(cosx)ex(cosx) dx\int e^x \cdot \sin{x}\ dx = e^x \cdot (-\cos{x}) - \int e^x \cdot (-\cos{x})\ dx
      • exsinx dx=excosx+excosx dx\int e^x \cdot \sin{x}\ dx = - e^x \cdot \cos{x} + \int e^x \cdot \cos{x}\ dx
    • Then we get excosx dx=exsinx+excosxexcosx dx\int e^x \cos{x}\ dx = e^x \cdot \sin{x} + e^x \cdot \cos{x} - \int e^x \cdot \cos{x}\ dx
    • So, excosx dx=exsinx+excosx2\int e^x \cos{x}\ dx = \frac{e^x \cdot \sin{x} + e^x \cdot \cos{x} }{2}

When to Use Parts?

  • Example exdx\int e^{\sqrt{x} } dx
  • First we need to use Substitution rule to replace x\sqrt{x}
  • Let’s set u=xu = \sqrt{x}, then x=u2,dx=2ux = u^2, dx = 2u
  • We rewrite the function eu2u du\int e^u \cdot 2u\ du
  • Now we can use Parts:
    • Let v=2u,dw=eu duv = 2u, dw = e^u\ du, then
    • eu2u du=2ueu2eudu=2ueu2eu+C=2ex(x1)+C\int e^u \cdot 2u\ du = 2u \cdot e^u - \int 2e^u du = 2u \cdot e^u - 2e^u + C = 2e^{\sqrt{x} }(\sqrt{x}-1) + C

Integrate Powers of Sines and Cosines

  • If the power of cosine or sine is odd:
    • Example sin(2n+1)xcos2nx dx\int \sin^{(2n+1)}{x} \cdot \cos^{2n}{x}\ dx, (nRn \in \mathbb{R})
    • We can’t use the Substitution rule directly, because whichever we choose to be uu (sine or cosine), we will always get a part that can’t deal with.
      • Like, if we choose u=sinx,du=cosx dxu = \sin{x}, du = \cos{x}\ dx, then the part cos2nx\cos^{2n}{x} will not be able to transfer.
    • Instead of making substitution immediately, we can trade a pair of sines for a pair of cosines.
      • =sinxsin2nxcos2nx du= \int \sin{x} \cdot \sin^{2n}{x} \cdot \cos^{2n}{x} \ du
      • =sinx(1cos2x)ncos2nx du= \int \sin{x} \cdot (1-\cos^{2}{x})^n \cdot \cos^{2n}{x} \ du
    • Set u=cosx,du=sinx dxu = \cos{x}, du = -\sin{x}\ dx, we get:
      • =(1u2)nu2n du= - \int (1-u^{2})^n \cdot u^{2n} \ du
      • =u2nu4n du= - \int u^{2n} - u^{4n} \ du
      • =12n+1u2n+1+14n+1u4n+C= - \frac{1}{2n+1}u^{2n+1} + \frac{1}{4n+1}u^{4n} + C
      • =12n+1cos2n+1x+14n+1cos4nx+C= - \frac{1}{2n+1}\cos^{2n+1}{x} + \frac{1}{4n+1}\cos^{4n}{x} + C
    • The conclusion is, we can always transfer the odd one to sin2nxsinx\sin^{2n}{x} \cdot \sin{x} or cos2nxcosx\cos^{2n}{x} \cdot \cos{x}, and use the equation sin2x+cos2x=1\sin^2{x} + \cos^2{x} = 1 to transfer between sin\sin and cos\cos .
  • If the powers of both sine and cosine are even, use the half-­angle identities:$$ \sin^2{x} = \frac{1}{2}(1 - \cos(2x)),\ \cos^2{x} = \frac{1}{2}(1 + \cos(2x)) $$
    • It is sometimes helpful to use the identity $$\sin{x}\cos{x} = \frac{1}{2}\sin{2x}$$
    • For example:
      • 0πsin2x dx=120π(1cos2x) dx=[12(x12sin2x)]0π=12(π12sin2π)12(012sin0)=12π\begin{aligned} \int_0^{\pi} \sin^2{x} \ dx &= \frac{1}{2} \int_0^{\pi}(1 - \cos{2x})\ dx \\ &= \big[\frac{1}{2}(x-\frac{1}{2}\sin{2x})\big]_0^{\pi} \\ &= \frac{1}{2}(\pi - \frac{1}{2} \sin{2\pi}) - \frac{1}{2}(0 - \frac{1}{2}\sin{0}) = \frac{1}{2}\pi \end{aligned}

Tables of Indefinite Integrals

  • * $tan^{-1}x = \arctan{x}$ * Hyperbolic functions * In mathematics, hyperbolic functions are analogs of the ordinary trigonometric, or circular, functions. --from [Wikipedia]( * *


  • vice versa [,vaisi’və:sə] 反之亦然