Variational Methods for Boundary Value Problems
CSIR NET calculus of variations: BVPs as minimisation, Rayleigh–Ritz and Galerkin methods, Rayleigh quotient bounds for eigenvalues, Dirichlet principle.
- 20 min
On this page · 14 sections
- Prerequisites
- The Hook: Solving a BVP Without Solving It
- From Boundary Value Problem to Functional
- The Rayleigh–Ritz Method
- The Galerkin Method and Other Weighted Residuals
- Eigenvalue Problems: the Rayleigh Quotient
- Variational Methods for PDEs
- Memory Tricks
- Don’t Confuse
- Common Mistakes
- Practice
- Quick Revision Table
- Key Takeaways
- What’s Next
Prerequisites
- Extensions of the Euler–Lagrange Equation: the Euler–Ostrogradsky equation and isoperimetric problems, read here in reverse.
- Conditions for Extrema: the convexity theorem, which guarantees that minimising the functional really solves the problem.
- Functionals, First Variation and the Euler–Lagrange Equation: natural boundary conditions.
- Sturm–Liouville Problems and Green’s Function: self-adjoint form and the eigenvalue problems bounded here.
- Inner Product Spaces: Galerkin’s method is an orthogonality condition.
The Hook: Solving a BVP Without Solving It
From Boundary Value Problem to Functional
The previous pages went from a functional to its Euler–Lagrange equation. Variational methods go the other way.
ODEs in Sturm–Liouville (self-adjoint) form
Check: \( F_y = 2qy - 2f \), \( \frac{d}{dx}F_{y'} = 2(py')' \), so E–L is \( 2qy - 2f - 2(py')' = 0 \).
Non-self-adjoint form. A general linear equation \( y'' + P(x)y' + Q(x)y = R(x) \) becomes self-adjoint after multiplying by the integrating factor \( \mu = e^{\int P\, dx} \):
$$(\mu y')' + \mu Q\,y = \mu R \quad\longleftrightarrow\quad J[y] = \int_a^b \big( \mu y'^2 - \mu Q\,y^2 + 2\mu R\,y \big)\, dx.$$Essential and natural boundary conditions
| Boundary condition at \( x = b \) | How the variational form handles it | Name |
|---|---|---|
| \( y(b) = B \) | imposed on every trial function | essential (Dirichlet) |
| \( p(b)y'(b) = 0 \) | not imposed; the minimiser satisfies it automatically | natural (Neumann) |
| \( p(b)y'(b) + \sigma y(b) = 0 \) | add \( \sigma\,y(b)^2 \) to \( J \); then it is natural | natural (Robin) |
The last row follows from the boundary term of the first variation: \( 2p(b)y'(b)\eta(b) + 2\sigma y(b)\eta(b) = 0 \) for all \( \eta(b) \). This is the most useful practical fact on the page: trial functions need only satisfy the essential conditions.
PDEs: the Dirichlet principle
| Boundary value problem on \( D \) | Functional to minimise |
|---|---|
| \( \Delta u = 0 \), \( u = g \) on \( \partial D \) | \( \iint_D \lvert\nabla u\rvert^2 \) over \( u = g \) on \( \partial D \) (Dirichlet principle) |
| \( -\Delta u = f \), \( u = 0 \) on \( \partial D \) | \( \iint_D (\lvert\nabla u\rvert^2 - 2fu) \) |
| \( -\Delta u + cu = f \) (\( c \ge 0 \)) | \( \iint_D (\lvert\nabla u\rvert^2 + cu^2 - 2fu) \) |
| \( -\Delta u = f \), \( \frac{\partial u}{\partial n} = 0 \) on \( \partial D \) | \( \iint_D (\lvert\nabla u\rvert^2 - 2fu) \) with no boundary restriction (needs \( \iint f = 0 \)) |
| \( -\Delta u = \lambda u \), \( u = 0 \) on \( \partial D \) | Rayleigh quotient \( \frac{\iint \lvert\nabla u\rvert^2}{\iint u^2} \) |
The Dirichlet principle says the harmonic function with given boundary values has the least Dirichlet energy among all functions with those boundary values. Its early users simply assumed that a minimiser exists; Weierstrass’s example on Conditions for Extrema shows why that assumption needs proof, and the proof came later. For CSIR NET you need only the correspondence and its use.
The Rayleigh–Ritz Method
graph TD
A["BVP in self-adjoint form"] --> B["Write the functional J"]
B --> C["Trial: y_n = phi_0 + c_1 phi_1 + ... + c_n phi_n"]
C --> D["phi_0 meets the essential conditions; each phi_k vanishes there"]
D --> E["J becomes a quadratic function of c_1 ... c_n"]
E --> F["Set each partial derivative dJ/dc_k = 0"]
F --> G["Solve the n by n linear system"]
G --> H["Approximate solution y_n; J of y_n is an upper bound for min J"]Properties worth knowing:
- For \( J \) quadratic, \( \frac{\partial J}{\partial c_k} = 0 \) is a linear system whose matrix \( \big(\int (p\phi_j'\phi_k' + q\phi_j\phi_k)\big) \) is symmetric, and positive definite when \( p > 0 \), \( q \ge 0 \).
- Since \( y_n \) is admissible, \( J[y_n] \ge \min J \): Ritz values are upper bounds, and adding basis functions can only lower them.
- If the basis functions form a complete family, \( y_n \) converges to the solution in the energy norm.
A two-term trial \( y_2 = x(1 - x)(c_1 + c_2x) \) gives the linear system with solution \( c_1 = \frac{71}{369} \), \( c_2 = \frac{7}{41} \). Compared with the exact solution:
| \( x \) | One-term Ritz | Two-term Ritz | Exact \( \frac{\sin x}{\sin 1} - x \) |
|---|---|---|---|
| 0.25 | 0.05208 | 0.04408 | 0.04401 |
| 0.50 | 0.06944 | 0.06944 | 0.06975 |
| 0.75 | 0.05208 | 0.06009 | 0.06006 |
| \( J \) | \( -0.023148 \) | \( -0.024571 \) | \( -0.024574 \) (minimum) |
The last row shows the upper-bound property: each Ritz value of \( J \) lies above the true minimum and decreases towards it. (At the true minimiser, \( J_{\min} = -\int_0^1 f\,y\, dx \), because \( \int (py'^2 + qy^2) = \int fy \) there.)
The Galerkin Method and Other Weighted Residuals
Write the equation as \( L[y] = f \) and the residual of a trial function as \( R = L[y_n] - f \). Weighted-residual methods choose the \( c_k \) by making \( R \) small in some sense.
| Method | Condition on the residual | Notes |
|---|---|---|
| Galerkin | \( \int_a^b R\,\phi_k\, dx = 0 \) for \( k = 1, \dots, n \) | weights = basis functions; needs no functional, so works for non-self-adjoint problems |
| Collocation | \( R(x_k) = 0 \) at chosen points | cheapest; result depends on the points |
| Least squares | minimise \( \int_a^b R^2\, dx \) | symmetric system, always |
| Rayleigh–Ritz | minimise \( J \) | needs a functional (self-adjoint problem) |
The finite element method is Ritz or Galerkin with piecewise polynomial basis functions (for example, “hat” functions that are linear on each sub-interval), which makes the linear system sparse.
Eigenvalue Problems: the Rayleigh Quotient
For the Sturm–Liouville problem \( -(py')' + qy = \lambda r y \) on \( [a, b] \), with \( p, r > 0 \) and boundary conditions as above, define the Rayleigh quotient
$$\mathcal{R}[y] = \frac{\int_a^b (p\,y'^2 + q\,y^2)\, dx}{\int_a^b r\,y^2\, dx}.$$This is the isoperimetric problem “minimise \( \int(py'^2 + qy^2) \) with \( \int ry^2 = 1 \)” from Extensions of the Euler–Lagrange Equation, with the multiplier as the eigenvalue. Two more facts:
- The error in \( \mathcal{R} \) is of second order in the error of the trial function, which is why crude trials give good eigenvalue estimates.
- Higher eigenvalues: \( \lambda_k \) is the minimum of \( \mathcal{R} \) over functions orthogonal (with weight \( r \)) to the first \( k - 1 \) eigenfunctions (the Courant–Fischer min-max principle avoids needing those eigenfunctions).
Variational Methods for PDEs
The same steps work in two variables: choose trial functions vanishing on \( \partial D \), substitute into the functional, minimise.
Kantorovich’s method is a half-way house for PDEs: take a trial function in one variable with unknown functions of the other, for example \( u = x(1 - x)\,v(y) \). Minimising \( J \) then gives an ODE for \( v(y) \) instead of a linear system.
Memory Tricks
Don’t Confuse
| This | vs | That |
|---|---|---|
| Ritz (minimise a functional; needs self-adjointness) | Galerkin (orthogonal residual; works for any linear problem) | |
| essential condition (must be built into trials) | natural condition (may be violated by trials) | |
| \( \mathcal{R}[y] \ge \lambda_1 \) (upper bound) | a lower bound (needs other methods, e.g. comparison theorems) | |
| Ritz value \( J[y_n] \) is an upper bound on \( \min J \) | the pointwise value \( y_n(x) \) is not necessarily an upper bound on \( y(x) \) (\( 0.06944 < 0.06975 \) at \( x = \frac{1}{2} \)) | |
| \( \iint (\lvert\nabla u\rvert^2 - 2fu) \to -\Delta u = f \) | \( \iint (\lvert\nabla u\rvert^2 + 2fu) \to \Delta u = f \) |
Common Mistakes
Practice
All questions below are original practice questions written for this page. They are not from any CSIR NET paper. In Level 3, as in Part C, one or more options may be correct.
Level 1: Foundation
- Write a functional whose Euler–Lagrange equation is \( -(py')' + qy = f \).
- Which boundary conditions must a Rayleigh–Ritz trial function satisfy?
- Does the Rayleigh quotient give an upper or a lower bound for \( \lambda_1 \)?
Answers
- \( J[y] = \int_a^b (py'^2 + qy^2 - 2fy)\, dx \).
- Only the essential (Dirichlet-type) conditions; natural conditions come out of the minimisation.
- An upper bound: \( \lambda_1 = \min\mathcal{R} \le \mathcal{R}[y] \) for every admissible \( y \).
Level 2: Part B Style
Practice Q1. For \( y'' + (1 + x^2)y + 1 = 0 \), \( y(-1) = y(1) = 0 \), the one-term Galerkin approximation \( y \approx c(1 - x^2) \) has \( c \) equal to:
(a) \( \frac{35}{38} \) (b) \( \frac{5}{4} \) (c) \( \frac{1}{2} \) (d) \( \frac{38}{35} \)
Answer: (a)
Residual \( R = -2c + c(1 + x^2)(1 - x^2) + 1 = -2c + c(1 - x^4) + 1 \). With \( \int_{-1}^1 (1 - x^2) = \frac{4}{3} \) and \( \int_{-1}^1 (1 - x^4)(1 - x^2) = 2 - \frac{2}{3} - \frac{2}{5} + \frac{2}{7} = \frac{128}{105} \):
$$\int_{-1}^1 R(1 - x^2)\, dx = -\frac{8c}{3} + \frac{128c}{105} + \frac{4}{3} = -\frac{152}{105}c + \frac{4}{3} = 0 \Rightarrow c = \frac{140}{152} = \frac{35}{38}.$$So \( y(0) \approx 0.921 \); a numerical solution gives about 0.932.
Practice Q2. For the eigenvalue problem \( -((1 + x)y')' = \lambda y \), \( y(0) = y(1) = 0 \), the trial function \( y = x(1 - x) \) shows that the smallest eigenvalue satisfies:
(a) \( \lambda_1 \le 10 \) (b) \( \lambda_1 \le 15 \) (c) \( \lambda_1 \ge 15 \) (d) \( \lambda_1 \le 20 \) and nothing sharper
Answer: (b)
\( \int_0^1 (1 + x)(1 - 2x)^2\, dx = \frac{1}{3} + \int_0^1 (x - 4x^2 + 4x^3)\, dx = \frac{1}{3} + \frac{1}{2} - \frac{4}{3} + 1 = \frac{1}{2} \), and \( \int_0^1 x^2(1 - x)^2 = \frac{1}{30} \). So \( \mathcal{R} = 15 \ge \lambda_1 \). (A finite-difference computation gives \( \lambda_1 \approx 14.34 \).) (c) reverses the bound; (a) is false: \( \lambda_1 \approx 14.34 \) is above 10 (the bound \( p \ge 1 \) alone only gives \( \lambda_1 \ge \pi^2 \approx 9.87 \), so a computed value is needed to exclude (a)).
Practice Q3. The boundary value problem \( (x^2y')' = 6y + x \) on \( [1, 2] \) with fixed end values is the Euler–Lagrange equation of:
(a) \( \int_1^2 (x^2y'^2 + 6y^2 + 2xy)\, dx \) (b) \( \int_1^2 (x^2y'^2 - 6y^2 - 2xy)\, dx \) (c) \( \int_1^2 (x^2y'^2 + 6y^2 - 2xy)\, dx \) (d) \( \int_1^2 (x^2y'^2 + 3y^2 + xy)\, dx \)
Answer: (a)
For (a): \( F_y = 12y + 2x \), \( \frac{d}{dx}F_{y'} = 2(x^2y')' \); E–L gives \( (x^2y')' = 6y + x \). (c) gives \( 6y - x \); (b) gives \( -6y - x \); (d) gives \( (x^2y')' = 3y + \frac{x}{2} \).
Practice Q4. For \( -\Delta u = 2 \) on \( (-1, 1)^2 \), \( u = 0 \) on the boundary, the one-term Ritz approximation \( u \approx c(1 - x^2)(1 - y^2) \) has \( c \) equal to:
(a) \( \frac{1}{2} \) (b) \( \frac{5}{8} \) (c) \( \frac{3}{4} \) (d) 1
Answer: (b)
\( J = \iint (\lvert\nabla u\rvert^2 - 4u) \). With \( \phi = (1 - x^2)(1 - y^2) \): \( \iint \phi_x^2 = \int_{-1}^1 4x^2\, dx\int_{-1}^1 (1 - y^2)^2\, dy = \frac{8}{3}\cdot\frac{16}{15} = \frac{128}{45} \); doubled for \( \phi_y \): \( \frac{256}{45} \). \( \iint\phi = \frac{16}{9} \). \( J(c) = \frac{256}{45}c^2 - \frac{64}{9}c \), so \( c = \frac{64/9}{512/45} = \frac{5}{8} \). (The exact centre value is about 0.589.)
Level 3: Part C Style
Practice Q5. Which of the following statements are true?
(a) For a self-adjoint linear BVP and the same basis, the Ritz and Galerkin approximations coincide. (b) The Ritz approximation \( y_n \) satisfies \( J[y_n] \ge \min J \). (c) For a Sturm–Liouville problem, the Rayleigh quotient of any admissible trial function is at most \( \lambda_1 \). (d) For \( y(0) = 0 \), \( y'(1) = 0 \), a Ritz trial function need not satisfy \( y'(1) = 0 \).
Answer: (a), (b) and (d)
- (a) True. \( \frac{\partial J}{\partial c_k} = 0 \) is \( \int R\phi_k = 0 \) after integration by parts.
- (b) True. \( y_n \) is admissible, and \( \min J \) is over all admissible functions.
- (c) False. It is at least \( \lambda_1 \) (Rayleigh’s principle).
- (d) True. \( y'(1) = 0 \) is a natural condition.
Practice Q6. Consider \( -y'' = \lambda y \), \( y(0) = 0 \), \( y'(1) = 0 \). Which of the following are true?
(a) \( \lambda_1 = \frac{\pi^2}{4} \). (b) The trial function \( 2x - x^2 \) gives the bound \( \lambda_1 \le \frac{5}{2} \). (c) The trial function \( y = x \) is admissible and gives \( \lambda_1 \le 3 \). (d) The trial function \( y = 1 - x \) is admissible.
Answer: (a), (b) and (c)
- (a) True. Eigenfunctions \( \sin\frac{(2n - 1)\pi x}{2} \); the first gives \( \frac{\pi^2}{4} \approx 2.467 \).
- (b) True. \( \frac{4/3}{8/15} = \frac{5}{2} \).
- (c) True. It satisfies the essential condition \( y(0) = 0 \); \( \mathcal{R} = \frac{1}{1/3} = 3 \).
- (d) False. \( y(0) = 1 \ne 0 \) violates the essential condition.
Practice Q7. For \( -y'' + y = x \), \( y(0) = y(1) = 0 \), with trial \( y \approx c\,x(1 - x) \), which of the following are true?
(a) The associated functional is \( \int_0^1 (y'^2 + y^2 - 2xy)\, dx \). (b) The Ritz coefficient is \( c = \frac{5}{22} \). (c) The Ritz value at \( x = \frac{1}{2} \) differs from the exact value by more than 0.01. (d) The exact solution is \( y = x - \frac{\sinh x}{\sinh 1} \).
Answer: (a), (b) and (d)
- (a) True. \( p = q = 1 \), \( f = x \).
- (b) True. \( J(c) = c^2(\frac{1}{3} + \frac{1}{30}) - \frac{2c}{12} = \frac{11}{30}c^2 - \frac{c}{6} \), so \( c = \frac{1/6}{11/15} = \frac{5}{22} \).
- (c) False. Ritz: \( \frac{5}{88} \approx 0.05682 \); exact: \( \frac{1}{2} - \frac{\sinh(1/2)}{\sinh 1} \approx 0.05659 \). Difference about 0.0002.
- (d) True. \( y'' = -\frac{\sinh x}{\sinh 1} \), so \( -y'' + y = x \); and \( y(0) = y(1) = 0 \).
Quick Revision Table
| Idea | Fact |
|---|---|
| \( -(py')' + qy = f \) | E–L of \( \int (py'^2 + qy^2 - 2fy) \); unique minimiser if \( p > 0 \), \( q \ge 0 \) |
| Non-self-adjoint ODE | multiply by \( e^{\int P} \) first |
| Essential vs natural | Dirichlet in trials; Neumann/Robin come out free |
| Ritz | minimise \( J \) over \( \phi_0 + \sum c_k\phi_k \); \( J[y_n] \ge \min J \) |
| Galerkin | \( \int R\phi_k = 0 \); equals Ritz for self-adjoint problems |
| Rayleigh quotient | \( \lambda_1 = \min \frac{\int (py'^2 + qy^2)}{\int ry^2} \); every trial is an upper bound |
| \( -y'' = \lambda y \) on \( [0,1] \), Dirichlet | \( x(1 - x) \to 10 \) vs \( \pi^2 \) |
| \( y(0) = 0 \), \( y'(1) = 0 \) | \( 2x - x^2 \to \frac{5}{2} \) vs \( \frac{\pi^2}{4} \) |
| Dirichlet principle | harmonic function minimises \( \iint \lvert\nabla u\rvert^2 \) |
| Poisson \( -\Delta u = f \) | minimise \( \iint (\lvert\nabla u\rvert^2 - 2fu) \) |
Key Takeaways
What’s Next
- Calculus of Variations: Quick Revision: every formula of the chapter on one page.
- Conditions for Extrema: why convexity guarantees the Ritz minimiser is the solution.
- Extensions of the Euler–Lagrange Equation: the PDE functionals and isoperimetric problems used here.
- The Calculus of Variations chapter overview.