← Part II/ODEs & Green's Functions

1. ODEs & Green's Functions

Reading time: ~45 minutes | Difficulty: Intermediate–Advanced

Introduction

Green's functions are the physicist's Swiss Army knife. Given any linear differential equation with a source term, the Green's function converts the problem into a single integral — one function encodes the entire response of the system to an arbitrary driving force.

The idea is deceptively simple: if you know how the system responds to a point impulse (a Dirac delta function), then by superposition you can construct its response to any source. This principle permeates all of theoretical physics — from electrostatics and heat conduction to quantum field theory and signal processing.

George Green introduced these ideas in his remarkable 1828 essay on mathematical analysis of electricity and magnetism, decades before the rigorous theory of distributions was available. Today, Green's functions form the backbone of perturbation theory, scattering theory, and the path integral formulation of quantum mechanics.

Core Idea

For a linear differential operator $\mathcal{L}$, the Green's function satisfies:

$$\mathcal{L}\,G(x, x') = \delta(x - x')$$

Then the solution to $\mathcal{L}\,y(x) = f(x)$ is:

$$y(x) = y_h(x) + \int G(x, x')\,f(x')\,dx'$$

where $y_h$ is the homogeneous solution satisfying the boundary conditions.

Why ā€œSwiss Army Knifeā€?

The power of Green's functions comes from universality. Once you know $G$for a given operator and boundary conditions, you can solve the equation for any source$f(x)$ by a single integration. This is analogous to knowing the impulse response of a linear system — it completely characterizes the system.

Moreover, the Green's function reveals the intrinsic structure of the operator: its spectrum, symmetries, and singularities. In quantum mechanics, the propagator (a Green's function) contains all dynamical information about the system. In field theory, Feynman diagrams are nothing but graphical representations of products of Green's functions.

Derivation 1: Second-Order Linear ODEs

The General Framework

Consider the second-order linear ODE in standard form:

$$\mathcal{L}\,y \;=\; p_0(x)\,y'' + p_1(x)\,y' + p_2(x)\,y \;=\; f(x)$$

with boundary conditions at $x = a$ and $x = b$. The homogeneous equation$\mathcal{L}\,y = 0$ has two linearly independent solutions $y_1(x)$ and $y_2(x)$.

The Wronskian

The Wronskian of $y_1$ and $y_2$ is defined as:

$$W(x) = y_1(x)\,y_2'(x) - y_1'(x)\,y_2(x) = \begin{vmatrix} y_1 & y_2 \\ y_1' & y_2' \end{vmatrix}$$

Abel's theorem tells us that $W(x) = W(x_0)\exp\!\bigl[-\int_{x_0}^x p_1(t)/p_0(t)\,dt\bigr]$. For $y_1$ and $y_2$ linearly independent, $W(x) \neq 0$ everywhere in the interval.

Variation of Parameters

We seek a particular solution of the form:

$$y_p(x) = u_1(x)\,y_1(x) + u_2(x)\,y_2(x)$$

Imposing the gauge condition $u_1' y_1 + u_2' y_2 = 0$ (to eliminate second derivatives of $u_1, u_2$), substitution into the ODE yields:

$$u_1' y_1' + u_2' y_2' = \frac{f(x)}{p_0(x)}$$

Solving the two simultaneous equations by Cramer's rule:

$$u_1'(x) = -\frac{y_2(x)\,f(x)}{p_0(x)\,W(x)}, \qquad u_2'(x) = \frac{y_1(x)\,f(x)}{p_0(x)\,W(x)}$$

Arriving at the Green's Function

Integrating and combining:

$$y_p(x) = \int_a^b \frac{1}{p_0(x')}\left[\frac{y_1(x_<)\,y_2(x_>)}{W(x')}\right]f(x')\,dx'$$

where $x_< = \min(x, x')$ and $x_> = \max(x, x')$. Reading off the kernel, the Green's function is:

Key Result: Green's Function from Variation of Parameters

$$G(x, x') = \frac{1}{p_0(x')}\begin{cases} \dfrac{y_1(x)\,y_2(x')}{W(x')} & x < x' \\[10pt] \dfrac{y_1(x')\,y_2(x)}{W(x')} & x > x' \end{cases}$$

Here $y_1$ satisfies the left BC and $y_2$ the right BC.

The full solution is therefore:

$$y(x) = y_h(x) + \int_a^b G(x, x')\,f(x')\,dx'$$

Derivation 2: Green's Function Definition and Properties

The Defining Equation

The Green's function $G(x, x')$ for the operator $\mathcal{L}$ is defined as the solution to:

$$\mathcal{L}_x\,G(x, x') = \delta(x - x')$$

subject to the same homogeneous boundary conditions as the original problem. The subscript on $\mathcal{L}_x$ emphasizes that the operator acts on the first argument.

The Jump Condition

Consider the self-adjoint form $\mathcal{L}\,y = \frac{d}{dx}\bigl[p(x)\,y'\bigr] + q(x)\,y$. Integrating $\mathcal{L}\,G = \delta(x - x')$ over a small interval $[x' - \epsilon,\, x' + \epsilon]$:

$$\int_{x'-\epsilon}^{x'+\epsilon} \frac{d}{dx}\!\bigl[p(x)\,G'\bigr]\,dx + \int_{x'-\epsilon}^{x'+\epsilon} q(x)\,G\,dx = 1$$

As $\epsilon \to 0$, the second integral vanishes (since $G$ is continuous), leaving:

Jump Condition on the Derivative

$$p(x')\left[\frac{\partial G}{\partial x}\bigg|_{x=x'^+} - \frac{\partial G}{\partial x}\bigg|_{x=x'^-}\right] = 1$$

The Green's function is continuous at $x = x'$, but its first derivative has a discontinuity of magnitude $1/p(x')$.

Construction from Homogeneous Solutions

For $x \neq x'$, the Green's function satisfies the homogeneous equation. So we write:

$$G(x, x') = \begin{cases} A(x')\,y_1(x) & x < x' \\ B(x')\,y_2(x) & x > x' \end{cases}$$

where $y_1$ satisfies the BC at $x = a$ and $y_2$ at $x = b$. Applying the continuity condition and the jump condition determines $A$ and $B$:

$$A(x')\,y_1(x') = B(x')\,y_2(x')$$
$$p(x')\bigl[B(x')\,y_2'(x') - A(x')\,y_1'(x')\bigr] = 1$$

Solving yields $A(x') = y_2(x')/[p(x')\,W(x')]$ and $B(x') = y_1(x')/[p(x')\,W(x')]$, recovering the same expression derived via variation of parameters.

Symmetry of the Green's Function

For a self-adjoint operator $\mathcal{L}$, the Green's function satisfies:

Reciprocity / Symmetry

$$G(x, x') = G(x', x)$$

Proof: Let $G_1 = G(x, x_1)$ and $G_2 = G(x, x_2)$ satisfy the same homogeneous BCs. Then:

$$\int_a^b \bigl[G_2\,\mathcal{L}\,G_1 - G_1\,\mathcal{L}\,G_2\bigr]\,dx = 0$$

by the self-adjointness of $\mathcal{L}$ and the homogeneous BCs. The left side evaluates to$G(x_2, x_1) - G(x_1, x_2)$, hence $G(x_1, x_2) = G(x_2, x_1)$. This reciprocity is the mathematical expression of the physical principle that the response at $x$due to a source at $x'$ equals the response at $x'$ due to a source at $x$.

Derivation 3: Green's Function for the 1D Helmholtz Equation

The 1D Helmholtz equation arises in wave propagation, quantum mechanics (time-independent Schrƶdinger equation in 1D with constant potential), and normal modes of vibrating strings:

$$G''(x, x') + k^2\,G(x, x') = \delta(x - x')$$

Case 1: Infinite Line

On $x \in (-\infty, \infty)$ with outgoing wave / radiation boundary conditions. The homogeneous solutions are $e^{\pm ikx}$. Requiring the Green's function to be bounded as $x \to \pm\infty$:

$$G(x, x') = \begin{cases} A\,e^{ikx} & x > x' \\ B\,e^{-ikx} & x < x' \end{cases}$$

Continuity at $x = x'$: $A\,e^{ikx'} = B\,e^{-ikx'}$. Jump condition on the derivative: $ikA\,e^{ikx'} + ikB\,e^{-ikx'} = 1$. Solving:

Free-Space 1D Helmholtz Green's Function

$$G(x, x') = \frac{e^{ik|x - x'|}}{2ik}$$

Case 2: Half-Line with Dirichlet BC

On $x \in [0, \infty)$ with $G(0, x') = 0$ and outgoing waves as $x \to \infty$. The method of images gives:

$$G(x, x') = \frac{e^{ik|x - x'|}}{2ik} - \frac{e^{ik(x + x')}}{2ik}$$

The second term is the contribution from an ā€œimage sourceā€ at $x = -x'$ with opposite sign, ensuring the Dirichlet condition $G(0, x') = 0$ is satisfied.

Case 3: Finite Interval

On $x \in [0, L]$ with $G(0, x') = G(L, x') = 0$. The homogeneous solutions satisfying each BC are $y_1(x) = \sin(kx)$ and $y_2(x) = \sin\bigl(k(L - x)\bigr)$. The Wronskian is $W = -k\sin(kL)$. Therefore:

Finite-Interval Helmholtz Green's Function

$$G(x, x') = \begin{cases} \dfrac{-\sin(kx)\,\sin\bigl(k(L - x')\bigr)}{k\sin(kL)} & x < x' \\[10pt] \dfrac{-\sin(kx')\,\sin\bigl(k(L - x)\bigr)}{k\sin(kL)} & x > x' \end{cases}$$

This blows up when $kL = n\pi$ — resonance at the eigenfrequencies of the homogeneous problem.

Method of Images

The method of images, familiar from electrostatics, constructs the Green's function for a bounded domain by superposing free-space Green's functions and their reflections. The key insight is that image sources placed outside the domain enforce boundary conditions:

  • Dirichlet BCs ($G = 0$ on boundary): use images with opposite sign
  • Neumann BCs ($G' = 0$ on boundary): use images with same sign

For the half-line, a single image suffices. For a finite interval, an infinite series of images is needed (though often the direct construction via homogeneous solutions is more practical).

Derivation 4: Eigenfunction Expansion

Setup

Suppose the self-adjoint operator $\mathcal{L}$ (with homogeneous BCs) has a complete set of orthonormal eigenfunctions $\{\phi_n(x)\}$ with eigenvalues $\{\lambda_n\}$:

$$\mathcal{L}\,\phi_n(x) = \lambda_n\,\phi_n(x), \qquad \int_a^b \phi_m(x)\,\phi_n(x)\,dx = \delta_{mn}$$

Derivation

Expand the Green's function in this basis:

$$G(x, x') = \sum_n c_n(x')\,\phi_n(x)$$

Substituting into $\mathcal{L}\,G = \delta(x - x')$:

$$\sum_n c_n(x')\,\lambda_n\,\phi_n(x) = \delta(x - x') = \sum_n \phi_n(x)\,\phi_n(x')$$

where we used the completeness relation for the delta function in the last step. Matching coefficients: $c_n(x')\,\lambda_n = \phi_n(x')$, hence $c_n(x') = \phi_n(x')/\lambda_n$(assuming $\lambda_n \neq 0$).

Eigenfunction (Spectral) Expansion of the Green's Function

$$G(x, x') = \sum_n \frac{\phi_n(x)\,\phi_n(x')}{\lambda_n}$$

More generally, if we seek the Green's function for $(\mathcal{L} - \lambda)\,G = \delta$(the ā€œresolventā€), the expansion becomes:

$$G_\lambda(x, x') = \sum_n \frac{\phi_n(x)\,\phi_n(x')}{\lambda_n - \lambda}$$

Connection to Spectral Theory

The eigenfunction expansion reveals profound connections:

  • Poles of G: The Green's function $G_\lambda$ has simple poles at$\lambda = \lambda_n$. The eigenvalues are precisely the points where the resolvent blows up — this is the starting point of spectral theory.
  • Residues: The residue at $\lambda = \lambda_n$ is $-\phi_n(x)\,\phi_n(x')$, giving the projection operator onto the $n$-th eigenstate.
  • Contour integral representation: By contour integration,$G_\lambda = \frac{1}{2\pi i}\oint \frac{G_z}{z - \lambda}\,dz$, connecting Green's functions to complex analysis.
  • Continuous spectrum: When $\mathcal{L}$ has a continuous spectrum, the sum becomes an integral: $G_\lambda(x, x') = \int \frac{\phi_\mu(x)\,\phi_\mu^*(x')}{\mu - \lambda}\,d\mu$, and the poles become a branch cut.

Example: Vibrating String

For $-y'' = f(x)$ on $[0, L]$ with Dirichlet BCs, the eigenfunctions are$\phi_n(x) = \sqrt{2/L}\sin(n\pi x/L)$ with eigenvalues $\lambda_n = (n\pi/L)^2$. The eigenfunction expansion gives:

$$G(x, x') = \frac{2}{L}\sum_{n=1}^{\infty} \frac{\sin(n\pi x/L)\,\sin(n\pi x'/L)}{(n\pi/L)^2}$$

This series converges to the piecewise-linear function $G(x,x') = x_<(L - x_>)/L$, as we verify numerically below.

Relation to the Resolvent Operator

In operator notation, the Green's function for $(\mathcal{L} - \lambda)G = \delta$ is the integral kernel of the resolvent $R(\lambda) = (\mathcal{L} - \lambda)^{-1}$. The resolvent exists for all $\lambda$ not in the spectrum of $\mathcal{L}$. The set of such $\lambda$ is called the resolvent set, and its complement is the spectrum. This viewpoint connects Green's functions directly to functional analysis and motivates the use of contour integrals to extract spectral information.

Derivation 5: Retarded and Advanced Green's Functions

Time-Dependent Problems

For equations with a time variable, such as the 1D wave equation:

$$\left(\frac{\partial^2}{\partial t^2} - c^2\frac{\partial^2}{\partial x^2}\right)G(x,t;\,x',t') = \delta(x - x')\,\delta(t - t')$$

there are multiple Green's functions depending on the boundary conditions in time.

Retarded Green's Function

The retarded Green's function $G_R$ satisfies the causality condition:

$$G_R(x,t;\,x',t') = 0 \quad \text{for } t < t'$$

Physically, the response occurs after the source acts. For the 1D wave equation:

Retarded Green's Function (1D Wave Equation)

$$G_R(x,t;\,x',t') = \frac{1}{2c}\,\Theta(t - t')\,\Theta\!\bigl(c(t-t') - |x - x'|\bigr)$$

where $\Theta$ is the Heaviside step function. The response is nonzero only inside the forward light cone.

Advanced Green's Function

The advanced Green's function $G_A$ is nonzero only for $t < t'$:

$$G_A(x,t;\,x',t') = \frac{1}{2c}\,\Theta(t' - t)\,\Theta\!\bigl(c(t'-t) - |x - x'|\bigr)$$

It describes ā€œbackward-in-timeā€ propagation and, while non-physical for classical causal systems, plays an essential role in time-symmetric formulations (Wheeler–Feynman absorber theory).

The Feynman Propagator

In quantum field theory, neither purely retarded nor advanced boundary conditions are appropriate. Instead, one uses the Feynman propagator, which propagates positive-frequency modes forward in time and negative-frequency modes backward:

$$G_F(\omega, k) = \frac{1}{\omega^2 - c^2 k^2 - i\epsilon}$$

The $i\epsilon$ prescription (with $\epsilon \to 0^+$) determines how the contour in the complex $\omega$-plane avoids the poles at $\omega = \pm ck$:

  • Retarded: Both poles pushed below the real axis ($\omega \to \omega + i\epsilon$)
  • Advanced: Both poles pushed above the real axis ($\omega \to \omega - i\epsilon$)
  • Feynman: Positive-frequency pole below, negative-frequency pole above ($\omega^2 \to \omega^2 + i\epsilon$)

Physical Interpretation

The Feynman propagator is the time-ordered vacuum expectation value of field operators:

$$G_F(x - x') = -i\langle 0|\,T\!\bigl[\hat{\phi}(x)\,\hat{\phi}(x')\bigr]\,|0\rangle$$

It describes the amplitude for a particle to propagate from $x'$ to $x$(if $t > t'$) or an antiparticle from $x$ to $x'$(if $t < t'$). The boundary condition on the Green's function encodes the fundamental physics of the vacuum.

Applications

Electrostatics: Poisson Equation

The potential due to a charge distribution $\rho(\mathbf{r})$ satisfies$\nabla^2 \phi = -\rho/\epsilon_0$. The Green's function is the Coulomb potential:

$$G(\mathbf{r}, \mathbf{r}') = \frac{-1}{4\pi|\mathbf{r} - \mathbf{r}'|}$$

The method of images for conductors is a Green's function technique.

Quantum Scattering: Lippmann–Schwinger

The scattering state $|\psi\rangle$ satisfies the integral equation:

$$|\psi\rangle = |\phi\rangle + G_0^+(E)\,V\,|\psi\rangle$$

where $G_0^+(E) = (E - H_0 + i\epsilon)^{-1}$ is the free retarded Green's function.

Heat Conduction

The heat equation $\partial_t u - \kappa\nabla^2 u = f$ has the Green's function:

$$G(\mathbf{r},t;\,\mathbf{r}',t') = \frac{\Theta(t-t')}{[4\pi\kappa(t-t')]^{d/2}}\exp\!\left(-\frac{|\mathbf{r}-\mathbf{r}'|^2}{4\kappa(t-t')}\right)$$

The Gaussian spreading kernel — heat diffuses outward from the source.

Circuit Theory

For a linear circuit with transfer function $H(\omega)$, the impulse response $h(t)$ is the Green's function. The output for arbitrary input $v(t)$ is:

$$v_{\text{out}}(t) = \int_{-\infty}^{\infty} h(t - t')\,v_{\text{in}}(t')\,dt'$$

The convolution theorem: multiplication in frequency domain = convolution in time domain.

Worked Example: Charged Rod near a Grounded Plane

A thin rod of charge density $\lambda$ lies along the $z$-axis at distance$d$ from an infinite grounded conducting plane at $x = 0$. By the method of images, we place an image charge $-\lambda$ at $x = -d$. The Green's function for the half-space $x > 0$ with Dirichlet BC on the plane is:

$$G(\mathbf{r}, \mathbf{r}') = \frac{-1}{4\pi|\mathbf{r} - \mathbf{r}'|} + \frac{1}{4\pi|\mathbf{r} - \mathbf{r}'_{\text{image}}|}$$

where $\mathbf{r}'_{\text{image}}$ is the reflection of the source through the plane. This is the 3D Poisson Green's function with Dirichlet boundary conditions — a direct generalization of the 1D half-line construction we derived above.

The Born Series

The Lippmann–Schwinger equation can be iterated to produce the Born series:

$$|\psi\rangle = |\phi\rangle + G_0 V|\phi\rangle + G_0 V G_0 V|\phi\rangle + \cdots$$

Each term corresponds to an additional scattering event. The first Born approximation retains only the first correction, and is accurate when the potential is weak. This series is the prototype for all perturbative expansions in quantum field theory.

Historical Context

1828
George Green publishes An Essay on the Application of Mathematical Analysis to the Theories of Electricity and Magnetism, introducing what we now call Green's functions and Green's theorem. The work was privately published and remained largely unknown until William Thomson (Lord Kelvin) rediscovered it in the 1840s.
1830s
Sturm and Liouville develop the theory of eigenvalue problems for second-order ODEs, providing the spectral framework that would later connect to Green's function expansions.
1920s
Dirac formalizes the delta function as a tool in quantum mechanics, giving precise meaning to the ā€œpoint sourceā€ that defines the Green's function. Mathematicians would later provide rigorous foundations via Laurent Schwartz's theory of distributions (1940s).
1940s
Schwinger and Tomonaga reformulate quantum electrodynamics using Green's function methods, developing a covariant perturbation theory that earned them the 1965 Nobel Prize (shared with Feynman).
1948
Feynman introduces the path integral formulation and Feynman diagrams. Each diagram represents a term in the perturbative expansion of the Green's function (propagator). The Feynman propagator — with its $i\epsilon$ prescription — becomes the central object of quantum field theory.

Python Simulation

We construct Green's functions for several 1D boundary value problems and verify them by solving the ODE directly using finite differences. All computations use only numpy.

Simulation

Python
script.py178 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

What the Simulation Shows

  • Panel 1 (top-left): The analytic Green's function for the 1D Helmholtz equation on $[0, \pi]$ compared with a finite-difference numerical solution. The kink at $x = x'$reflects the derivative discontinuity (jump condition).
  • Panel 2 (top-right): Green's function for $-y'' = \delta(x - x')$ on$[0, 1]$ with Dirichlet BCs, shown for three different source positions. Note the piecewise-linear shape and the symmetry $G(x, x') = G(x', x)$.
  • Panel 3 (bottom-left): Verification that integrating the Green's function against$f(x) = \sin(2\pi x)$ reproduces the exact solution. The excellent agreement confirms the Green's function is correct.
  • Panel 4 (bottom-right): Convergence of the eigenfunction expansion as the number of terms increases. With just 10 terms the expansion is nearly indistinguishable from the exact result; with 50 terms it is essentially perfect.

Summary of Key Results

MethodKey FormulaWhen to Use
Variation of Parameters$G = y_1(x_<)y_2(x_>)/[p_0 W]$Explicit construction from homogeneous solutions
Jump Condition$[G']_{x'^-}^{x'^+} = 1/p(x')$Direct matching at the source point
Method of Images$G = G_{\text{free}} \pm G_{\text{image}}$Symmetric geometries, simple BCs
Eigenfunction Expansion$G = \sum \phi_n\phi_n'/(\lambda_n - \lambda)$Known spectrum, spectral analysis
Retarded / Advanced$G_R \propto \Theta(t-t')$Causal time-dependent problems
Feynman Propagator$G_F = 1/(\omega^2 - k^2 - i\epsilon)$Quantum field theory, vacuum processes

Common Pitfalls and Subtleties

Pitfall 1: Forgetting the Homogeneous Solution

The Green's function gives the particular solution. The general solution also includes$y_h(x)$, chosen to satisfy initial/boundary conditions. Omitting $y_h$when boundary conditions are inhomogeneous is a common error.

Pitfall 2: Resonances in the Eigenfunction Expansion

The expansion $G = \sum \phi_n \phi_n'/(\lambda_n - \lambda)$ diverges when$\lambda$ equals an eigenvalue. Physically, this corresponds to resonance — the system is being driven at a natural frequency. Mathematically, the inhomogeneous equation has no solution unless $f$ is orthogonal to the corresponding eigenfunction (theFredholm alternative).

Pitfall 3: Non-Self-Adjoint Operators

For non-self-adjoint operators, $G(x, x') \neq G(x', x)$ in general. One must use the adjoint Green's function $\bar{G}$ satisfying$\mathcal{L}^\dagger \bar{G} = \delta$. The eigenfunction expansion involves biorthogonal sets $\{\phi_n, \bar{\phi}_n\}$ rather than a single orthonormal set.

Pitfall 4: Boundary Conditions Matter

Different boundary conditions produce different Green's functions for the sameoperator. The free-space Green's function, the Dirichlet Green's function, and the Neumann Green's function are all distinct objects. Always verify that $G$satisfies the correct BCs for your problem.

Further Reading

  • ā—Arfken, Weber & Harris — Mathematical Methods for Physicists, Ch. 10: Green's functions. Comprehensive treatment with many worked examples.
  • ā—Byron & Fuller — Mathematics of Classical and Quantum Physics, Ch. 7. Elegant derivation emphasizing the connection to functional analysis.
  • ā—Jackson — Classical Electrodynamics, Ch. 1–3. The definitive treatment of Green's functions in electrostatics, including the method of images.
  • ā—Economou — Green's Functions in Quantum Physics. Dedicated monograph covering the spectral representation and applications to condensed matter.