# Solving forth order differential equation with non constant coefficients

I am trying to solve the following differential equation nummerically, but I only seem to find the trivial solution $f(x)=0$.

How would it be possible to find a different solution to this problem?

G[r_] = Sin[(r*Pi)/2]
NDSolve[
{f''''[r] + G[r]^2 f[r] == 0, f == 0, f' == 0, f == 0, f' == 0},
f, {r, 0, 1}]

• Welcome to Mathematica.SE. Are you sure you are posting on the right site? There is nothing in your question making it clear that it is concerned with Mathematica software. – m_goldberg Jul 6 '17 at 13:54
• If you are using Mathematica, you should express your work in Wolfram Language notation. – m_goldberg Jul 6 '17 at 13:56
• f=0 seems very convincingly the only solution. You've got four boundary conditions. – LLlAMnYP Jul 6 '17 at 17:08
• @LLlAMnYP I don't think so, notice this comment, I think it essentially states the same doubt as mine. (BTW, here is a simpler BVP of linear equation with infinite many solutions: DSolve[{x''[t] + 4 Pi^2 x[t] == 0, x == 0, x == 0}, x[t], t]. ) – xzczd Jul 7 '17 at 10:03
• @xzczd This came to my mind, but I dismissed this because of the form of G[r]. There could be a singular solution, but since G has a period of 4, I suspect that r == 1 is probably not a singular point. – LLlAMnYP Jul 7 '17 at 11:44

It seems to work for me. A tidier version is

ClearAll[G, f];
G[r_] := Sin[(r*Pi)/2];
sol = NDSolve[{f''''[r] + G[r]^2 f[r] == 0, f == 0, f' == 0,
f == 0, f' == 0}, f, {r, 0, 1}]


Where I have cleared the variables and used := and ; (look them up). Then to plot the result I did

Plot[Evaluate[f[r] /. First@sol], {r, 0, 1}]


and to check the error I did

Plot[Evaluate[f''''[r] + G[r]^2 f[r] /. First@sol], {r, 0, 1}]


I would have shown you the plots but my uploader has stopped working.

Hope that helps.

• Thanks a lot for answering my question. Unfortunately I still only find the trivial solution of approximately $f=0$, when I used your code. If I plot the interpolatingfunction determined by the NDSolve function the values are around $10^{-25}$, while the error has peaks around $10^{-22}$. This means that the error is of three orders bigger than the function itself. Did you find the same result or did you get something else? – D.Schoen Jul 6 '17 at 16:52
• I got the same answer; the trivial solution, so not much use. I may delete my answer. – Hugh Jul 6 '17 at 17:07
• Nope, Hugh, your answer is absolutely correct, though very cheeky :-) I thought you were slightly pulling OP's leg (really liked the bit about the uploader). – LLlAMnYP Jul 7 '17 at 9:07

Following the discussion in the comments, I found it trivial to check that in all likelihood the only solution here is the trivial one.

First I dropped the f' == 0 condition and replaced it with an arbitrary condition like f[1/2] == a. It was easy to check with a ParametricNDSolve that f is then proportional to a.

G[r_] := Sin[(r*Pi)/2];
sol = NDSolve[{f''''[r] + G[r]^2 f[r] == 0, f == 0, f' == 0,
f == 0, f[1/2] == 1}, f, {r, 0, 1}] // First


By doing

Plot[f'[r] /. sol, {t, 0, 1}] We see that the derivative of f is most certainly not zero at r == 1. Since this a linear ODE, we can conclude that if we choose to replace the boundary condition f[1/2] == 1 with OP's desired f' == a, we should find that f is again proportional to a. Therefore, for OP's f' == 0 we find that f[r] === 0.