# How to integrate the $L^2$ function $1/|x|$ numerically

Let $f=\frac{1}{|x|},x\in\mathbb{R^3}$ and $\Omega=[-b,b]^3$. How to construct a quadrature scheme to solve $$\int_\Omega f\phi\psi dx\quad ?$$ where $\phi\psi$ is smooth function.

I know there exists a transformation called Duffy transformation which can eliminate the singularity at $x=0$ by using the jacobian. Indeed, let \begin{aligned}T&=\{(x_1,x_2,x_3);0\leq x_1\leq 1,0\leq x_2\leq x_1,0\leq x_3\leq x_1\}\\ \hat{T}&=\{(\hat{x}_1,\hat{x}_2,\hat{x}_3);0\leq \hat{x}_1\leq 1,0\leq\hat{x_2}\leq1,0\leq\hat{x_3}\leq 1\}\end{aligned}

Define $F:\hat{T}\rightarrow T$ as $$F(\hat{x}_1,\hat{x}_2,\hat{x}_3)=(\hat{x}_1,\hat{x}_1\hat{x}_2,\hat{x}_1\hat{x}_3)$$ Then \begin{aligned} \int_{T}\frac{1}{|x|}\phi\psi dx&=\int_{\hat{T}}\frac{1}{\sqrt{x_1^2+x_2^2+x_3^2}}\phi\cdot\psi(x)dx =\int_{\hat{T}}\frac{\phi\cdot\psi(\hat{x_1},\hat{x}_1\hat{x}_2,\hat{x}_1\hat{x}_3)}{\sqrt{\hat{x}_1^2+\hat{x}_1^2\hat{x}_2^2+\hat{x}_1^2\hat{x}_3^2}}\hat{x}_1^2d\hat{x}\\ &=\int_\hat{T}\frac{\hat{x}_1\phi\cdot\psi(\hat{x_1},\hat{x}_1\hat{x}_2,\hat{x}_1\hat{x}_3)}{\sqrt{1+\hat{x}_2^2+\hat{x}_3^2}}d\hat{x} \end{aligned} which can be solved by usual quadrature scheme.

On the other hand, someone can also avoid the singularity by omitting a $\varepsilon$ cube which contains the origin.

However, these are not enough for me when I want to study the convergence rate of numerical integration on $\Omega$. I hope the error can be bounded by $O(h)\Vert \phi\Vert_{1,2,\Omega}\Vert \psi\Vert_{1,2,\Omega}$

Is there any other way to integrate a $L^2$ function or a function with singularity at vertex directly with the error bounded by $L^2$ norm?

Thank you very much.

• If you omit an $\varepsilon$ cube from the domain, call it $E\subset \Omega$, then using Cauchy-Schwarz the error due to this omission is bounded by $\|f\|_E \|g\|_E \le O(\varepsilon^2) \|g\|_\Omega$. Would that be sufficient for your purposes? – Igor Khavkine Oct 7 '17 at 8:43
• Sorry, I wrongly estimated the norm $\|f\|_E$ (used $L^1$ instead of $L^2$). The correct $L^2$ norm is $O(\sqrt{\varepsilon})$. – Igor Khavkine Oct 7 '17 at 8:46
• @IgorKhavkine Well... I think there is a little mistake. $O(\sqrt{\varepsilon})$ might can not be obtained by using holder inequality. – Q-Y Oct 7 '17 at 10:22
• Why not split g into $g(x)=g(0)+g(x)-g(0)$ and handle the $g(0)$ part separately? – Michael Renardy Oct 8 '17 at 14:15
• @MichaelRenardy I don't understand what's you say. Could you explain it a little bit more? – Q-Y Oct 8 '17 at 14:18

Following Michael Renardy's suggestion, write $g=\phi\psi$, and write $$g(x)=g(0)+x\cdot G(x) ,$$ where $G$ is a smooth function. Then the integral becomes $$\int_\Omega fg = g(0)\int_\Omega f + \sum_i\int_\Omega \frac{x_i}{|x|}G_i(x)d^3x .$$ The integrands in the latter integrals are bounded, and the first integral can be written as $$\int_\Omega f = \int_{B_r}f + \int_{\Omega\setminus B_r}f ,$$ where the first can be computed analytically, and the second has a smooth integrand. Here $B_r$ is some ball centred at the origin.
• Well.. I think the error of the first part $g(0)\int_\Omega f$ can still not be bounded by $\Vert\phi\Vert_2\Vert\psi\Vert_2$. Anyway, thank you very much, it gives me some ideas. – Q-Y Oct 10 '17 at 2:52
• @whereamI: Even the value of the integral itself cannot be bounded by that, because that would imply that $f$ is bounded. – timur Oct 10 '17 at 2:55
• Why do you think if the integral bounded by that then $f$ is bounded? Could you explain it a little bit more? – Q-Y Oct 10 '17 at 3:01