Green Function Example

Problem: For $x\in[0,1]$, using the method of Green functions, solve the differential equation

(1)
\begin{align} \frac{d^2\phi(x)}{dx^2} = \rho(x)\ , \end{align}

with $\rho(x)=x^2$ subject to the boundary conditions $\phi(0)=1$ and $\phi(1)=3$. These are Dirichlet boundary conditions.

We will first solve for the Dirichlet Green function, $G_D(x,x')$, which satisfies

(2)
\begin{align} \frac{d^2}{dx^2} G_D(x,x') = \delta(x-x')\ , \end{align}

subject to the boundary condition that $G_D(x,0)=G_D(x,1)=0$. Note that one can show that $G_D(x,x')=G_D(x',x)$.

Exercise: Using the one-dimensional version of Green's theorem

(3)
\begin{align} \int_0^1 dx' \left(\phi(x') \frac{d^2\psi(x')}{d{x'}^2} - \frac{d^2\phi(x')}{d{x'}^2}\psi(x)\right) = \left.\left(\phi(x') \frac{d\psi(x')}{dx'} -\frac{d\phi(x')}{dx'} \psi(x') \right)\right|_0^1\ , \end{align}

with $\psi(x')=G_D(x,x')$, show that the formal solution to the differential equation is

(4)
\begin{align} \phi(x)=\Big(\int_0^1 dx' \rho(x') G_D(x,x')\Big) + \left(\phi(x') \frac{dG_D(x,x')}{dx'}\Big|_{x'=0}^1\right)\ . \end{align}

The solution for the Green function is

(5)
\begin{align} G_D(x,x')=\begin{cases} x\ (x'-1) & \text{for }x< x' \ ,\\[4pt] (x-1)x' &\text{for } x> x'\ . \end{cases} \end{align}

The solution to the differential equation

(6)
\begin{align} \frac{d^2}{dx^2} \phi(x) = x^2\ , \end{align}

with $\phi(0)=1$ and $\phi(1)=3$ is

(7)
\begin{align} \phi(x)&= \int_0^1 dx'\ G(x,x') (x')^2 + \phi(x')\frac{d}{dx'} G(x,x')\Big|_0^1\ , \\ &= \frac1{12} (x^4-x) + \phi(0) (1-x) + \phi(1) x\ . \end{align}

which on inputting the boundary conditions becomes

(8)
\begin{align} \phi(x) = \frac1{12} (x^4+23x) + 1\ . \end{align}