# Possible bug in DSolve

Let us consider

DSolve[{f == y[x] + x*(1 - y'[x]^2)/2/y'[x], y == f}, y[x], x]


{}

and a warning "DSolve::bvnul: For some branches of the general solution, the given boundary conditions lead to an empty solution".

Doesn't that result contradict the result of

DSolve[{f == y[x] + x*(1 - y'[x]^2)/2/y'[x]}, y[x], x]


{{y[x] -> 1/2 (E^C + 2 f - E^-C x^2)}, {y[x] -> 1/2 (-E^C + 2 f + E^-C x^2)}}

or I don't understand something?

There is no finite solution for the given IC. To see this more clearly, will use Michael E2 code from

simplifying-dsolve-output-exponentials-raised-to-constant

ClearAll[f, y, x];
constSimplify2 // ClearAll;
constSimplify2[dsol_, rest___] :=
Activate[
FixedPoint[#[[First@OrderingBy[#, LeafCount, 1]]] &[{#,
Replace[#,
s_ /; ! FreeQ[s, Power[_, p_ /; ! FreeQ[p, _C]]] :>
Simplify[# /.
Cases[#,
Power[_,
p_ /; ! FreeQ[p, _C]] :> (c :
Alternatives @@ Cases[p, _C, {0, Infinity}] :>
Log[c]), Infinity], rest]],
Replace[#,
s_ /; ! FreeQ[s, a_?NumericQ c_C] :>
Simplify[# /.
Cases[#, a_?NumericQ c_C /; a != 0 :> (c :> c/a),
Infinity], rest]],
Replace[#,
s_ /; ! FreeQ[s, a_?NumericQ + c_C] :>
Simplify[# /.
Cases[#, a_?NumericQ + c_C :> (c :> c - a), Infinity],
rest]]}] &, Inactivate[dsol, Function], 100], Function];


Now

sol = DSolve[{f == y[x] + x*(1 - y'[x]^2)/2/y'[x]}, y[x], x] Trying first solution. But simplifying it first

sol = sol // constSimplify2 Applying the initial conditions on first solution

sol[] /. {y[x] -> f, x -> 0} /. Rule -> Equal Solve[%, C]

(* {{C -> 0}} *)


Plugging C=0 into the solution y[x] -> f + x^2/(4 C) - C clearly gives division by zero.

Same for the second solution.

Therefore the initial condition gives no valid solution.

Update

-1. Can you elaborate your "Same for the second solution"?

I thought this was obvious. But here it is

sol[] /. {y[x] -> f, x -> 0} /. Rule -> Equal Solve[%, C]

(*  {{C -> 0}} *)


Plugging the above in the second solution also gives divide by zero.

Btw, you could just have asked without downvoting at same time. I do not understand why you have to downvote for.

• -1. Can you elaborate your "Same for the second solution"? I got it and changed my mind. Sep 13, 2022 at 6:09