# Too high differential order in boundary conditions?

The following boundary value problem has a unique solution:

$$\begin{cases} x''-x=0\\ x''(0)=0\\ x(1)=1 \end{cases}\\ \text{General solution: } x=c_1 \sinh{t}+c_2\cosh{t}\\ \text{Solution for BVP: } x=\frac{\sinh{t}}{\sinh{1}}$$

Yet my simple attempt at solving this numerically in MMA failed:

NDSolve[{x''[t] - x[t] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 1}]


which gives the error

NDSolve::icord: The differential order of the functions in the initial or boundary conditions should be strictly less than in the differential equations.


Does MMA solve this kind of BVPs? I am aware that I could solve this example analytically, but I am working on a different problem that can't be solved analytically.

• BVP as opposed to IVP is not relevant to what is going wrong. NDSolve wants initial/boundary conditions to have order strictly less than that of the differential equation. You could work around this by taking another derivative and also giving another condition say by evaluating the original DE at a point. (That verbiage is not easy to understand. In actual code: NDSolve[{x'''[t] - x'[t] == 0, x''[0] - x[0] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 1}]) – Daniel Lichtblau Jan 25 '15 at 22:49
• @DanielLichtblau I don't know how I didn't think of this. This approach also has much better agreement with the analytic solution than FiniteElement method. Do you mind posting an answer? – Minethlos Jan 25 '15 at 23:03

BVP as opposed to IVP is not relevant to what is going wrong. NDSolve wants initial/boundary conditions to have order strictly less than that of the differential equation.

You could work around this by taking another derivative of the DE and also giving another condition say by evaluating the original DE at some point. The given example could be done as follows.

NDSolve[{x'''[t] - x'[t] == 0, x''[0] - x[0] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 1}])


I think you had intended hyperbolics rather than trigs though, for the analytic solution.

• Corrected the hyperbolics. – Minethlos Jan 25 '15 at 23:46

Curious, but under Mathematica 10, using FiniteElement spatial discretization we get this result

NDSolveValue[{x''[t] - x[t] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0,
1}, Method -> "FiniteElement"]
Plot[%[x], {x, 0, 1}]


• Unfortunately, the result is not correct. The Finite Element Method as currently implemented can not solve this problem. In effect is ignores the x''[0] boundary and that means it uses a zero NeumannValue in place. NDSolve should give a warning in this case though. – user21 Jan 26 '15 at 9:04