JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Green's Functions for ODE Boundary-Value Problems

Once you accept that a system's response to a single sharp poke tells you everything, the only question left is how to actually build that response. This guide hands you the recipe — two homogeneous solutions, glued at the source by one continuity rule and one jump in the derivative — and shows you exactly where the jump comes from.

The one poke that knows everything

The previous guide in this rung sold you on the central trick, so let us name it once more before we build with it. You have a linear operator — say L[u] = -(d^2u/dx^2) for a stretched string, or a more general L[u] = (d/dx)(p du/dx) + q u — and you want to solve the inhomogeneous [[boundary-value-problem|boundary-value problem]] L[u] = f(x) on an interval [a, b], with u pinned down at both ends. Green's beautiful idea was to stop asking about the messy load f all at once and ask instead: how does the system respond to a single, infinitely concentrated unit poke at one location s? That response, as a function of the observation point x, is the [[greens-function|Green's function]] G(x, s). Once you have it, the answer to the full problem is just a superposition — u(x) = integral from a to b of G(x, s) f(x) ds — because a linear system's reply to a sum of pokes is the sum of the replies.

Said precisely, G(x, s) is the solution of L[G] = delta(x - s) that obeys the same homogeneous boundary conditions as the original problem. Here delta(x - s) is the [[dirac-delta-function|Dirac delta]] centred at the source point s — and remember the honesty from earlier: it is not really a function at all but a distribution, a limit of taller-and-narrower spikes of unit area, only ever given meaning by what it does inside an integral. That subtlety is exactly what makes the construction interesting, because a genuine function can never equal a spike. The whole art of this guide is to turn that strange right-hand side into a perfectly concrete recipe you can carry out by hand.

Four demands that pin G down completely

Here is the key realisation that turns a distribution on the right-hand side into ordinary calculus. Away from the source point — at every x that is not exactly equal to s — the delta is simply zero. So on each side of s the Green's function satisfies the plain *homogeneous* equation L[G] = 0, the same one whose solutions you already know how to find. The source only makes its presence felt at the single point x = s, and its entire effect there is concentrated into a single, sharp condition. So G is built from two ordinary smooth pieces, one for x < s and one for x > s, stitched together at s by rules that encode the poke.

For a second-order operator, four demands fix G completely, and it is worth holding all four in view at once. First, boundary conditions: G must obey the problem's own homogeneous boundary conditions — for a string fixed at both ends, G(a, s) = 0 and G(b, s) = 0. Second, the homogeneous equation off-source: L[G] = 0 for all x not equal to s, on each side separately. Third, continuity at the source: G itself must be continuous across x = s — the string is poked, not torn, so it has no gap. Fourth, the jump condition: the first derivative dG/dx must take a sudden, calculable jump as you cross s. The first three feel natural; the fourth is the whole point, and the next two sections build it and then earn it.

Where the jump comes from

Why must the first derivative jump, and by exactly how much? The argument is short and worth seeing once, because it shows the delta doing its one and only job — integrating to one. Take the defining equation in self-adjoint shape, (d/dx)(p dG/dx) + q G = delta(x - s), and integrate both sides across a razor-thin window from s minus epsilon to s plus epsilon, then let epsilon shrink to zero. On the right you get exactly 1, because the delta has unit area and the window straddles its spike. On the left, the q G term contributes nothing in the limit: G is continuous and bounded, so its integral over a vanishing window vanishes. Only the derivative term survives, and by the fundamental theorem of calculus its integral is just p dG/dx evaluated at the two edges of the window.

Putting those two halves together gives the jump condition outright: p(s) times [ dG/dx just to the right of s, minus dG/dx just to the left of s ] equals 1. In other words the derivative of G is *discontinuous* at the source, leaping by exactly 1/p(s) as you step across it, while G itself stays unbroken. For the plain string with L = -d^2/dx^2, the self-adjoint coefficient is p = -1, so the right-derivative-minus-left-derivative of G equals -1: the tent's slope drops by one as you pass the peak from left to right. That single number is the fingerprint the delta leaves behind, and it is the one piece of information you cannot get from the homogeneous equation alone.

The recipe, step by step

Now assemble everything into a procedure you can run on any regular second-order boundary-value problem. The idea is to pick, on each side of the source, the homogeneous solution that already satisfies the boundary condition on that side — half the conditions handled for free — and then fix the two leftover constants with continuity and the jump. You will need the [[fundamental-set-of-solutions|fundamental set of solutions]] of L[u] = 0, the two independent homogeneous solutions from which every solution is built; finding those is the first-year-style work you already did earlier in this volume.

  1. Solve the homogeneous equation L[u] = 0 and find two independent solutions. Call u1 the combination that satisfies the LEFT boundary condition at a, and u2 the combination that satisfies the RIGHT boundary condition at b. (For the string, u1 = x - a vanishes at a; u2 = x - b vanishes at b.)
  2. Write the two-piece ansatz: G(x, s) = A u1(x) for x below s, and G(x, s) = B u2(x) for x above s. The left piece already obeys the boundary at a; the right piece already obeys the boundary at b. Only the two unknown constants A and B remain, and they are allowed to depend on s.
  3. Impose continuity at the source: the two pieces must agree there, so A u1(s) = B u2(s). This is one linear equation in A and B.
  4. Impose the jump: subtract the left slope from the right slope at s and set p(s) times that difference to 1. This gives p(s) [ B u2'(s) - A u1'(s) ] = 1, the second linear equation.
  5. Solve the 2-by-2 linear system for A and B. The determinant that appears is p(s) times the Wronskian W(u1, u2) at s — and a fundamental fact makes this clean: for a self-adjoint operator p(x) W(x) is a CONSTANT, independent of s, so the algebra collapses neatly. The result is A = u2(s)/(pW) and B = u1(s)/(pW).
  6. Read off the answer in its symmetric form: G(x, s) = u1(x_<) u2(x_>) / (p W), where x_< is the smaller of x and s and x_> is the larger. This single formula covers both sides at once and exposes the symmetry G(x, s) = G(s, x) — effect at x from a source at s equals effect at s from a source at x.

A tent, built end to end

Let us run the recipe on the cleanest possible case so you can watch every number appear: the unit-tension string on [0, 1], clamped at both ends, with -G'' = delta(x - s). The homogeneous equation is just G'' = 0, whose solutions are straight lines. The line through the left wall is u1 = x (it vanishes at 0); the line through the right wall is u2 = x - 1 (it vanishes at 1). So below s, G = A x; above s, G = B (x - 1). Continuity at s says A s = B (s - 1). The operator's self-adjoint coefficient is p = -1, so the jump condition -[ B - A ] = 1 — that is, the right slope B minus the left slope A must equal -1.

Problem:  -G'' = delta(x - s)  on [0,1],   G(0)=0,  G(1)=0

Homogeneous G''=0  ->  straight lines.
   left  piece (vanishes at 0):   G = A x
   right piece (vanishes at 1):   G = B (x - 1)

Two gluing conditions at x = s:
   continuity:        A s   =  B (s - 1)
   jump (p = -1):     B - A  =  -1          [ right slope - left slope ]

Solve:    A = 1 - s ,    B = -s

               | (1 - s) x        for  0 <= x <= s      (rising line)
   G(x, s) =   |
               | s (1 - x)        for  s <= x <= 1      (falling line)

        = (1 - x_>) x_<          x_< = min(x,s),  x_> = max(x,s)

   Peak height at x = s :   G(s, s) = s(1 - s)   ->  a tent.
   Note the symmetry:       G(x, s) = G(s, x).
The whole construction on one card: two straight pieces, glued by continuity and a unit slope-drop, give the tent G(x, s) = (1 - x_>) x_< — and it is symmetric in x and s.

Solving the two little equations gives A = 1 - s and B = -s, so G(x, s) = (1 - s) x on the left and s (1 - x) on the right — exactly a tent peaking at height s(1 - s) directly above the source. Now collect the payoff. To solve the real problem -u'' = f(x) with the string clamped, you no longer touch the differential equation at all; you just integrate against the tent: u(x) = integral from 0 to 1 of G(x, s) f(s) ds. One Green's function, computed once, dispatches *every* load f you will ever hang on this string. That is the leverage Green bought you — and notice it came entirely from solving a homogeneous equation and gluing, never from confronting the delta head-on.

Fine print, and where it leads

Be honest about when this construction works. It needs the homogeneous problem to have *only the trivial solution* under the given boundary conditions — equivalently, that zero is not an eigenvalue of the operator. If a nonzero u solved L[u] = 0 with both boundary conditions already satisfied, the Wronskian denominator p W would be zero and the formula would blow up; there is no Green's function then, and the boundary-value problem either has no solution or infinitely many. This is the exact continuous echo of a singular matrix: you cannot invert L when it has a nontrivial null space, just as you cannot invert a matrix with a zero eigenvalue. The recipe quietly assumes you are in the invertible case.

Two further notes keep you honest. The symmetry G(x, s) = G(s, x) we saw in the example is not a coincidence of the string — it holds whenever the operator is self-adjoint and the boundary conditions are the symmetric Sturm–Liouville kind, and it fails for non-self-adjoint problems, where you must instead work with the operator's adjoint. And the superposition u(x) = integral of G(x, s) f(s) ds is exactly what the [[variation-of-parameters|variation of parameters]] method produces by a different route; the Green's function is, in effect, variation of parameters with the integration limits arranged to bake in the boundary conditions from the start, so the answer needs no further adjustment.

Step back and see what you now hold. A Green's function is the continuous inverse of a differential operator — the analogue of a matrix inverse — and you can build it by hand from nothing more than the two homogeneous solutions, a continuity match, and that one calculable jump in the derivative. The same construction recurs in every later setting: only the homogeneous solutions and the coefficient p change. The next guides in this rung push it onward — the symmetry and self-adjoint connection made precise, then the eigenfunction expansion that rebuilds G as a sum over the very Sturm–Liouville eigenfunctions you met one rung back, and finally the leap to partial differential equations, where the same poke-and-superpose idea answers the heat and wave equations.