# Singularity in Integrand

1. Jun 12, 2012

### Teg Veece

I have an equation that relates two variables:
$$k(\mathbf{x},\mathbf{x}') =exp(-(\mathbf{x}-\mathbf{x}')^2)$$
If I want to determine the value of this equation where x' is kept constant and x is actually the set of every real number then I can express the function as the integral where the integrand relates x' to the integration variable u between the interval of minus infinity to infinity:
$$f(\mathbf{x}') = \int_{-\infty}^{\infty} exp(-(\mathbf{u}-\mathbf{x}')^2) d\mathbf{u}$$
and the solution to this will be some sort of error function.

Now, a slight variation on this. I need to include an additional term that's like a weighting term which decays with distance from x. So I'm trying to find a solution for the following equation:
$$g(\mathbf{x},\mathbf{x}') = \int_{-\infty}^{\infty} \frac{exp(-(\mathbf{u}-\mathbf{x}')^2)}{|\mathbf{x}-\mathbf{u}|} d\mathbf{u}$$
The problem I'm having is that when $$\mathbf{u} = \mathbf{x},$$
then the integrand goes to infinity. I think I can get around it by possibly converting to spherical coordinates (all of vectors here are 3-D vectors) but I also need to evaluate the function, h, when x' is also integrated from minus infinity to infinity and a second weighting term is introduced:
$$h(\mathbf{x},\mathbf{x}') = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} \frac{exp(-(\mathbf{u}-\mathbf{v})^2)}{|\mathbf{x}-\mathbf{u}||\mathbf{x}'-\mathbf{v}|} d\mathbf{u}d\mathbf{v},$$
and here the spherical coordinate approach doesn't seem to help.

How do I deal with this singularity? Someone suggested complex analysis but I'm not very familiar with that area.
Any suggestions would be greatly appreciated. I can post how I evaluate g(.,.) using spherical coordinates if people think it'd help.

2. Jun 12, 2012

### chiro

Hey Teg Veece and welcome to the forums.

One suggestion is to use a distance metric plus a constant. So instead of |x-u| you scale it by say |x-u|+c where c is a preferrably positive number (unless you want the behaviour of a negative). Something like c = 1 seems like a good initial one to try.

3. Jun 12, 2012

### Teg Veece

$$\Phi(\mathbf{x}) = -G \int \frac{\rho(\mathbf{x}')}{|\mathbf{x}-\mathbf{x}'|}d \mathbf{x}'$$