# Using GreenFunction in 2D free space for Laplacian

V 12. on windows.

I have a question about using Mathematica's GreenFunction to verify known result for Green function for Laplacian in 2D. (I also have question for 3D, but may be I'll post that in separate question)

In 2D, Green function is given in many places. Here is a screen shot from one book

I was trying to see if I can get same result using Mathematica's Green function.

At first I tried this (below, I used y1,y2 in place of $$\zeta,\eta$$ since easier to type

ClearAll[u, x, y, y1, y2];
GreenFunction[Laplacian[u[x, y], {x, y}],
u[x, y], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}, {y1,y2}]


But Mathematica did not like it because of {y, -Infinity, Infinity}. So I found this below works

GreenFunction[Laplacian[u[x, y], {x, y}], u[x, y], {x, -Infinity, Infinity}, y, {y1, y2}]


But this does not look like the known result $$-\frac{1}{2 \pi} \ln r$$ where $$r=\sqrt{ (x-y_1)^2 + (y-y_2)^2}$$.

So I am not sure if the second try above is still not correct, or if there is another syntax I should try. How to tell it one wants the Green function for the whole space in 2D then?

Question is: How to use GreenFunction to obtain same result shown in book for 2D?

• This should work: GreenFunction[-Laplacian[u[x, y], {x, y}], u[x, y], {x, y} ∈ FullRegion[2], {ξ, η}]. – J. M.'s discontentment Nov 15 '19 at 6:36
• @J.M.willbebacksoon thanks. If you like to post this as answer will be happy to accept it. – Nasser Nov 15 '19 at 6:58
• If you don't mind waiting a bit, I'll write something up. – J. M.'s discontentment Nov 15 '19 at 6:59
• @J. M. will be back soon It's nice. However this GreenFunction[-Laplacian[u[x, y], {x, y}] + q*Grad[Div[u[x, y], {x, y}], {x, y}], u[x, y], {x, y} \[Element] FullRegion[2], {\[Xi], \[Eta]}] does not work with your trick. This is the Green function in 2D theory of elasticity. q is a factor expressed in terms of the Poisson's coefficient. Any ideas? – Alexei Boulbitch Nov 15 '19 at 8:20
• @Alexei, Div[u[x, y], {x, y}] isn't supposed to work since you're not applying Div[] to a vector-valued function. In any event, perhaps this should be a new question. – J. M.'s discontentment Nov 15 '19 at 8:34

As I mentioned in a comment, the following (almost) reproduces the textbook result:

GreenFunction[-Laplacian[u[x, y], {x, y}], u[x, y], {x, y} ∈ FullRegion[2], {ξ, η}]
-Log[(y - η)^2 + (x - ξ)^2]/(4 π)


where the identity $$\log(\sqrt{x})=\frac12\log x$$ was automatically applied. (This specific example is also in the docs.)

Similarly, for the 2D Helmholtz operator,

GreenFunction[-(Laplacian[u[x, y], {x, y}] + u[x, y]), u[x, y],
{x, y} ∈ FullRegion[2], {ξ, η}]
-1/4 I HankelH2[0, Sqrt[(y - η)^2 + (x - ξ)^2]]


For three dimensions the Poisson equation evaluates,

GreenFunction[-Laplacian[u[x, y, z], {x, y, z}], u[x, y, z],
{x, y, z} ∈ FullRegion[3], {ξ, η, ζ}]
1/(4 π Sqrt[(z - ζ)^2 + (y - η)^2 + (x - ξ)^2])


but the 3D Helmholtz operator does not (perhaps GreenFunction[] has not yet been taught how to evaluate it).