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:
Then the solution to $\mathcal{L}\,y(x) = f(x)$ is:
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:
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:
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:
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:
Solving the two simultaneous equations by Cramer's rule:
Arriving at the Green's Function
Integrating and combining:
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
Here $y_1$ satisfies the left BC and $y_2$ the right BC.
The full solution is therefore:
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:
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]$:
As $\epsilon \to 0$, the second integral vanishes (since $G$ is continuous), leaving:
Jump Condition on the Derivative
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:
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$:
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
Proof: Let $G_1 = G(x, x_1)$ and $G_2 = G(x, x_2)$ satisfy the same homogeneous BCs. Then:
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:
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$:
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
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:
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
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\}$:
Derivation
Expand the Green's function in this basis:
Substituting into $\mathcal{L}\,G = \delta(x - 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
More generally, if we seek the Green's function for $(\mathcal{L} - \lambda)\,G = \delta$(the āresolventā), the expansion becomes:
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:
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:
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:
Physically, the response occurs after the source acts. For the 1D wave equation:
Retarded Green's Function (1D Wave Equation)
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'$:
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:
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:
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:
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:
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:
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:
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:
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:
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
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
PythonClick 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
| Method | Key Formula | When 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.