# How can I plot the solutions to this overdetermined system of non linear ODEs?

I want to plot the solutions to: $$(l')^2 + (h')^2 = 1$$ $$(c-1)\sin(2l)=2l''$$

where $$c$$ is a constant, but I haven't been able to (I tried using NDSolve but didn't manage to do it). Can someone help me? Here's what I've tried (setting $$c=2$$):

s = NDSolve[{Sin[2 l[x]] == 2 l''[x], l[0] == 1, l'[0] == 1},
l, {x, -10, 10}];
a[x_] := Evaluate[l[x] /. s];
i[x_] := Sqrt[1 - (a'[x])^2];
b[x_] := Integrate[i[x], x]


this leads to errors. This attempt:

Clear[eq1, eq2, initConds, sol];
eq1 = Sin[2 l[s]] == 2 l''[s];
eq2 = l'[s]^2 + h'[s]^2 == 1;
initConds = {l[0] == 1, l'[0] == 1, h[0] == 0, h'[0] == 0};

sol = NDSolve[{eq1, eq2, initConds}, {l, h}, {s, -10, 10}]
ParametricPlot[Evaluate[{l[s], h[s]} /. sol], {s, -10, 10}]


also led nowhere.

• What are the conditions for the NDSolve? And what is the region that you are solving the differential equation? And can you please post some code that the members here can easily copy and paste? Nov 12 '18 at 11:22
• I want to plot $l$ and $h$ everywhere the system has a solution. I've added the code of my attempts. Nov 12 '18 at 11:29
• The error is not produced in a[x] and i[x]. I can actually plot these using the commands you have. Are you talking about the error when you try to plot b[x]? Nov 12 '18 at 11:41
• @Konstantinos yes. I need both functions, just $l$ unfortunately doesn't work for me :/ I think the mistake is because I'm trying to do an indefinite integral of a function defined numerically, but I don't know how to do that right. Nov 12 '18 at 11:44
• You have performed an analytic integration of a numerical result. Try to take the solution obtained by the first D.E for l[s], and solve the second. Nov 12 '18 at 11:45

The solution has two branches, it is necessary to choose one, for example, the first

Clear[eq1, eq2, initConds, sol];
eq1 = Sin[2 l[s]] == 2 l''[s];
eq2 = l'[s]^2 + h'[s]^2 == 1;
initConds = {l[0] == 1, l'[0] == 1, h[0] == 0};

sol = NDSolve[{eq1, eq2, initConds}, {l, h}, {s, -10, 10}]
ParametricPlot[Evaluate[{l[s], h[s]} /. First[sol]], {s, -10, 10}]


Two branches

{ParametricPlot[Evaluate[{l[s], h[s]} /. First[sol]], {s, -10, 10}],
ParametricPlot[Evaluate[{l[s], h[s]} /. sol[[2]]], {s, -10, 10}]}


In addition to @Alex Trounev 'answer the first solution approach of your question can be solved as follows:

L = NDSolveValue[{Sin[2 l[x]] == 2 l''[x], l[0] == 1, l'[0] == 1}, l, {x, -10, 10}]
hh[x_] := NIntegrate[ Sqrt[1 - L'[u]^2], {u, 0, x}]
ParametricPlot[{L[x], hh[x]}, {x, -10, 10}]  (* negative branch*)


• Thanks. Now I know my earlier mistake. Nov 12 '18 at 11:55