7 Greens functions
One of the most important applications of the -function is as a means to develop a sys-
tematic theory of Greens functions for ODEs. Consider a general linear secondorder
differential operator L on [a, b] (which may be , respectively). We write
d2 d
Ly(x) = (x) 2
y + (x) y + (x)y = f (x) , (7.1)
dx dx
where , , are continuous functions on [a, b], and is nonzero (except perhaps at a
finite number of isolated points). We also require the forcing term f (x) to be bounded in
[a, b]. We now define the Greens function G(x; ) of L to be the unique solution to the
problem
LG = (x ) (7.2)
that satisfies homogeneous boundary conditions28 G(a; ) = G(b; ) = 0.
The importance of the Greens function comes from the fact that, given our solution
G(x, ) to equation (7.2), we can immediately solve the more general problem Ly(x) = f (x)
of (7.1) for an arbitrary forcing term f (x) by writing
! b
y(x) = G(x; ) f () d . (7.3)
a
To see that it does indeed solve (7.1), we compute
"! b # ! b
Ly(x) = L G(x, ) f () d = [LG(x, )] f () d
a a
! b
(7.4)
= (x ) f () d = f (x) ,
a
since the Greens function is the only thing that depends on x. We also note that the
solution (7.3) constructed this way obeys y(a) = y(b) = 0 as a direct consequence of these
conditions on the Greens function.
The important point is that G depends on L, but not on the forcing term f (x). Once
G is known, we will be able write down the solution to Ly = f for an arbitrary force
term. To put this differently, asking for a solution to the differential equation Ly =
f is asking to invert the differential operator L, and we might formally write y(x) =
L1 f (x). Equation (7.3) shows what is meant by the inverse of the differential operator L
is integration with the Greens function as the integral kernel.
7.1 Construction of the Greens function
We now give a constructive means for determining the Greens function. (Well see later
how this compares to the eigenfunction expansion for inverting SturmLiouville operators
that we gave in 2.6.)
28
Other homogeneous boundary conditions are also possible, but for clarity will will treat only the simplest
case G(a, ) = G(b, ) = 0 here.
83
Our construction relies on the fact that whenever x #= , LG = 0. Thus, both for
x < and x > we can express G in terms of solutions of the homogeneous equation. Let
us suppose that {y1 , y2 } are a basis of linearly independent solutions to the secondorder
homogeneous problem Ly = 0 on [a, b]. We define this basis by requiring that y1 (a) = 0
whereas y2 (b) = 0. That is, each of y1,2 obeys one of the homogeneous boundary conditions.
On [a, ) the Greens function obeys LG = 0 and G(a, ) = 0. But any homogeneous
solution to Ly = 0 obeying y(a) = 0 must be proportional to y1 (x), with a proportionality
constant that is independent of x. Thus we set
G(x, ) = A() y1 (x) for x [a, ) . (7.5)
Similarly, on (, b] the Greens function must be proportional to y2 (x) and so we set
G(x, ) = B() y2 (x) for x 9, b] . (7.6)
Note that the coefficient functions A() and B() may depend on the point , but must be
independent of x.
This construction gives us families of Greens function for x [a, b] {}, in terms
of the functions A and B. We must now determine how these two solutions are to be
joined together at x = . Suppose first that G(x, ) was discontinuous at x = , with
the discontinuity modelled by a step function. Then x G (x ) and consequently
x2 G " (x). However, the form of equation (7.2) shows that LG involves no generalized
functions beyond (x ), and in particular contains no derivatives of -functions. Thus
we conclude that G(x, ) must be continuous throughout [a, b] and in particular at x = .
However, integrating equation (7.2) over an infinitesimal neighbourhood of x = we
learn that
! +" " # ! +"
2G G
(x) 2 dx + (x) dx + (x)G dx = (x ) dx = 1 . (7.7)
" x x "
We have already seen that G(x, ) is continuous, and all three coefficient functions , ,
are bounded by assumption, so the final term on the lhs contributes zero as we make the
integration region infinitesimally thin. Also, since G is continuous, x G must be bounded
so the term x G also cannot contribute as the integration region shrinks to zero size.
Finally, since is continuous we have
! +" $ % % &
2G G %% G %%
lim (x) 2 dx = () . (7.8)
"0+ " x x %x=+ x %x=
To summarize, we must glue the Greens functions (7.5) & (7.6) according to the conditions
G(x, )|x= = G(x, )|x=+ continuity
% %
%
G % G %% 1 (7.9)
% % = jump in derivative.
x x= x x= ()
In terms of (7.5) & (7.6) these conditions become
1
A() y1 () = B() y2 () and A() y1" () B() y2" () = . (7.10)
()
84
These are two linear equations for A and B, determining them to be
y2 () y1 ()
A() = and B() = , (7.11)
()W () ()W ()
where
W (x) y1 y2" y2 y1" (7.12)
is known as the Wronskian of y1 and y2 . Note that the Wronskian is evaluated at x = in
equation (7.11).
To conclude, we have found that the solution G(x, ) of LG = (x) obeying G(a, ) =
G(b, ) = 0 is given by
y1 (x)y2 ()
ax<
()W ()
G(x; ) =
y (x)y1 ()
2 <xb (7.13)
()W ()
1
= [( x) y1 (x)y2 () + (x ) y2 (x)y1 ()]
()W ()
where is again the step function. Hence the solution to Ly = f is
! b
y(x) = G(x; ) f () d
a
! x ! b (7.14)
y1 () y2 ()
= y2 (x) f () d + y1 (x) f () d .
a ()W () x ()W ()
+x +b
The integral over here is separated at x into two parts, (i) a and (ii) x . In the range
of (i) we have < x so the second line of equation (7.13) for G(x; ) applies, even though
this expression incorporates the boundary condition at x = b. For (ii) we have x > so
we use the G(x; ) expression from the first line of equation (7.13) that incorporates the
boundary condition at x = a.
As an example of the use of Greens functions, suppose we wish to solve the forced
problem
Ly = y "" y = f (x) (7.15)
on the interval [0, 1], subject to the boundary conditions y(0) = y(1) = 0. We follow our
procedure above. The general homogeneous solution is c1 sin x + c2 cos x so we can take
y1 (x) = sin x and y2 (x) = sin(1 x) as our homogeneous solutions satisfying the boundary
conditions at x = 0 and x = 1, respectively. Then
,
A() sin x 0x<
G(x; ) = (7.16)
B() sin(1 x) < x 1.
Applying the continuity condition we get
A sin = B sin(1 ) (7.17)
85
while the jump condition gives
B( cos(1 )) A cos = 1 . (7.18)
where we note that = 1. Solving these two equations for A and B gives the Greens
function
1
G(x; ) = [( x) sin(1 ) sin x + (x ) sin(1 x) sin ] (7.19)
sin 1
Using this Greens function we are immediately able to write down the complete solution
to y "" y = f (x) with y(0) = y(1) = 0 as
! !
sin(1 x) x sin x 1
y(x) = f () sin d + f () sin(1 ) d. (7.20)
sin 1 0 sin 1 x
where again only the second term for G in (7.19) contributes in the first integration region
where > x, while only the first term for G contributes to the integral over the region
< x.
7.2 Physical interpretation of the Greens function
We can think of the expression
! b
y(x) = G(x; ) f () d (7.21)
a
as a summation (or integral) of individual point source effects, each of strength f (), with
G(x; ) describing the effect at x of a unit point source placed at .
To illustrate this with a physical example, consider again the wave equation for a
horizontal elastic string with ends fixed at x = 0, L. If y(x, t) represents the small vertical
displacement transverse to the string, we found that T x2 y = t2 y. Also including the
effect of gravity acting in the vertical direction leads to
2y 2y
T g = (7.22)
x2 t2
for x [0, L] with y(0) = y(L) = 0. Here, T is the constant tension in the string and is
the mass density per unit length, which may vary with x.
When the string is at rest, its profile obeys the steady state equation
2y (x)g
= , (7.23)
x2 T
whose solution describes the shape of a (nonuniform) string hanging under gravity. Well
be interested in these steady state solutions. We consider three cases. Firstly, suppose is
a (nonzero) constant then equation (7.23) is easily integrated and we find the parabolic
shape
g
y(x) = x(x L) . (7.24)
2T
that obeys y(0) = y(L) = 0.
86
In the second case, suppose instead that the string itself is very light, but that it has a
metal bead attached at a point x = . We treat the bead as a point mass m, and assume
it is not too heavy. To find its location, let 1 and 2 be the angles the string makes on
either side of the bead. Resolving forces vertically, the equilibrium condition is
mg = T (sin 1 + sin 2 ) T (tan 1 + tan 2 ) (7.25)
where the small angle approximation sin tan will hold provided the mass m is suffi-
ciently small. (Note also that y < 0 since the bead pulls the string down.) Thus the point
mass is located at (x, y) = (, y()) where
mg ( L)
y() = . (7.26)
T L
Since the string is effectively massless on either side of the bead, gravity does not act there,
so the only force felt by the string at x #= is the (tangential) tension. Thus the string
must be straight either side of the point mass and so
x( L)
mg L
for 0 x < ,
y(x) = (7.27)
T (x L)
for < x L
L
gives the steadystate shape of this string.
We obtained this answer from physical principles; lets now rederive it using the Greens
function. For the case of a point mass at x = , we take the mass density to be (x) =
m (x ) so that the steadystate equation becomes
2y mg
2
= (x ) . (7.28)
x T
The differential operator 2 /x2 is a (very simple) selfadjoint operator and the rhs is a
forcing term. We look for a Greens function G(x, ) that obeys
2G
= (x ) (7.29)
x2
subject to the boundary conditions G(0, ) = G(L, ) = 0. Following our usual procedure,
we have the general solutions
G(x, ) = A()x + B() when 0 x < ,
(7.30)
G(x, ) = C()(1 x) + D() when < x L
on either side of the point mass. The boundary conditions at 0 and L enforce B() =
D() = 0, and continuity (the string does not break!) at x = fixed C() = A()/( L).
Finally, the jump condition on the derivative (with = 1) gives A() = ( L)/L. Thus
our Greens function is
x( L)
for 0 x < ,
G(x, ) = L (7.31)
(x L)
for < x L.
L
87
Rescaling this Greens function by mg/T gives exact agreement with the string profile
in (7.27).
For our final case, we now imagine that we have several point masses mi at positions
xi [0, L]. We can simply sum the solutions to obtain
- mi g
y(x) = G(x, xi ) . (7.32)
T
i
To take the continuum limit we can imagine there are a large number of masses mi placed
at equal intervals xi = iL/N along the string, with i {1, 2, . . . , N 1}. Setting mi =
(i ) where i = i = iL/N , then by Riemanns definition of integrals, as N
equation (7.32) becomes
! L
g ()
y(x) = G(x, ) d . (7.33)
0 T
If is constant this function reproduces the parabolic result of case 1, as you should check
by direct integration. (Exercise! take care with the limits of integration.)
7.3 Greens functions for inhomogeneous boundary conditions
Our construction of the solution to the forced problem relied on the Greens function
obeying homogeneous boundary conditions. This is because the integral in equation (7.3)
represents a continuous superposition of solutions for individual values of . In order to
treat problems with inhomogeneous boundary conditions using Greens functions, we must
proceed as follows.
First, find any particular solution yp (x) to the homogeneous equation Ly = 0 that
satisfies the inhomgeneous boundary conditions. This step is usually easy because were
not looking for the most general solution, just any simple solution. Since the differential
operator L is linear, the general solution of Ly = f obeying inhomogeneous boundary
conditions is simply
! b
y(x) = yp (x) + G(x, ) f () d , (7.34)
a
where the term involving the Greens function ensures that Ly indeed equals the forcing
term f (x), but does not disturb the boundary values.
As an example, suppose again we wish to solve y "" y = f (x), but now with inhomo-
geneous boundary conditions y(0) = 0 and y(1) = 1. We already have the Greens function
solution to the homogeneous problem in (7.20), so we simply need to find a solution to
the homogeneous equation y "" y = 0 that obeys the boundary conditions. The general
solution of this homogeneous equation c1 cos x + c2 sin x and the inhomogeneous boundary
conditions require c1 = 0 and c2 = 1/ sin 1. Therefore yp (x) = sin x/ sin 1 is the desired
particular solution and the general solution is
! !
sin x sin(1 x) x sin x 1
y(x) = + f () sin d + f () sin(1 ) d (7.35)
sin 1 sin 1 0 sin 1 x
using the result (7.20).
88
7.4 Equivalence of eigenfunction expansion of G(x; )
For selfadjoint differential operators, we have now discovered two different expressions for
the Greens function with homogeneous boundary conditions. On the one hand, we have
1
G(x, ) = [( x) y1 (x)y2 () + (x ) y2 (x)y1 ()] (7.36)
()W ()
as in equation (7.13). On the other hand, in section 2.6 we showed that the Greens function
for a selfadjoint operator could be written as
- 1
G(x, ) = Yn (x) Yn () (7.37)
n
n=1
in terms of the eigenfunctions {Yn (x)} and eigenvalues {n } of the SturmLiouville oper-
ator.
Incidentally, we derived (7.37) in section 2.6 without any mention of -functions, but
it may also be quickly derived using the eigenfunction expansion
-
(x ) = w(x) Yn (x) Yn () (7.38)
nZ
as in equation (6.42). Viewing as a parameter we can write an eigenfunction expansion
of the Greens function as -
G(x, ) = Gn () Yn (x) . (7.39)
nZ
Applying the selfadjoint operator L we have
- -
LG = Gn () LYn (x) = w(x) Gn () n Yn (x) (7.40)
nZ nZ
and for this to agree with (x ), so that the expansion (7.39) obeys the defining equation
LG = (x ) for the Greens function, we need
1
Gn () = Y () (7.41)
n n
.
as can be checked by multiplying both sides of w(x) nZ Gn () n Yn (x) = (x ) by
Ym (x), integrating from a to b and using the orthogonality of the SturmLiouville eigenfunc-
tions with weight function w. Thus we have recovered the eigenfunction expansion (7.37)
of the Greens function. Note that the expression (7.37) requires that all eigenvalues n be
nonzero. This means that the homogeneous equation Ly = 0 which is the eigenfunction
equation when = 0 should have no nontrivial solutions satisfying the boundary con-
ditions. The existence of such solutions would certainly be problematic for the concept of
a Greens function: If such solutions exist, then the inhomogeneous equation Ly = f does
not have a unique solution, because if y is any solution then so too is y + y0 . The operator
L is thus not invertible, and the Greens function cannot exist. This is just the infinite
89
dimensional analogue of the familiar situation of a system of linear equations M u = f with
noninvertible coefficient matrix M. Indeed a matrix is noninvertible iff it has nontrivial
eigenvectors with eigenvalue zero.
Since the Greens function is the unique solution to LG(x, ) = (x ) that obeys
G(a, ) = G(b, ) = 0, it must be that the two expressions (7.36) and (7.37) are the same.
To see that this is true, we first notice that for a selfadjoint operator (in SturmLiouville
form) the first two coefficient functions in
2
L = (x) 2
+ (x) + (x)
x x
are related by = d/dx. In this case, the denominator ()W () in equation (??) for
the Greens function is necessarily a (nonzero) constant. To show this, note that
d
(W ) = " W + W = (y1 y2" y2 y1" ) + (y1 y2"" y2 y1"" )
dx (7.42)
= y1 Ly2 y2 Ly1 = 0 .
Being constant, (x)W (x) is independent of where we evaluate it and in particular is
independent of . We thus set (x)W (x) = c and rewrite equation (7.36) as
1
G(x, ) = [( x) y1 (x)y2 () + (x ) y2 (x)y1 ()] . (7.43)
c
Like the eigenfunction expansion, this expression is now symmetric under exchange of x
and , so that G(x; ) = G(; x).
Going further in general requires a rather tedious procedure of expanding the step
functions and solutions y1 (x) and y2 (x) (which we recall obey y1 (a) = y2 (b) = 0) in terms
of the eigenfunctions. Instead, well content ourselves with an example and for lack of
imagination we again take Ly = y "" y on [a, b] = [0, 1], with boundary conditions
y(0) = y(1) = 0. The normalized eigenfunctions and corresponding eigenvalues are easily
calculated to be
Yn (x) = 2 sin nx with n = n2 2 1 (7.44)
and the Greens function is given in terms of these eigenfunctions by
- sin nx sin n
G(x, ) = 2 . (7.45)
n2 2 1
n=1
On the other hand, in a previous example we constructed the expression
1
G(x, ) = [(x ) sin(1 x) sin + ( x) sin x sin(1 )] (7.46)
sin 1
using homogeneous solutions. Standard trigonometric addition formul for sin(1x) allow
us to write this as
G(x, ) = (x ) cos x sin + ( x) sin x cos cot 1 sin x sin . (7.47)
90
Viewing x as the independent variable and as a parameter, we expand this function as a
Fourier sine series
-
(x ) cos x sin + ( x) sin x cos cot 1 sin x sin = gn () sin nx . (7.48)
n=1
As usual, the Fourier coefficients are given by
! 1
gn () = 2 sin nx [(x ) cos x sin + ( x) sin x cos cot 1 sin x sin ] dx
0
(7.49)
and a direct (though rather tedious calculation try it as an exercise if you really must)
gives
2 sin n
gn () = 2 2 . (7.50)
n 1
Comparing this to the eigenfunction expansion (7.45) we see that the two expressions for
the Greens function agree, as expected.
7.5 Application of Greens functions to initial value problems
Greens functions can also be used to solve initial value problems. Lets take the indepen-
dent variable to be time t, and suppose we wish to find the function y : [a, ) R that
obeys the differential equation
Ly = f (t) (7.51)
subject to the initial conditions y(a) = 0 and y " (a) = 0. The method for construction of
the Greens function in this initial value problem is similar to the previous method in the
case of a boundary value problem. As before, we want to find G such that LG = (t ), so
that for each value of , the Greens function G(t, ) will solve the homogeneous equation
LG = 0 whenever t #= . We proceed as follows
Construct G for a t < as a general solution of the homogeneous equation,
so G = Ay1 (t) + By2 (t). Here {y1 (t), y2 (t)} is any basis of linearly independent
homogeneous solutions.
In contrast to the boundary value problem, we now apply both initial conditions to
this solution. That is, we enforce
Ay1 (a) + By2 (a) = 0 ,
(7.52)
Ay1" (a) + By2" (a) = 0 .
This pair of linear equations for A and B can be written as
/ 0
y1 (a) y2 (a)
=0 (7.53)
y1" (a) y2" (a)
and since y1 and y2 are linearly independent, the determinant of this matrix (the
Wronskian) is non-zero. Thus the only way to impose both initial conditions is to set
A = B = 0. This implies that G(t, ) = 0 identically whenever t [a, )!
91
For t > , again construct the Greens function as a general solution of the homoge-
neous equation, so G = Cy1 (t) + Dy2 (t).
Finally, we apply the continuity and jump conditions at t = . Since G = 0 for t <
we obtain
Cy1 ( ) + Dy2 ( ) = 0
1 (7.54)
Cy1" ( ) + Dy2" ( ) =
( )
where, as usual, (t) is the coefficient of the second derivative in the differential
operator L. These simultaneous equations determine C( ) and D( ), thus completing
the construction of the Greens function G(t; ).
We can again use our Greens function to solve the forced problem (7.51) as
! b ! t
y(t) = G(t, ) f ( ) d = G(t, ) f ( ) d . (7.55)
a a
Here, in the second equality we have used the fact that G(t, ) vanishes for > t. This
equation shows that the solution obeys a causality condition: the value of y at time t
depends only on the behaviour of the forcing function for earlier times [a, t].
As an example, consider the problem
d2 y
+ y = f (t), y(0) = y " (0) = 0 (7.56)
dt2
with initial conditions y(0) = y " (0) = 0. Following our procedure above we get
G(t, ) = (t ) [C( ) cos(t ) + D( ) sin(t )] , (7.57)
where weve chosen the basis of linearly independent solutions to be {cos(t ), sin(t )}
purely because they make it easy to impose the initial conditions. Continuity demands
that G(, ) = 0, so C( ) = 0. The jump condition (with ( ) = 1 then enforces D( ) = 1.
Therefore, the Greens function is
G(t, ) = (t ) sin(t ) (7.58)
and the general solution to Ly = f (t) obeying y(0) = y " (0) = 0 is
! t
y(t) = sin(t ) f ( ) d . (7.59)
0
Again, we see that this solution knows about what the forcing function was doing only at
earlier times.
92
7.6 Higher order differential operators
We briefly mention that there is a natural generalization of Greens functions to higher
order differential operators (and indeed to PDEs, as we shall see in the last part of the
course). If L is a nth -order ODE on [a, b], with n > 2 then the general solution to the
forced differential equation Ly = f (x) obeying the homogeneous boundary conditions
y(a) = y(b) = 0 is again given by
! b
y(x) = G(x; ) f () d , (7.60)
a
where G still obeys LG = (x ) subject to homogeneous boundary conditions G(a, ) =
G(b, ) = 0, but where now both G and its first n 2 derivatives are continuous at x = ,
while % %
(n1) G %% (n1) G %% 1
% % = (7.61)
x (n1) % + x (n1) % ()
x=x x=x
where we again assume that (x) is the coefficient function of the highest derivative in L.
An example can be found on problem sheet 3.
93