Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2006/iii/paper-68/4/b/solution

Choose a partition , with the usual nodal piecewise-linear hat functions , including the half hats at the endpoints. Write with . Differentiating the Ritz method energy with respect to , , gives
On an element of length , its two basis functions are and . Direct integration yields the element matrix
For example the first weighted diagonal is ; the off-diagonal is . This gives the affine-weighted hat mass matrix and explicit equations on any partition by assembling adjacent elements.
For the uniform choice , , the assembled interior equations are
The last node contributes only one element, so its equation is
In the first interior equation the known term moves to the right, giving . For only the endpoint equation is needed. The last row enforces the weak Neumann boundary condition, so no artificial value outside the interval is introduced. The matrix on is a symmetric positive-definite matrix: its quadratic form is for every nonzero trial variation . The discrete minimizer is therefore unique.

New to topics? Read the docs here!