Understand how integration by parts arises from reversing the product rule for derivatives
Apply the integration by parts formula ∫udv=uv−∫vdu to evaluate integrals
Use the LIATE rule to strategically choose u and dv
Master the tabular method for repeated integration by parts
Apply integration by parts to definite integrals with proper boundary evaluation
Connect this technique to physics, probability, signal processing, and machine learning
The Big Picture: Reversing the Product Rule
"Integration by parts is the antiderivative analog of the product rule — it transforms difficult products into manageable pieces."
In differential calculus, the product rule tells us how to differentiate a product of two functions:
dxd[u(x)⋅v(x)]=u′(x)⋅v(x)+u(x)⋅v′(x)
But what if we need to go backwards? What if we have an integral of a product and want to find its antiderivative? This is where integration by parts comes in — it's the reverse of the product rule.
The Core Insight
Integration by parts transforms ∫udv into uv−∫vdu. The hope is that ∫vdu is easier to evaluate than the original integral. This technique works when one part of the product simplifies upon differentiation while the other remains manageable upon integration.
Why Do We Need This?
Consider ∫xexdx. Neither u-substitution nor any basic formula helps here. The product of x and ex doesn't fit any pattern we know — but integration by parts transforms this into something solvable.
Integration by parts is essential for integrals involving:
Products of polynomials with exponentials: ∫xnexdx
Products of polynomials with trigonometric functions: ∫xsinxdx
Logarithmic functions: ∫lnxdx
Inverse trigonometric functions: ∫arctanxdx
Products of trigonometric functions: ∫exsinxdx
Historical Context
Integration by parts was developed alongside the foundational work of calculus in the 17th century.
Gottfried Wilhelm Leibniz (1646–1716)
Leibniz, who independently developed calculus alongside Newton, recognized that his product rule for differentiation could be "inverted" to create a technique for integration. His notation ∫udv emphasizes the differential form, making the relationship between differentiation and integration explicit.
Leibniz's insight was profound: since d(uv)=udv+vdu, we can rearrange to get udv=d(uv)−vdu. Integrating both sides gives the integration by parts formula.
The Name "Integration by Parts"
The name comes from the idea that we split the integrand into two "parts": one part (u) that we differentiate, and another part (dv) that we integrate. The technique redistributes the complexity between these parts, hopefully making the integral easier.
Derivation from the Product Rule
Let's derive the integration by parts formula step by step from the product rule.
Step 1: Start with the Product Rule
For two differentiable functions u(x) and v(x):
dxd[u(x)v(x)]=u′(x)v(x)+u(x)v′(x)
Step 2: Rearrange
Isolate one of the product terms:
u(x)v′(x)=dxd[u(x)v(x)]−u′(x)v(x)
Step 3: Integrate Both Sides
Integrate with respect to x:
∫u(x)v′(x)dx=u(x)v(x)−∫u′(x)v(x)dx
The left side integrates the derivative dxd[uv], which simply gives uv.
Step 4: Write in Differential Form
Using Leibniz notation where du=u′(x)dx and dv=v′(x)dx:
Integration by Parts Formula
∫udv=uv−∫vdu
Where u and v are functions of x
Memory Aid
Think of it as: "Ultra-Violet minus Voodoo" — uv−∫vdu. The integral "trades" one problem for another: we lose the dv but gain du.
The Integration by Parts Formula
The Process
To evaluate ∫f(x)g(x)dx using integration by parts:
Choose which factor to call u and which to call dv
Differentiateu to find du
Integratedv to find v
Apply the formula: ∫udv=uv−∫vdu
Evaluate the new integral ∫vdu
A First Example: ∫xexdx
Step 1: Identify u and dv
Let u=x and dv=exdx
Step 2: Find du and v
du=dx
v=∫exdx=ex
Step 3: Apply the Formula
∫xexdx=xex−∫exdx
Step 4: Evaluate the Remaining Integral
∫xexdx=xex−ex+C=ex(x−1)+C
Verification
We can verify by differentiating: dxd[ex(x−1)]=ex(x−1)+ex=xex ✓
Interactive: Visualizing Integration by Parts
Explore how integration by parts works geometrically. See how the choice of u and dv transforms the integral:
Integration by Parts Step-by-Step
1. Identify the Integral2. Choose u and dv3. Compute du and v4. Apply the Formula5. Evaluate ∫v du6. Final Answer
We want to evaluate:
∫ x e^x dx
This is a product of two functions. We'll use integration by parts.
Remember: ∫ u dv = uv − ∫ v du
Choosing u and dv: The LIATE Rule
The success of integration by parts depends critically on choosing u and dv wisely. The LIATE rule is a heuristic that suggests which function to choose as u.
The LIATE Rule
Choose u to be the function that appears earliest in this list:
L
Logarithmic
lnx
I
Inverse Trig
arctanx
A
Algebraic
xn
T
Trigonometric
sinx
E
Exponential
ex
Why LIATE Works
Functions earlier in the list generally become simpler when differentiated:
lnx→x1 — logarithms become algebraic
arctanx→1+x21 — inverse trig becomes rational
xn→nxn−1 — polynomials reduce degree
sinx→cosx — trig stays trig
ex→ex — exponentials stay the same
Meanwhile, functions later in the list are easy to integrate:
∫exdx=ex
∫sinxdx=−cosx
∫xndx=n+1xn+1
Integral
u (using LIATE)
dv
Reason
∫ x·eˣ dx
x (Algebraic)
eˣ dx
A comes before E; differentiating x simplifies it
∫ x·sin(x) dx
x (Algebraic)
sin(x) dx
A comes before T; x reduces degree
∫ ln(x) dx
ln(x) (Logarithmic)
dx
L is first; ln(x) becomes 1/x
∫ x²·ln(x) dx
ln(x) (Logarithmic)
x² dx
L comes before A
∫ arctan(x) dx
arctan(x) (Inverse)
dx
I is second; becomes rational
∫ eˣ·sin(x) dx
Either works!
Either works!
Special case: requires two IBP cycles
LIATE is a Guideline, Not a Law
The LIATE rule works for most integrals, but there are exceptions. If your first choice leads to a more complicated integral, try the other option. Experience helps develop intuition for when to deviate.
Worked Examples
Example 1: ∫x2exdx
Analysis: By LIATE, u=x2 (Algebraic) and dv=exdx (Exponential).
First Application:
u=x2, du=2xdx
dv=exdx, v=ex
∫x2exdx=x2ex−∫2xexdx=x2ex−2∫xexdx
Second Application on ∫xexdx:
u=x, du=dx
dv=exdx, v=ex
∫xexdx=xex−ex
Final Result:
∫x2exdx=x2ex−2(xex−ex)+C=ex(x2−2x+2)+C
Example 2: ∫lnxdx
Key Insight: We write this as ∫1⋅lnxdx and choose u=lnx, dv=dx.
u=lnx, du=x1dx
dv=dx, v=x
∫lnxdx=xlnx−∫x⋅x1dx=xlnx−∫1dx
∫lnxdx=xlnx−x+C=x(lnx−1)+C
Example 3: ∫exsinxdx (The Cycling Case)
Special Situation: Both functions are at the same "level" in LIATE. We'll need to apply IBP twice and solve for the original integral.
First Application: Let u=ex, dv=sinxdx
du=exdx, v=−cosx
∫exsinxdx=−excosx+∫excosxdx
Second Application on ∫excosxdx: Let u=ex, dv=cosxdx
∫excosxdx=exsinx−∫exsinxdx
Substitute Back:
∫exsinxdx=−excosx+exsinx−∫exsinxdx
Solve for the Integral: Let I=∫exsinxdx
I=−excosx+exsinx−I⟹2I=ex(sinx−cosx)
∫exsinxdx=2ex(sinx−cosx)+C
Example 4: ∫arctanxdx
Setup: Write as ∫1⋅arctanxdx with u=arctanx, dv=dx.
u=arctanx, du=1+x21dx
dv=dx, v=x
∫arctanxdx=xarctanx−∫1+x2xdx
The remaining integral uses u-substitution with w=1+x2:
∫arctanxdx=xarctanx−21ln(1+x2)+C
Tabular Integration Method
When you need to apply integration by parts multiple times — especially when the u factor is a polynomial that eventually differentiates to zero — the tabular method (also called the tic-tac-toe method) provides an efficient shortcut.
The Process
Create two columns: one for successive derivatives of u, one for successive integrals of dv
Continue until the u column reaches zero (for polynomials) or a pattern emerges
Draw diagonal lines connecting entries
Alternate signs: +,−,+,−,…
Multiply along each diagonal and sum
Example: ∫x3e2xdx
Sign
u and derivatives
dv and integrals
+
x³
e^(2x)
-
3x²
(1/2)e^(2x)
+
6x
(1/4)e^(2x)
-
6
(1/8)e^(2x)
+
0
(1/16)e^(2x)
Result: Multiply diagonally and sum:
∫x3e2xdx=2e2x(x3−23x2+46x−86)+C
=8e2x(4x3−6x2+6x−3)+C
Interactive: Tabular Method
Practice the tabular method interactively. See how the table builds and how the alternating signs combine with diagonal products:
Tabular Integration Method
Building table for: ∫ x² eˣ dx with u = x², dv = eˣ dx
Sign
Derivatives of u
Integrals of dv
+
x²
↓ differentiate
eˣ
↓ integrate
How it works: Multiply diagonally (each u-row with the v-row below it), alternating signs (+, −, +, −, ...), and sum. Stop when u reaches 0.
Repeated Integration by Parts
Some integrals require applying integration by parts multiple times. There are two common scenarios:
Case 1: Polynomial Reduction
When u is a polynomial of degree n, you need n applications of IBP. Each application reduces the degree by 1, until the polynomial becomes a constant.
Examples:
∫x2sinxdx — needs 2 applications
∫x4exdx — needs 4 applications
Case 2: Cyclic Return
When both factors regenerate (like exsinx), the original integral appears again after 2 applications. Solve algebraically:
If I=∫exsinxdx and after two IBP applications we get:
I=exsinx−excosx−I
Then:
2I=ex(sinx−cosx)⟹I=2ex(sinx−cosx)
Integration by Parts for Definite Integrals
For definite integrals, we evaluate the boundary terms [uv]ab at the limits:
Integration by Parts for Definite Integrals
∫abudv=[uv]ab−∫abvdu
Where [uv]ab=u(b)v(b)−u(a)v(a)
Example: ∫01xexdx
With u=x, dv=exdx:
∫01xexdx=[xex]01−∫01exdx
Evaluate:
=(1⋅e1−0⋅e0)−[ex]01=e−(e−1)=1
∫01xexdx=1
Real-World Applications
Integration by parts appears throughout science and engineering whenever we need to integrate products of functions.
Physics: Work Done by Variable Forces
When both force and displacement are time-dependent, the work integral often requires IBP:
W=∫0TF(t)⋅v(t)dt
Example: A motor starting up with F(t)=F0t and v(t)=v0e−kt
Probability: Expected Values
Computing expected values of continuous distributions invariably involves products:
E[X]=∫0∞x⋅f(x)dx
For the exponential distribution: E[X]=∫0∞xλe−λxdx=λ1
Signal Processing: Fourier Coefficients
Computing Fourier coefficients for non-sinusoidal waves:
bn=L2∫0Lf(x)sin(Lnπx)dx
When f(x) is polynomial or exponential, IBP is needed.
Control Systems: Laplace Transforms
The property L{tf(t)}=−dsdF(s) is derived using integration by parts:
L{f(t)}=∫0∞f(t)e−stdt
Differentiating with respect to s brings down a factor of −t, creating an IBP situation.
Machine Learning Connection
Integration by parts plays a subtle but important role in machine learning and statistics.
The Score Function and REINFORCE
In reinforcement learning, we often need to compute gradients of expectations:
∇θEx∼pθ[f(x)]=∇θ∫f(x)p(x∣θ)dx
The key insight (derived using integration by parts) is that this equals:
=Ex∼pθ[f(x)∇θlogp(x∣θ)]
This is the score function estimator (or REINFORCE trick). The transformation uses integration by parts:
∇θp(x∣θ)=p(x∣θ)∇θlogp(x∣θ)
Since ∇logp=p∇p
The Gamma Function Recurrence
The Gamma function Γ(n)=∫0∞xn−1e−xdx satisfies Γ(n+1)=n⋅Γ(n), proven by integration by parts. This is fundamental for:
Gamma distribution normalization
Chi-squared distribution
Student's t-distribution
Beta function and Bayesian inference
Variance Reduction in Monte Carlo
The control variate method in variance reduction uses integration by parts to derive optimal baseline functions that reduce the variance of gradient estimators in policy gradient methods.
Python Implementation
Numerical and Symbolic Integration by Parts
Here's how to verify integration by parts numerically and perform it symbolically:
Integration by Parts: Numerical and Symbolic
🐍integration_by_parts.py
Explanation(6)
Code(143)
10Setting Up the IBP
We identify u = x and dv = e^x dx. This choice follows the LIATE rule: x is algebraic, e^x is exponential. The algebraic term simplifies when differentiated.
18Numerical Integration
SciPy's quad function uses adaptive quadrature to compute the definite integral. This serves as ground truth to verify our analytical solution.
SymPy automatically applies integration by parts (and other techniques) to find antiderivatives. This shows the power of computer algebra systems.
67Score Function Gradient
The REINFORCE trick in reinforcement learning uses integration by parts to express gradients of expectations as expectations of gradients - enabling gradient estimation via sampling.
94Gamma Function Recurrence
The fundamental property Γ(n+1) = n·Γ(n) is proven using integration by parts. This connects calculus to probability theory (Gamma, Chi-squared distributions).
137 lines without explanation
1import numpy as np
2from scipy import integrate
3import sympy as sp
45defintegration_by_parts_numerical():6"""
7 Verify integration by parts numerically:
8 ∫ u dv = uv - ∫ v du
910 Example: ∫ x·e^x dx from 0 to 1
11 Let u = x, dv = e^x dx
12 Then du = dx, v = e^x
1314 ∫ x·e^x dx = x·e^x - ∫ e^x dx = x·e^x - e^x + C = (x-1)e^x + C
15 """16# Define the integrand f(x) = x * e^x17deff(x):18return x * np.exp(x)1920# Numerical integration using scipy21 numerical_result, error = integrate.quad(f,0,1)2223# Analytical result: [(x-1)e^x] from 0 to 124# At x=1: (1-1)e^1 = 025# At x=0: (0-1)e^0 = -126# Result: 0 - (-1) = 127 analytical_result =1.02829print("Integration by Parts: ∫₀¹ x·eˣ dx")30print("="*45)31print(f"Numerical result: {numerical_result:.10f}")32print(f"Analytical result: {analytical_result:.10f}")33print(f"Absolute error: {abs(numerical_result - analytical_result):.2e}")3435return numerical_result, analytical_result
3637defintegration_by_parts_symbolic():38"""
39 Use SymPy to perform integration by parts symbolically.
40 This demonstrates how computer algebra systems apply IBP.
41 """42 x = sp.Symbol('x')4344# Define examples that require integration by parts45 examples =[46("x * exp(x)", x * sp.exp(x)),47("x * sin(x)", x * sp.sin(x)),48("x^2 * cos(x)", x**2* sp.cos(x)),49("ln(x)", sp.ln(x)),50("x * ln(x)", x * sp.ln(x)),51("arctan(x)", sp.atan(x)),52]5354print("\nSymbolic Integration by Parts Examples")55print("="*55)5657for name, expr in examples:58 result = sp.integrate(expr, x)59 result_simplified = sp.simplify(result)60print(f"\n∫ {name} dx = {result_simplified}")6162return examples
6364defibp_ml_application():65"""
66 Integration by parts in Machine Learning:
67 Computing expectations and gradients of log-probability.
6869 In reinforcement learning, the score function gradient:
70 ∇_θ E[f(x)] = E[f(x) ∇_θ log p(x|θ)]
7172 This derivation uses integration by parts!
73 """74print("\n"+"="*55)75print("Integration by Parts in Machine Learning")76print("="*55)7778# Demonstrate with Gaussian distribution79# For Gaussian: p(x|μ,σ) = (1/√(2πσ²)) exp(-(x-μ)²/(2σ²))80# Score function: ∇_μ log p(x|μ,σ) = (x-μ)/σ²8182 mu, sigma =0.0,1.083 n_samples =1000008485# Sample from Gaussian86 samples = np.random.normal(mu, sigma, n_samples)8788# For any function f(x), we can estimate:89# ∇_μ E[f(x)] ≈ (1/N) Σ f(xᵢ) · (xᵢ - μ)/σ²9091# Example: f(x) = x² (so E[f(x)] = μ² + σ² = 1)92 f_samples = samples **293 score_values =(samples - mu)/(sigma **2)9495# Score function gradient estimate96 gradient_estimate = np.mean(f_samples * score_values)9798# True gradient: ∂/∂μ (μ² + σ²) = 2μ = 099 true_gradient =2* mu
100101print(f"\nScore Function Gradient (REINFORCE trick)")102print(f"Function: f(x) = x²")103print(f"True gradient ∂/∂μ E[x²]: {true_gradient:.6f}")104print(f"Estimated gradient: {gradient_estimate:.6f}")105print(f"\nThis technique is derived using integration by parts!")106print("∇_θ E[f(x)] = ∫ f(x) ∇_θ p(x|θ) dx")107print(" = ∫ f(x) p(x|θ) ∇_θ log p(x|θ) dx")108print(" = E[f(x) ∇_θ log p(x|θ)]")109110defgamma_function_ibp():111"""
112 The Gamma function Γ(n) = ∫₀^∞ x^(n-1) e^(-x) dx
113 satisfies Γ(n+1) = n·Γ(n), proven by integration by parts!
114115 This property is fundamental in probability distributions
116 (Gamma, Chi-squared, Student-t, etc.)
117 """118print("\n"+"="*55)119print("Integration by Parts and the Gamma Function")120print("="*55)121122from scipy.special import gamma
123124# Verify Γ(n+1) = n·Γ(n) for several values125print("\nVerifying Γ(n+1) = n·Γ(n):")126print("-"*40)127128for n in[1,2,3,4,5,0.5,1.5,2.5]:129 gamma_n = gamma(n)130 gamma_n_plus_1 = gamma(n +1)131 ratio = gamma_n_plus_1 / gamma_n
132133print(f"n = {n:>4}: Γ({n+1}) / Γ({n}) = {ratio:.6f} ≈ {n}")134135print("\nThis recurrence is proven by IBP with u=x^(n-1), dv=e^(-x)dx")136print("Γ(n+1) = ∫₀^∞ xⁿ e^(-x) dx = [-xⁿe^(-x)]₀^∞ + n∫₀^∞ x^(n-1)e^(-x) dx")137print(" = 0 + n·Γ(n) = n·Γ(n)")138139# Run all demonstrations140integration_by_parts_numerical()141integration_by_parts_symbolic()142ibp_ml_application()143gamma_function_ibp()
Applications in Physics and Engineering
See how integration by parts applies to real-world problems:
Real-World Applications
🐍ibp_applications.py
Explanation(5)
Code(146)
11Physics: Variable Force Work
When force and velocity are both functions of time, the work integral often requires IBP. Here F(t) = F₀t and v(t) = v₀e^(-kt) model a motor starting under load.
25Analytical IBP Solution
Integration by parts gives ∫te^(-kt)dt = (-t/k - 1/k²)e^(-kt). The algebraic term t becomes simpler after differentiation, while e^(-kt) integrates cleanly.
44Probability: Expected Value
The expected value E[X] = ∫xf(x)dx always involves products of x with the PDF. For exponential, gamma, and many other distributions, this requires IBP.
71Fourier Coefficients
Fourier series coefficients for non-sinusoidal waves typically require IBP. The integral ∫x·sin(nx)dx appears when computing bₙ for signals with linear trends.
93Laplace Transform Derivative
The property L{t·f(t)} = -dF(s)/ds is fundamental in control systems. It is derived using integration by parts and enables solving differential equations algebraically.
141 lines without explanation
1import numpy as np
2from scipy import integrate
3import matplotlib.pyplot as plt
45defphysics_work_integral():6"""
7 Work done by a time-varying force:
8 W = ∫₀^T F(t) · v(t) dt
910 When F(t) = F₀·t (linearly increasing force) and
11 v(t) = v₀·e^(-kt) (exponentially decaying velocity),
12 we need integration by parts!
13 """14 F0, v0, k, T =10.0,5.0,0.5,4.01516# Integrand: F(t)·v(t) = F₀·v₀·t·e^(-kt)17defintegrand(t):18return F0 * v0 * t * np.exp(-k * t)1920# Numerical solution21 work_numerical, _ = integrate.quad(integrand,0, T)2223# Analytical solution using IBP:24# ∫ t·e^(-kt) dt = -t/k · e^(-kt) - 1/k² · e^(-kt)25defanalytical_antiderivative(t):26return(-t/k -1/k**2)* np.exp(-k * t)2728 work_analytical = F0 * v0 *(29 analytical_antiderivative(T)- analytical_antiderivative(0)30)3132print("Physics: Work Done by Time-Varying Force")33print("="*45)34print(f"F(t) = {F0}t N, v(t) = {v0}e^(-{k}t) m/s")35print(f"Numerical W = {work_numerical:.4f} J")36print(f"Analytical W = {work_analytical:.4f} J")3738return work_numerical
3940defprobability_expectation():41"""
42 Expected value of X for exponential distribution:
43 E[X] = ∫₀^∞ x · λe^(-λx) dx
4445 This requires integration by parts!
46 """47 lambda_param =2.04849defintegrand(x):50return x * lambda_param * np.exp(-lambda_param * x)5152# Numerical integration53 E_X_numerical, _ = integrate.quad(integrand,0, np.inf)5455# Analytical: E[X] = 1/λ for exponential distribution56 E_X_analytical =1/ lambda_param
5758print("\nProbability: Expected Value of Exponential Distribution")59print("="*55)60print(f"E[X] = ∫₀^∞ x · λe^(-λx) dx, with λ = {lambda_param}")61print(f"Numerical E[X] = {E_X_numerical:.6f}")62print(f"Analytical E[X] = 1/λ = {E_X_analytical:.6f}")6364# Show IBP steps65print("\nUsing IBP with u = x, dv = λe^(-λx)dx:")66print("du = dx, v = -e^(-λx)")67print("∫xλe^(-λx)dx = -xe^(-λx)|₀^∞ + ∫e^(-λx)dx")68print(" = 0 + [-1/λ · e^(-λx)]₀^∞ = 1/λ")6970return E_X_numerical
7172defsignal_processing_fourier():73"""
74 Fourier coefficients often require integration by parts.
7576 For a sawtooth wave f(x) = x on [0, 2π]:
77 bₙ = (1/π) ∫₀^(2π) x·sin(nx) dx
7879 This integral requires IBP!
80 """81defcompute_fourier_coefficient(n):82defintegrand(x):83return x * np.sin(n * x)8485 result, _ = integrate.quad(integrand,0,2*np.pi)86return result / np.pi
8788print("\nSignal Processing: Fourier Coefficients of Sawtooth Wave")89print("="*55)90print("f(x) = x on [0, 2π], computing bₙ = (1/π)∫₀^(2π) x·sin(nx) dx")91print("-"*55)9293for n inrange(1,6):94 bn = compute_fourier_coefficient(n)95# Analytical result from IBP: bₙ = -2/n96 bn_analytical =-2.0/ n
97print(f"b{n} = {bn:.6f} (analytical: {bn_analytical:.6f})")9899print("\nUsing IBP with u = x, dv = sin(nx)dx:")100print("bₙ = (1/π)[−x/n·cos(nx) + 1/n²·sin(nx)]₀^(2π)")101print(" = (1/π)(−2π/n) = −2/n")102103defcontrol_systems_laplace():104"""
105 In control systems, integration by parts is used to derive
106 Laplace transforms. The Laplace transform of t·f(t) is:
107108 L{t·f(t)} = -d/ds F(s)
109110 This is proven using integration by parts!
111 """112print("\nControl Systems: Laplace Transform Property")113print("="*55)114print("L{t·f(t)} = ∫₀^∞ t·f(t)·e^(-st) dt")115print("\nUsing IBP on ∫₀^∞ f(t)·e^(-st) dt:")116print(" u = e^(-st), dv = f(t)dt")117print(" du = -s·e^(-st)dt, v = ∫f(t)dt")118print("\nDifferentiating F(s) with respect to s:")119print(" d/ds F(s) = d/ds ∫₀^∞ f(t)e^(-st) dt")120print(" = ∫₀^∞ f(t)·(-t)·e^(-st) dt")121print(" = -L{t·f(t)}")122print("\nTherefore: L{t·f(t)} = -d/ds F(s)")123124# Verify with example: f(t) = e^(-at)125# F(s) = 1/(s+a)126# L{t·e^(-at)} = -d/ds[1/(s+a)] = 1/(s+a)²127128 a, s =2.0,3.0129130# Numerical verification131defintegrand(t):132return t * np.exp(-a*t)* np.exp(-s*t)133134 numerical_result, _ = integrate.quad(integrand,0,100)135 analytical_result =1/(s + a)**2136137print(f"\nExample: f(t) = e^(-{a}t), s = {s}")138print(f"L{{t·e^(-{a}t)}} at s={s}:")139print(f" Numerical: {numerical_result:.6f}")140print(f" Analytical: {analytical_result:.6f}")141142# Run demonstrations143physics_work_integral()144probability_expectation()145signal_processing_fourier()146control_systems_laplace()
Common Mistakes to Avoid
Mistake 1: Wrong Choice of u and dv
Wrong: For ∫xexdx, choosing u=ex and dv=xdx
This gives ∫ex⋅2x2dx — harder, not easier!
Correct: Use LIATE: u=x, dv=exdx
Mistake 2: Forgetting the Constant of Integration
When finding v from dv, we don't add +C at that step — but we must add it to the final answer.
Mistake 3: Sign Errors in the Tabular Method
The alternating signs are crucial: +,−,+,−,…. A sign error propagates through the entire calculation.
Mistake 4: Not Recognizing the Cycling Case
For ∫exsinxdx, don't keep applying IBP indefinitely. After 2 applications, the original integral reappears — solve for it algebraically.
Mistake 5: Ignoring Boundary Terms for Definite Integrals
For ∫abudv, remember to evaluate [uv]ab first before computing the remaining integral.
Test Your Understanding
Question 1 of 8Score: 0/0
For ∫ x cos(x) dx, what should you choose as u according to LIATE?
Summary
Integration by parts is a powerful technique derived from the product rule that transforms difficult integrals into manageable ones.
Key Formulas
Formula
When to Use
∫ u dv = uv - ∫ v du
Basic integration by parts
∫ₐᵇ u dv = [uv]ₐᵇ - ∫ₐᵇ v du
Definite integrals
LIATE: L-I-A-T-E
Choosing u (Log, Inverse trig, Algebraic, Trig, Exp)
Tabular method
Repeated IBP with polynomials
Solve for I when I reappears
Cycling cases (eˣ sin x, eˣ cos x)
Key Takeaways
IBP reverses the product rule: It transforms ∫udv into uv−∫vdu
LIATE guides your choice: Choose u to be the function that simplifies upon differentiation
Tabular method saves time: For polynomials times exponentials/trig, build a table
Watch for cycles: When the original integral reappears, solve algebraically
Verify by differentiation: Always check your answer by differentiating
Applications abound: From physics to probability to machine learning, IBP is essential
The Core Insight:
"Integration by parts trades one integral for another — the art is choosing the trade that makes your life easier."
Coming Next: In Trigonometric Integrals, we'll explore specialized techniques for integrating products and powers of trigonometric functions.