I'm writing a solver for a differential equation with two neumann boundaries (u'(0)=u'(1)=0) and I can't figure out how to determine how to solve the problem. What will my boundaries be and how do I figure this out? The differential equation is $$u''(x)+Ku(x)=0.$$

  • 1
    $\begingroup$ Your question is too vague. What do you mean by "What will my boundaries be"? What numerical method do you intend to use? $\endgroup$ Commented Nov 26, 2014 at 13:52
  • 1
    $\begingroup$ If your both boundaries have nuemann boundary conditions, then you can only get the information about the gradient of the solution quantity. To get the solution, I think you may have to remove the nullspace from matrix and RHS. $\endgroup$
    – Pranav
    Commented Dec 26, 2014 at 15:35

1 Answer 1


You should consider what needs to happen between a given pair of u(i) and u(i+1) for a forward difference [or u(i) and u(i-1) for a backwards difference, or whatever scheme you are using] such that u'(i) equals zero. If you just consider the definition of derivative for a forward difference scheme as (u(i+1) - u(i)/dx) where dx is a positive constant, the answer is obvious, u(x) must satisfy the condition:


Understanding this, I am certain that you will be able to answer your own question. I can comment further if you need more information.


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.