# Green Function¶

## Green Functions for Second Order Equations¶

Second order differential equations can be written as

$L[y] \equiv y'' + p(x) y' + q(x) y = f(x),$

for $$a<x<b$$ with boundary conditions

$B_1[y] = B_2[y] = 0.$

The solution is

$y(x) = \int _a ^b G(x\vert \xi) f(\xi) d\xi$

where Green function is defined as

$L[G(x\vert \xi)] = \delta(x-\xi)$

with the two boundary conditions,

$B_1[G] = B_2[G] = 0.$

First order differential of Green function $$G'(x\vert \xi)$$ has a jump condition at $$x=\xi$$ that the jump discontinuity of height is 1.

### Examples¶

2nd DE,

$y''(x) = f(x), \qquad y(0)= y(1)=0.$

Then Green function for this problem is

$G''(x\vert \xi) = \delta(x-\xi), \qquad G(0\vert \xi) = G(1\vert \xi) = 0.$

We know the two solutions to the homogeneous equation, $$y=1$$ or $$y=x$$. However, only the second solution can satisfy the BC. So Green function should have these properties,

$\begin{split}G(x\vert \xi) = \begin{cases} c_1+c_2 x &\quad x<\xi \\ d_1+d_2 x & \quad x>\xi . \end{cases}\end{split}$

The BCs give us

$\begin{split}G(x\vert \xi) = \begin{cases} c x &\quad x<\xi \\ d(x-1) \quad x>\xi . \end{cases}\end{split}$

Green functon must be continuous, we have

$c\xi = d (\xi -1).$

Apply the discontinuity of the first order derivative of Green function,

$d_x d (x-1)- d_x cx = 1.$

With all these equation, we can determine the Green function,

$\begin{split}G(x\vert\xi) = \begin{cases} (\xi -1 ) x , & \qquad x<\xi \\ \xi(x-1), & \qquad x>\xi \end{cases}\end{split}$

Finally we integrate over $$\xi$$ to get the solution,

$\begin{split}y(x) &= \int_0^1 G(x\vert \xi) f(\xi) d\xi \\ & = (x-1)\int_0^x \xi f(\xi) d\xi + x \int_x^1 (\xi -1) f(\xi) d\xi .\end{split}$

This is the power of Green function.