Green's Functions Explained

General Idea

Suppose you want to find f(x)f(x) that satisfies some linear, differential equation

Lf(x)=u(x),L\,f(x) = u(x),

where LL is a linear differential operator and u(x)u(x) some given function (the inhomogeneous term of the differential equation). The Green's function G(x,x0)G(x, x_0) can help you find the solution. GG is a function of two variables, and it satisfies the equation

LG(x,x0)=δ(xx0).L\,G(x, x_0) = \delta(x - x_0).

If you happen find G(x,x0)G(x, x_0), then you can multiply this equation by u(x0)u(x_0) and integrate over x0x_0:

dx0LG(x,x0)u(x0)=dx0δ(xx0)u(x0). \int dx_0\,L\,G(x, x_0) u(x_0) = \int dx_0\,\delta(x-x_0)u(x_0).

Rearrange the terms and you end up with

Ldx0G(x,x0)u(x0)=u(x). L \int dx_0 G(x, x_0) u(x_0) = u(x).

This solves your initial problem, because you can identify

f(x)=dx0G(x,x0)u(x0).f(x) = \int dx_0 G(x, x_0) u(x_0).

In the real world, you often deal with differential equations that have boundary conditions, for instance the electric potential must be 0 on the boundary. Green's functions are a great tool for these problems, because if the Green's function is 0 on the boundary, then any integral over Green's functions will also be 0 on the boundary. Conceptually, this is very similar to finding the image charge for any single charge within your boundary.

Completely Useless Example

Typical problem in electrostatics: Point charge in vacuum. (I left out all units). I'm including this because I first made a mistake when assigning a name to the location of the point charge. You must not name this x0x_0 and then integrate over x0x_0!

ΔΦ(x)=ρ(x)=14πδ(xxp) \Delta \Phi(x) = \rho(x) = -\frac{1}{4\pi} \delta(x - x_p)

Everyone "knows" that the solution is

Φ(x)=1xxp \Phi(x) = \frac{1}{\|x - x_p\|}.

To find it with Green's function: Solve

ΔG(x,x0)=δ(xx0) \Delta G(x,x_0) = \delta(x - x_0)

Obviously, we know

G(x,x0)=1xx0.G(x,x_0) = \frac{1}{\|x - x_0\|}.

To find the solution, calculate

Φ(x)=dx0G(x,x0)ρ(x0)=dx0δ(xx0)14πδ(x0xp)=1xxp\Phi(x) = \int dx_0 G(x, x_0) \rho(x_0)\\ = \int dx_0 \delta(x - x_0) \frac{-1}{4\pi} \delta(x_0 - x_p)\\ = \frac{1}{\|x - x_p\|}

Simple, useful example: Undamped, harmonic oscillator

Consider the harmonic oscillator forced by a function u(x)u(x):

f(x)+ω2f(x)=u(x)L=d2dx2+ω2f''(x) + \omega^2 f(x) = u(x)\\ \Rightarrow L = \frac{d^2}{dx^2} + \omega^2

So we are looking for a function G(x,x0)G(x, x_0) that satisfies

LG(x,x0)=δ(xx0). L\,G(x,x_0) = \delta(x-x_0)\quad.

The corresponding physics case to this equation is a harmonic oscillator that is "bumped" at x=x0x = x_0. One solution that should work is

G(x,x0)={0if x<x0Asin(ωxωx0)if xx0 G(x, x_0) = \begin{cases} 0 &\text{if } x < x_0 \\ A \sin(\omega x - \omega x_0) &\text{if } x \geq x_0 \end{cases}

Or, using the Heaviside step function Θ(x)\Theta(x), which I find easier to handle when doing derivatives:

G(x,x0)=AΘ(xx0)sin(ωxωx0) G(x,x_0) = A\,\Theta(x-x_0)\, \sin(\omega x - \omega x_0)

We can prove that this is the right equation by showing that it holds true for x<x0x < x_0 (trivial), for x>x0x > x_0 (almost as trivial), and for:

x0ax0+a ⁣G(x,x0)dx=1a. \int_{x_0 - a}^{x_0+a}\! G(x, x_0)\,dx = 1 \quad \forall \, a \quad .

The last part is the only one that is a bit tricky, but you can quickly work out that the second derivative of Θ(x)sin(x)\Theta(x) \sin(x) is basically δ(x)\delta(x). In our case, the factor AA works out to A=1/ωA = 1/\omega.

It is quite easy to go to the damped harmonic oscillator from here. Just ask yourself "What does my system do when I poke it at x=x0x = x_0 with a δ\delta-pulse?", use that as a guess for G(x,x0)G(x,x_0), and find the factor AA of the solution.