I have the following equation:

$$\frac{f(x)}{f'(x)}\left(f(x) + \frac{1+(f'(x))^2}{f''(x)}\right) = c$$

where $c$ is a constant $> 0$.

Mathematica handles this well and I'm able to plot it just fine using NDSolve, but only when $c = 0$. For any other value of $c$, I get errors and the plot comes out all wrong.

Can anyone help me here?


An example of the code I used for NDSolve was:

s = 
   {y[x]/y'[x] * (y[x] + (1+(y'[x])^2)/y''[x]) == 1, y[0] == 10, y'[0] == 0}, 
   y, {x, -0.5, 0.5}]

closed as off-topic by MarcoB, Henrik Schumacher, m_goldberg, Alex Trounev, bbgodfrey Apr 7 at 20:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Henrik Schumacher, m_goldberg, Alex Trounev, bbgodfrey
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ Can you give the NDSolve[] code you used so people don't have to retype things for you? $\endgroup$ – J. M. is away Mar 31 at 1:44
  • $\begingroup$ @J.M.isslightlypensive Sorry, I've added it now. $\endgroup$ – Matheus Andrade Mar 31 at 1:49
  • $\begingroup$ I don't have any trouble evaluating your example expression. I running V11.3 on macOS 10.13.4. I suggest you try relaunching Mathematica and try with a fresh notebook. $\endgroup$ – m_goldberg Mar 31 at 2:07
  • $\begingroup$ @m_goldberg That worked. Thanks. $\endgroup$ – Matheus Andrade Mar 31 at 2:16

It sounds to me that the problem might be with plotting, which is discussed in Easy way to plot ODE solutions from NDSolve? The following works without messages.

 NDSolveValue[{y[x]/y'[x]*(y[x] + (1 + (y'[x])^2)/y''[x]) == 1, 
   y[0] == 10, y'[0] == 0}, y, {x, -0.5, 0.5}]

enter image description here


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