Skip to content

Integration

Integration by parts

To integrate \(x^3 e^x\), we use Integration by Parts repeatedly. The formula for integration by parts is:

\[\int u \, dv = uv - \int v \, du\]

Alternatively, for a polynomial multiplied by an exponential, the Tabular Method (or DI method) is the most efficient way to solve this.

Tabular Method:

  1. Differentiate the polynomial (\(x^3\)) until it reaches zero.
  2. Integrate the exponential function (\(e^x\)) the same number of times.
  3. Alternate signs starting with \(+\).
Sign D (Differentiate) I (Integrate)
\(+\) \(x^3\) \(e^x\)
\(-\) \(3x^2\) \(e^x\)
\(+\) \(6x\) \(e^x\)
\(-\) \(6\) \(e^x\)
\(+\) \(0\) \(e^x\)

Multiply the terms diagonally as indicated by the table and sum them up:

\[\int x^3 e^x \, dx = (x^3)(e^x) - (3x^2)(e^x) + (6x)(e^x) - (6)(e^x) + C\]
\[\int x^3 e^x \, dx = (x^3 - 3x^2 + 6x - 6)e^x + C\]

Code

import sympy as sp

x = sp.symbols('x')
f = x**3 * sp.exp(x)
integral = sp.integrate(f, x)
print(integral)
(x**3 - 3*x**2 + 6*x - 6)*exp(x)