# Green's Function and integral

Gold Member

## Homework Statement

Find the green's function for y'' +2y' +2y = 0 with boundary conditions y(0)=y'(0)=0
and use it to solve y'' + 2y' +2y = e^(-2x)

## Homework Equations

##y = \int_a^b G(x,z)f(z)dz##

## The Attempt at a Solution

I'm going to rush through the first bit. If you need a specific step, I can include it later, but I think a lot of the early steps are pretty self-explanatory.
##\lambda^2 +2\lambda + 2 = 0 \to \lambda = -1 \pm i##
##G' = 1##
##G(x,z) = \left\{ \begin{array}{ll}
Ae^{-(1-i)x} + Be^{-(1+i)x} & z<x \\
Ce^{-(1-i)x} + De^{-(1+i)x} & x<z
\end{array} \right. ##
##y(0)= 0 \to A=-B##
##y'(0)=0 \to -(1-i)A = B(1+i) \to A=B=0##
Continuity:
##Ce^{-(1-i)z} + De^{-(1+i)z} = 0 \to C = -De^{-1+i)z}e^{(1-i)z} = -De^{2iz}##
##-(1-i)Ce^{-(1-i)z} -(1+i)De^{-(1+i)z} = 1 \to (1-i)De^{2iz}e^{-(1-i)z} -(1+i)De^{-(1+i)z} = 1##
##1= D[(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}]=1##
##D = \frac{1}{(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}} ##& ##C=\frac{-e^{-2iz}}{(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}}##

Which leaves us with

##G(x,z) = \left\{ \begin{array}{ll}
0 & z<x \\
\frac{-e^{-(2iz)}e^{-(1-i)x} + e^{-(1+i)x}}{(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}} & x<z
\end{array} \right. ##

Assuming this is correct thus far, I am not sure how to get y.
I'm thinking that the limits of my integral should be from 0 to infinity, but G is zero from 0 to x, so really we need to integrate from x to infinity.
I let wolfram do some simplification for me and we have:
##(\frac{1}{2} + \frac{i}{2} )\int_x^\infty \frac{e^{-(1+i)z} +e^{2iz}}{e^{2iz}-i}##
Which I am not quite sure how to evaluate. It looks like it should converge to a value, since the numerator is "smaller" than the denominator (break it up into 2 terms, and you have [e^-stuff/ e^+things] + [e^stuff/e^stuff + i]) Is there a simple way to evaluate this? Wolfram exceeds computation time.

Last edited:

## Answers and Replies

vela
Staff Emeritus
Science Advisor
Homework Helper
Education Advisor
One thing you can do to simplify your calculations is to write the homogeneous solution as ##e^{-x}(A \cos x + B \sin x)##. The Green's function I get is ##G(x,z) = e^{-(t-z)}\sin(t-z)##. Note the symmetry between x and z. That's typical of a Green's function.

I don't think you meant for ##G## to be a function of ##y##, did you? ##y## is the solution to the differential equation.

To get ##y##, you multiply ##G## by ##f(z) = e^{-2z}## and integrate.

Gold Member
Do I integrate from 0 to infinity, though? No, that is a typo, should be G(x,z). My book actually doesn't say much about the limits.
Riley Hobson & Bense said:
Let us suppose that a function G(x, z) (the Green’s function) exists such that the
general solution to (15.59), which obeys some set of imposed boundary conditions
in the range a ≤ x ≤ b, is given by
##y(x) = \int_a^b G(x,z)f(z)dz##
where z is the integration variable.
[...shows how to solve for G...]
In addition to (15.62), we must impose two further sets of restrictions on
G(x, z). The first is the requirement that the general solution y(x) in (15.60) obeys
the boundary conditions. For homogeneous boundary conditions, in which y(x)
and/or its derivatives are required to be zero at specified points, this is most
simply arranged by demanding that G(x, z) itself obeys the boundary conditions
when it is considered as a function of x alone; if, for example, we require
y(a) = y(b) = 0 then we should also demand G(a, z) = G(b, z) = 0. Problems
having inhomogeneous boundary conditions are discussed at the end of this
subsection.

Gold Member
I'm not seeing how you arrived at such a simple explanation.
Using the homogeneous boundaries, we get A=B=0
Using continuity of G we get
##C=-Dtan(z)##
Using discontinuity of G'
##e^{-z}[-(Ccos(z) + Dsin(z)) + Dcos(z)-Csin(z))] = 1##
##e^{-z}[-2Dsin(z) +Dcos(Z)-Dsin(z)tan(z)] = 1##
##e^z = D(-2sin(z)+cos(z)- sin^2(z)/cos(z))##
##D= \frac{e^z}{cos(z) - 2sin(z) - \frac{sin^2(z)}{cos(z)}} = \frac{e^z}{cos^2(z) - sin^2(z) - 2sin(z)cos(z)} = \frac{e^zcos(z)}{cos(2z)-sin(2z)}##
##C=\frac{-e^zsin(z)}{cos(2z)-sin(2z)}##
##G = \frac{e^{z-x}(cos(z)sin(x)-sin(z)cos(x))}{cos(2z)-sin(2z)}##
which can be simplified down to
##\frac{e^{z-x}sin(x-z)}{cos(2z)-sin(2z)}## or ##\frac{e^{-(x-z)}sin(x-z)}{cos(2z)-sin(2z)}##
This is pretty close to what you have, but I'm not sure what happened to your denominator.

Gold Member
I found a - sign error in my work. I subbed in C = Dtan(z) instead of -Dtan(z). I now have the same greens function as you, which I should be able to integrate. We shall see =D.

Gold Member
So I got -1/2e^-2x, however, shouldn't I have 2 linearly independent solutions?

vela
Staff Emeritus
Science Advisor
Homework Helper
Education Advisor
No, you're finding the particular solution. After all, the result you get depends of f(x).

Never mind. This is at best misleading.

Last edited:
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed

## Homework Statement

Find the green's function for y'' +2y' +2y = 0 with boundary conditions y(0)=y'(0)=0
and use it to solve y'' + 2y' +2y = e^(-2x)

## Homework Equations

##y = \int_a^b G(x,z)f(z)dz##

## The Attempt at a Solution

I'm going to rush through the first bit. If you need a specific step, I can include it later, but I think a lot of the early steps are pretty self-explanatory.
##\lambda^2 +2\lambda + 2 = 0 \to \lambda = -1 \pm i##
##G' = 1##
##G(x,z) = \left\{ \begin{array}{ll}
Ae^{-(1-i)x} + Be^{-(1+i)x} & z<x \\
Ce^{-(1-i)x} + De^{-(1+i)x} & x<z
\end{array} \right. ##
##y(0)= 0 \to A=-B##
##y'(0)=0 \to -(1-i)A = B(1+i) \to A=B=0##
Continuity:
##Ce^{-(1-i)z} + De^{-(1+i)z} = 0 \to C = -De^{-1+i)z}e^{(1-i)z} = -De^{2iz}##
##-(1-i)Ce^{-(1-i)z} -(1+i)De^{-(1+i)z} = 1 \to (1-i)De^{2iz}e^{-(1-i)z} -(1+i)De^{-(1+i)z} = 1##
##1= D[(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}]=1##
##D = \frac{1}{(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}} ##& ##C=\frac{-e^{-2iz}}{(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}}##

Which leaves us with

##G(x,z) = \left\{ \begin{array}{ll}
0 & z<x \\
\frac{-e^{-(2iz)}e^{-(1-i)x} + e^{-(1+i)x}}{(1-i)e^{(-1+i)z} - (1+i)e^{-(1+i)z}} & x<z
\end{array} \right. ##

Assuming this is correct thus far, I am not sure how to get y.
I'm thinking that the limits of my integral should be from 0 to infinity, but G is zero from 0 to x, so really we need to integrate from x to infinity.
I let wolfram do some simplification for me and we have:
##(\frac{1}{2} + \frac{i}{2} )\int_x^\infty \frac{e^{-(1+i)z} +e^{2iz}}{e^{2iz}-i}##
Which I am not quite sure how to evaluate. It looks like it should converge to a value, since the numerator is "smaller" than the denominator (break it up into 2 terms, and you have [e^-stuff/ e^+things] + [e^stuff/e^stuff + i]) Is there a simple way to evaluate this? Wolfram exceeds computation time.

A particular solution for ##x >## is ##y_p(x) = \int_{z=0}^{\infty} G(x,z) f(z) \, dz##, but since your ##G## vanishes when ##z < x##, the integral actually goes from ##z = x## to ##z = \infty##.

BTW: there is no reason at all to impose boundary conditions like ##G(0,z)=0## and ##G_x(0,z)=0## on the Green's function itself (and the wording of the problem left this ambiguous in my opinion). It is your final solution ##y(x) = y_0(x) + y_p(x)## that needs to satisfy that boundary condition, and that can be achieved by picking appropriate constants in the homogeneous solution ##y_0(x)##.

Last edited:
• BiGyElLoWhAt
Gold Member
Hmmm... ok. I don't disagree with what you're saying, but I was following along with the book. (Riley,hobson, bence) where you take care of them in G, and the homogeneous conditions apply directly, and for inhomogeneous you subtract a line from G. Is it easier to take care of the conditions in y? If you take care of them in y, then you have more integrals to calculate.

vela
Staff Emeritus
Science Advisor
Homework Helper
Education Advisor
Checking a few sources, I found the Green's function by definition is constructed to satisfy homogeneous boundary conditions, so you should apply the given boundary conditions when determining ##G##. The solution found from such a Green's function then automatically satisfies those boundary conditions.

It looks like we've all been a little careless here. The Green's function I found was
$$G(x,z) = \begin{cases} 0 & x \le z \\ e^{-(x-z)}\sin(x-z) & x > z \end{cases}$$ with an implicit assumption that ##z>0##. In your original post, you have ##x<z## and ##x>z## switched, but your work seems to assume the opposite.

Integrating to find the solution, we then get
$$y(x) = \int_0^\infty G(x,z)f(z)\,dz = \int_0^x G(x,z)f(z)\,dz = \frac{1}{2} (e^{-2 x} + e^{-x} \sin x- e^{-x} \cos x)$$ for ##x>0##. The integral ends up being from 0 to ##x## because ##G## vanishes when ##z>x##. Note that the terms you'd expect from the homogeneous solution of the differential equation appear and that the solution indeed satisfies the boundary conditions ##y(0) = 0## and ##y'(0) = 0##.

vela
Staff Emeritus
Science Advisor
Homework Helper
Education Advisor
Do I integrate from 0 to infinity, though? My book actually doesn't say much about the limits.
Your book probably discusses boundary conditions specified at ##x=a## and ##x=b##. and in that case, you'd integrate over the interval ##[a,b]##. In this problem, you were only given conditions at ##x=a=0##. There's no other end to the interval specified, so you should just let ##b## go to ##\infty##.

I suppose you could also consider the case where you take ##b=0## and integrate from ##a=-\infty##, but I think the intent of the problem is to assume ##a=0##.