I coded a finite element method with linear basis elements for the problem $$-u'' = f(x), x\in[0,1], u(0) = u(1) = 0$$ The nodes are uniformly spaced and I will denote them as $x_i$. I initially calculated the error of my method as $$\text{error} = \max_i |u(x_i) - \hat{u}(x_i)|$$ where $\hat{u}$ denotes the FEM solution. I kept getting approximately 0 as the error, and I'm thinking that's because the FEM solution interpolates the exact solution $u$ at the nodes $x_i$.

I then went back and got an approximation for $$\max_{x\in[0,1]} |u(x) - \hat{u}(x)|$$ and I got second-order convergence (as expected).

My question is does the FEM (with linear/quadratic/cubic piecewise basis functions) always give back an interpolation of the exact solution, and so should I expect an error of zero at the nodes?

  • $\begingroup$ What is the expression for $f(x)$? $\endgroup$
    – Charles
    Jun 21, 2016 at 2:12
  • $\begingroup$ I too have observed FEM yielding slightly better accuracy than in the interior of the elements. It doesn't always happen, nor does it necessarily yield error within floating point precision when it does happen. I think bill barth is right in that it is a special circumstance that occaisionally happens in numerical computation called 'superconvergence'. I don't remember the precise reason why it happens. It may have sonething to do with the function f that you chose. What was f in this case? $\endgroup$
    – Paul
    Jun 21, 2016 at 2:17
  • $\begingroup$ I tried a few different functions for $f$. First was $f\equiv 2$, which has the exact solution of $u(x) = (1-x)x$. Then I tried $f(x) = -e^x (x^4 + 6x^3 + x^2 - 8x + 2)$, which has an exact solution of $u(x) = e^x (1-x)^2 x^2$. For both of them, the error was somewhere around $10^{-14}$. $\endgroup$
    – Kurt
    Jun 21, 2016 at 2:38
  • 2
    $\begingroup$ Yes, for this problem, the solution is exact at the nodes provided your integrals in the weak formulation are exact. This is a nice assignment/exam question. $\endgroup$
    – cfdlab
    Jun 21, 2016 at 3:50

1 Answer 1


For this simple elliptic PDE, the finite-element approximation is indeed exact at the nodes (i.e., coincides with the true solution); this is usually called superconvergence (at the nodes).

Since it's such a nice homework problem, instead of the (simple) proof, here's a hint: Use the weak formulation with a hat function centered on $x_i$ as a test function, Galerkin orthogonality, and partial integration.

  • $\begingroup$ @ChristianClason, I don't have time to dig up the books necessary. Feel free to edit or add your own answer that is better or doesn't make the robots sad. $\endgroup$
    – Bill Barth
    Jun 21, 2016 at 13:46
  • $\begingroup$ @ChristianClason, I that's a great edit, but I think you only left me with two definite articles. Maybe it'd be better in your own name? $\endgroup$
    – Bill Barth
    Jun 21, 2016 at 13:56
  • $\begingroup$ @ChristianClason, done. Maybe someone else will give the full proof as you outlined. $\endgroup$
    – Bill Barth
    Jun 21, 2016 at 14:01
  • $\begingroup$ Thanks! I think that's the same proof I had in mind, and I'm having a go at it right now. $\endgroup$
    – Kurt
    Jun 21, 2016 at 14:28
  • $\begingroup$ I've mostly read things on Stackexchange and haven't posted much, so I'm not sure what I should do here. I wrote a proof, so should I post it as an answer and get feedback? Or should I edit my post? $\endgroup$
    – Kurt
    Jun 21, 2016 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.