Logo
Published on

Integration by Parts: The Product Rule in Reverse

Authors
  • avatar
    Name
    Vu Hung
    Twitter

Problem Statement

In differential calculus, the Product Rule allows us to differentiate the multiplication of two functions. By reversing this rule, we derive Integration by Parts, a powerful technique used to integrate the product of two functions when standard substitution fails.

Integration by parts states that udv=uvvdu\int u \, dv = uv - \int v \, du.

This technique isn't just an abstract mathematical trick; it has profound applications in other areas of mathematics, particularly in probability theory and statistics, where it is used to calculate the mean (expected value) and variance of continuous Probability Density Functions (PDFs).

Consider a continuous random variable XX with a probability density function given by: f(x)={xexfor x00for x<0f(x) = \begin{cases} x e^{-x} & \text{for } x \ge 0 \\ 0 & \text{for } x < 0 \end{cases}

(a) Show that the Product Rule ddx(uv)=udvdx+vdudx\frac{d}{dx}(uv) = u\frac{dv}{dx} + v\frac{du}{dx} leads to the Integration by Parts formula.

(b) The mean (or expected value) of a continuous PDF is given by μ=xf(x)dx\mu = \int_{-\infty}^{\infty} x f(x) \, dx. Set up the integral for the mean of XX.

(c) Use Integration by Parts to evaluate the integral and find the exact mean μ\mu of this distribution. (Note: You may assume that limxxnex=0\lim_{x \to \infty} x^n e^{-x} = 0 for any positive integer nn).


Hints

  • Part (a): Start with the product rule. Integrate both sides with respect to xx. Rearrange the equation to isolate udvdxdx\int u \frac{dv}{dx} dx, which is equivalent to udv\int u \, dv.
  • Part (b): Substitute the given PDF f(x)f(x) into the expected value formula. Since f(x)=0f(x) = 0 for x<0x < 0, your limits of integration will be from 00 to \infty.
  • Part (c): You need to integrate x2exdx\int x^2 e^{-x} dx. Use integration by parts. Let u=x2u = x^2 (so it differentiates down to 2x2x) and dv=exdxdv = e^{-x} dx (which integrates easily). You will need to apply integration by parts a second time to solve the remaining integral.

Solutions

Part (a): Deriving Integration by Parts

  1. Start with the Product Rule for differentiation: ddx[u(x)v(x)]=u(x)v(x)+v(x)u(x)\frac{d}{dx} [u(x)v(x)] = u(x)v'(x) + v(x)u'(x)
  2. Integrate both sides with respect to xx: ddx[u(x)v(x)]dx=u(x)v(x)dx+v(x)u(x)dx\int \frac{d}{dx} [u(x)v(x)] \, dx = \int u(x)v'(x) \, dx + \int v(x)u'(x) \, dx
  3. The integral of a derivative is the original function: u(x)v(x)=u(x)v(x)dx+v(x)u(x)dxu(x)v(x) = \int u(x)v'(x) \, dx + \int v(x)u'(x) \, dx
  4. Rearrange to isolate one of the integrals: u(x)v(x)dx=u(x)v(x)v(x)u(x)dx\int u(x)v'(x) \, dx = u(x)v(x) - \int v(x)u'(x) \, dx
  5. Using differential notation (dv=v(x)dxdv = v'(x)dx and du=u(x)dxdu = u'(x)dx), this simplifies to the standard form: udv=uvvdu\int u \, dv = uv - \int v \, du

Part (b): Setting up the Mean Integral

  1. The formula for the mean is μ=xf(x)dx\mu = \int_{-\infty}^{\infty} x f(x) \, dx.
  2. Since f(x)=0f(x) = 0 for x<0x < 0, the integral from -\infty to 00 is zero.
  3. For x0x \ge 0, f(x)=xexf(x) = x e^{-x}.
  4. Substitute this into the formula: μ=0x(xex)dx\mu = \int_{0}^{\infty} x (x e^{-x}) \, dx μ=0x2exdx\mu = \int_{0}^{\infty} x^2 e^{-x} \, dx

Part (c): Evaluating the Integral using By Parts

  1. We need to evaluate μ=0x2exdx\mu = \int_{0}^{\infty} x^2 e^{-x} \, dx. Let's solve the indefinite integral I=x2exdxI = \int x^2 e^{-x} \, dx first.
  2. Choose uu and dvdv:
    • Let u=x2    du=2xdxu = x^2 \implies du = 2x \, dx
    • Let dv=exdx    v=exdv = e^{-x} \, dx \implies v = -e^{-x}
  3. Apply integration by parts (uvvduuv - \int v \, du): I=(x2)(ex)(ex)(2x)dxI = (x^2)(-e^{-x}) - \int (-e^{-x})(2x) \, dx I=x2ex+2xexdxI = -x^2 e^{-x} + 2 \int x e^{-x} \, dx
  4. We must use integration by parts again for xexdx\int x e^{-x} \, dx:
    • Let u=x    du=dxu = x \implies du = dx
    • Let dv=exdx    v=exdv = e^{-x} \, dx \implies v = -e^{-x} xexdx=xexexdx=xex+exdx=xexex\int x e^{-x} \, dx = -x e^{-x} - \int -e^{-x} \, dx = -x e^{-x} + \int e^{-x} \, dx = -x e^{-x} - e^{-x}
  5. Substitute this back into our equation for II: I=x2ex+2(xexex)I = -x^2 e^{-x} + 2(-x e^{-x} - e^{-x}) I=ex(x2+2x+2)I = -e^{-x}(x^2 + 2x + 2)
  6. Now evaluate the definite integral from 00 to \infty: μ=[ex(x2+2x+2)]0\mu = \left[ -e^{-x}(x^2 + 2x + 2) \right]_0^{\infty}
  7. Evaluate the upper limit (xx \to \infty): We are given that limxxnex=0\lim_{x \to \infty} x^n e^{-x} = 0, so the upper limit evaluates to 00.
  8. Evaluate the lower limit (x=0x = 0): e0(02+2(0)+2)=1(2)=2-e^0(0^2 + 2(0) + 2) = -1(2) = -2
  9. Subtract the lower limit from the upper limit: μ=0(2)=2\mu = 0 - (-2) = 2
  10. The mean of the probability density function is 22.

Takeaways

  • Calculus is Connected: Integration by parts is not arbitrary; it is the direct, logical inverse of the Product Rule from differential calculus.
  • LIATE Rule: When choosing uu, follow the LIATE priority list (Logarithmic, Inverse trig, Algebraic, Trigonometric, Exponential). In our problem, x2x^2 is Algebraic and exe^{-x} is Exponential, so Algebraic gets priority for uu.
  • Calculus in Statistics: Continuous probability relies entirely on integral calculus. The total probability (area under the curve) is 1, and moments like mean and variance are found by integrating xf(x)x f(x) and x2f(x)x^2 f(x).

Further Readings


Connect with me

If integration by parts always trips you up, or if you want to see more connections between calculus and statistics, check out Vu's Maths Hub. I have dedicated booklets breaking down these exact techniques. You can also follow my video tutorials on YouTube, connect with me on LinkedIn, or read my deeper syllabus analysis on Substack.