Regularization of Divergent Integrals Understanding & Computing with SageMath
- Get link
- X
- Other Apps
Regularization of Divergent Integrals
Divergent integrals often arise in physics, engineering, and advanced analysis—frequently in contexts where a function exhibits a singularity and cannot be integrated in the usual sense. Regularization is a powerful mathematical method that allows us to assign meaningful values to such divergent expressions. In this post, we explore how to understand and compute these regularizations using both theory and SageMath code.
1. Introduction: Why Regularize a Divergent Integral?
Consider the function: \[ f(x) = \frac{1}{x} \] on the real line. While this function is locally summable away from the origin, it has a non-summable singularity at 饾懃=0. The integral: \[ \int_{-\infty}^{\infty} \frac{\varphi(x)}{x} \,dx \] diverges in general, unless the test function 饾湋(饾懃) vanishes in a neighborhood of zero.
The central question is: Can we redefine this integral in a meaningful way, so that it defines a continuous linear functional?
This leads us to the concept of regularization: defining a generalized object, often called a distribution, that agrees with the divergent integral when it's defined, and extends it where it is not.
2. Mathematical Framework
The goal is to construct a regularization ⟨饾憮,饾湋⟩ such that it agrees with the original divergent integral when 饾湋 vanishes near the singularity.
Example: The Principal Value of \( 1/x \)
For instance, we can define: \[ \langle f, \varphi \rangle = \text{p.v.} \int_{-\infty}^{\infty} \frac{\varphi(x)}{x} \,dx = \lim_{\epsilon \to 0} \left( \int_{-\infty}^{-\epsilon} \frac{\varphi(x)}{x} \,dx + \int_{\epsilon}^{\infty} \frac{\varphi(x)}{x} \,dx \right) \] Alternatively, for any 饾憥,饾憦>0, we can define: \[ \langle f, \varphi \rangle = \int_{-\infty}^{-a} \frac{\varphi(x)}{x} \,dx + \int_{-a}^{b} (\frac{\varphi(x)- \varphi(0))}{x} \,dx + \int_{b}^{\infty} \frac{\varphi(x)}{x} \,dx \] This formulation removes the singularity at 饾懃=0 by subtracting 饾湋(0), a form of Taylor expansion-based regularization.
3. Propositions on Regularization
We summarize key results:
- Proposition 1: If 饾憮(饾懃) has a singularity of finite order at 0, it can be regularized by subtracting enough terms of the Taylor expansion of 饾湋(饾懃).
- Proposition 2: If 饾憮(0) is a regularization, any other differs from it by a distribution supported at the singularity (like a multiple of 饾浛(饾懃)).
- Proposition 3: If 饾憮(饾懃)≥F(r) grows faster than any power of 1/饾憻 as 饾憻→0, then no regularization is possible.
4. Implementing Regularization in SageMath
Let’s now put theory into practice.
Step 1: Define a Singular Function
var('x')
f(x) = 1/x
Step 2: Plot the Function
plot(f, (x, -5, -0.1), color='blue') + plot(f, (x, 0.1, 5), color='blue')
Step 3: Naive Integration Shows Divergence
# Test function
phi(x) = exp(-x^2)
integrate(f(x)*phi(x), (x, -1, 1)) # This will not converge
Step 4: Regularized Integral via Principal Value
epsilon = 0.01
I = numerical_integral(lambda x: phi(x)/x, -1, -epsilon)[0] + numerical_integral(lambda x: phi(x)/x, epsilon, 1)[0]
I
Step 5: Taylor-Subtracted Regularization
phi0 = phi(0)
phi1 = diff(phi)(0)
# Subtract Taylor expansion to second order
def regularized_integrand(x):
return (phi(x) - phi0 - phi1*x)/x
numerical_integral(regularized_integrand, -1, 1)
5. Visualizing the Regularization
To see how the Taylor subtraction affects the integrand:
g(x) = (phi(x) - phi0 - phi1*x)/x
plot(g, (x, -1, 1), ymin=-10, ymax=10)
This shows the cancellation at the singularity, enabling convergence.
6. Limitations: When Regularization Fails
If \( f(x)≥1/r^n \) near 0, regularization fails. You can simulate this with:
f(x) = 1/(x^10)
phi(x) = exp(-x^2)
numerical_integral(lambda x: phi(x)/x^10, -1, 1) # Will throw error or overflow
Example (Plot with Annotation in SageMath):
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate as spi
# Define the function f(x) = 1/x safely (vectorized)
def f(x):
return np.where(x != 0, 1/x, 0) # Avoid singularity at x=0
# Define the regularized version (Taylor-subtracted)
def regularized_f(x, epsilon):
return np.where(x != 0, 1/x - (1/epsilon), 0) # Avoid singularity at x=0
# Generate x values avoiding singularity at x = 0
x_vals = np.linspace(-2, 2, 400)
x_vals = x_vals[x_vals != 0] # Remove x=0
# Plot the original function
plt.figure(figsize=(6, 4))
plt.plot(x_vals, f(x_vals), label=r'$f(x) = \frac{1}{x}$')
plt.axvline(x=0, color='red', linestyle='--', label='Singularity at x=0')
plt.xlabel('x')
plt.ylabel('f(x)')
plt.title('Function with Singularity')
plt.legend()
plt.grid()
plt.show()
# Plot the regularized function near singularity
epsilon_vals = [0.1, 0.05, 0.01]
plt.figure(figsize=(6, 4))
for epsilon in epsilon_vals:
plt.plot(x_vals, regularized_f(x_vals, epsilon), label=f'系={epsilon}')
plt.axvline(x=0, color='red', linestyle='--', label='Singularity at x=0')
plt.xlabel('x')
plt.ylabel('Regularized f(x)')
plt.title('Regularized Function near Singularity')
plt.legend()
plt.grid()
plt.show()
# Plot the convergence behavior of the regularized integrand as 系 → 0
plt.figure(figsize=(6, 4))
epsilon_range = np.linspace(0.1, 0.001, 100)
conv_vals = [
spi.quad(lambda x: regularized_f(x, epsilon), -1, -0.01)[0] +
spi.quad(lambda x: regularized_f(x, epsilon), 0.01, 1)[0]
for epsilon in epsilon_range
]
plt.plot(epsilon_range, conv_vals, marker='o', linestyle='-', color='blue')
plt.xlabel('系')
plt.ylabel('Integral value')
plt.title('Convergence of Regularized Integrand as 系 → 0')
plt.grid()
plt.show()
Run SageMath Code Here
7. Conclusion
Regularization turns divergent expressions into well-defined distributions. SageMath enables symbolic and numerical exploration of these ideas:
- Taylor subtraction
- Principal value approximation
- Distribution theory in computation
This machinery is crucial in quantum field theory, PDEs, and beyond—anywhere singularities arise but must be tamed.
8. What’s Next?
Future blog topics could include:
- Hadamard finite part integrals
- Zeta function regularization
- Distributional Fourier transforms with SageMath
- Get link
- X
- Other Apps
Comments
Post a Comment
If you have any queries, do not hesitate to reach out.
Unsure about something? Ask away—I’m here for you!