Outline of Green’s Function
In this tutorial, we will discuss the Green’s Function approach to solving linear ODEs. For any given \(n\)-th order linear ODE in the form of
\begin{align}
a_n(x)\frac{d^ny}{dx^n} + \cdots + a_2(x) \frac{d^2y}{dx^2} + a_1(x) \frac{dy}{dx} + a_0(x)y = f(x) \tag{1}
\end{align}
where \(a_n(x)\) are the coefficients that depend on \(x\) and \(f(x)\) is the source term, we condense the L.H.S. by assigning the linear operator:
\begin{align}
\mathcal{L} = a_n(x)\frac{d^n}{dx^n} + \cdots + a_2(x) \frac{d^2}{dx^2} + a_1(x) \frac{d}{dx} + a_0(x) \tag{2}
\end{align}
so that (1) becomes
\begin{align}
\mathcal{L}[y](x) = f(x) \tag{3}
\end{align}
A Green’s Function of (3) is then one that also accepts an extra variable, e.g. \( z \), so that this \( G(x,z) \) satisfies (3) with R.H.S. replaced by a delta function \( \delta(x-z) \):
\begin{align}
\mathcal{L}[G](x,z) = \delta(x-z) \tag{4}
\end{align}
with all the differential operators contained in \( \mathcal{L} \) accordingly changed to partial derivatives with respect to \(x\). Physically, it means that \( G(x,z) \) is the solution to the ODE, as a response of the system when the source term/forcing is solely a unit impulse at \(x = z\) while holding \(z\) fixed. Of course, the actual form of \( G(x,z) \) also needs to be consistent with the initial/boundary conditions. Particularly, for example, when they are in the homogeneous form of \( y(a) = y(b) = 0 \) or \( y(a) = y'(a) = 0 \), it will also be \( G(a,z) = G(b,z) = 0 \) or \( G(a,z) = G'(a,z) = 0 \).
Subsequently, motivated by the idea of convolution (given in this tutorial), we propose a solution that is constructed from the sum of signals \( f(x) \) and the appropriate physical response to a unit signal \( G(x,z) \) as just developed:
\begin{align}
y = \int_D G(x,z) f(z) dz \tag{5}
\end{align}
where \( D \) denotes the domain. Then
\begin{align}
\mathcal{L}[y](x) &= \mathcal{L}[\int_D G(x,z) f(z) dz] \\
&= \int_D \mathcal{L}[G](x,z) f(z) dz \\
&= \int_D \delta(x-z) f(z) dz = f(x) \tag{6}
\end{align}
where we assume that the differential operator \( \mathcal{L} \) can be put inside the integral and have used (4) and the definition of the delta function. This verifies that (5) is indeed a valid solution to (3), given that the initial/boundary conditions are obeyed properly.
Remember that (the delta function in) (4) can be conveniently dealt with the Laplace Transform. This also circumvents a potential problem regarding the discontinuity of the Green’s function which we will concern ourselves with in the next chapter. A final note is that the Green’s function method is actually equivalent to the Duhamel’s Principle.
Example
Solve the second-order ODE
\begin{align}
\frac{d^2y}{dx^2} + y = \tan x \tag{7}
\end{align}
by finding its Green’s function, where \(y(0) = y'(0) = 0\), \( x \geq 0 \).
The Green’s function is computed according to (4) and then by applying Laplace Transform:
\begin{align}
\frac{d^2}{dx^2}[G(x,z)] + G(x,z) &= \delta(x-z) \\
s^2\mathscr{L}[G](s,z) -sG(0,z) -G'(0,z) + \mathscr{L}[G](s,z) &= e^{-sz} \\
(s^2 + 1)\mathscr{L}[G](s,z) &= e^{-sz} \\
\mathscr{L}[G](s,z) &= \frac{e^{-sz}}{s^2+1} \tag{8}
\end{align}
Inverting then yields
\begin{align}
G(x,z) = H(x-z)\sin(x-z) \tag{9}
\end{align}
or equivalently
\begin{align}
G(x,z) = \begin{cases}
0 & \text{when } x < z \\
\sin(x-z) & \text{when } x > z
\end{cases} \tag{10}
\end{align}
Therefore, by (5), the desired solution is
\begin{align}
y &= \int_0^{\infty} G(x,z) f(z) dz \\
&= \int_0^{x} \sin(x-z) \tan z dz \\
&= \int_0^{x} (\sin x \cos z -\cos x \sin z) \tan z dz \\
&= \int_0^{x} (\sin x \sin z -\cos x \frac{\sin^2 z}{\cos z}) dz \\
&= \int_0^{x} (\sin x \sin z -\cos x \frac{1-\cos^2 z}{\cos z}) dz \\
&= [-\sin x \cos z]_0^x -\int_0^{x} \cos x (\sec z -\cos z) dz \\
&= \sin x (1-\cos x) -\cos x [\ln|\sec z + \tan z| -\sin z]_0^x \\
&= \sin x (1-\cos x) -\cos x (\ln|\sec x + \tan x| -\sin x) \\
&= \sin x -\cos x \ln|\sec x + \tan x| \tag{11}
\end{align}
where we have made use of several trigonometric identities.
Exercise
Use the method of Green’s function to derive the form of the particular solution of
\begin{align}
\frac{d^2y}{dx^2} -y = f(x) \tag{12}
\end{align}
where \(f(x)\) can be any arbitrary function in \(x\), with the initial conditions of \( y(0) = 0, y'(0) = 1 \) that are inhomogeneous, and hence a suitable change of variable is needed.
Answer
To transform the I.C. to a homogeneous one, the simplest way is through subtracting a suitable polynomial. Note that if \( p(x) = x \), then \( p(0) = 0, p'(0) = 1 \), so we can let \( w = y -p(x) = y -x \) to be the new dependent variable, and now \( w(0) = w'(0) = 0 \). (12) then becomes
\begin{align}
\frac{d^2(w+x)}{dx^2} -(w+x) &= f(x) \\
\frac{d^2w}{dx^2} -w &= f(x) + x
\end{align}
so the form of the ODE is the same except that the source term now contains an extra \( x \). Its Green’s Function is then found by (4) and applying the technique of Laplace Transform:
\begin{align}
\frac{d^2}{dx^2}[G(x,z)] -G(x,z) &= \delta(x-z) \\
s^2\mathscr{L}[G](s,z) -sG(0,z) -G'(0,z) -\mathscr{L}[G](s,z) &= e^{-sz} \\
(s^2-1)\mathscr{L}[G](s,z) &= e^{-sz} \\
\mathscr{L}[G](s,z) &= \frac{e^{-sz}}{s^2-1}
\end{align}
Therefore,
\begin{align}
G(x,z) = H(x-z)\sinh(x-z) = \begin{cases}
0 & \text{when } x < z \\
\sinh(x-z) & \text{when } x > z
\end{cases}
\end{align}
and by (5), the particular solution should be
\begin{align}
w &= \int_0^{\infty} G(x,z) (f(z)+z) dz \\
&= \int_0^{x} \sinh(x-z) (f(z)+z) dz \\
\Rightarrow y &= \int_0^{x} \sinh(x-z) (f(z)+z) dz + x
\end{align}








Leave a Reply