# Nonlinear first order differential equation

I would like to solve:

$$y - y' x - y'^2 = 0$$.

One can guess a solution as $$y = - x^2 / 4$$.

However, with Mathematica, I have:

DSolve[y[x] - y'[x] x - (y'[x])^2 == 0, y[x], x]


which returns:

{{y[x] -> x C[1] + C[1]^2}}


that is also a correct solution.

How can I force Mathematica to return the former solution?

• $y = -x^2/4$ the equilibrium manifold. A solution should have as many undetermined constants as the ODE degree. May 9, 2020 at 12:05
• Same problem here: mathematica.stackexchange.com/questions/86152/… Jul 3, 2020 at 18:03
• @MichaelE2 Thanks! Your answer to that question is some sort of a journal article!
– user72595
Jul 4, 2020 at 11:45

These are called singular solutions. Mathematica sometimes do not find them.

A singular solution, when it exists, is tangent to the family of the general solutions (parameterized be the constant of integration you see there, which is $$c_1$$). Singular solutions can not be obtained from the general solution by substituting any value for the constant of integration.

For each specific value of $$c_1$$, we have one solution curve.

The tangent curve to all these solution curves (if it exists) is a singular solution. It exists at the max or min of the solution curves. Hence to find singular solution one way is to do the following (there can be more than one singular solution also)

 sol = y[x] /. First@DSolve[y[x] - y'[x] x - y'[x]^2 == 0, y[x], x]


  envelope = y[x] - sol


Now solve for y[x], the singular solution

Solve[{envelope == 0, D[envelope, C[1]] == 0}, {y[x], C[1]}]


Verify it satisfies the ode

sol = {{y -> Function[{x}, -(x^2/4)]}};
ode /. sol


## second example

ode = 1 + y'[x]^2 == 1/y[x]^2;
sol = y[x] /. DSolve[ode, y[x], x]


Mathematica does not find solution $$y(x)=-1, y(x)=+1$$. To find these

envelope = y[x] - sol[[1]];
Solve[{envelope == 0, D[envelope, C[1]] == 0}, {y[x], C[1]}];


sol = {{y -> Function[{x}, -1]}};
ode /. sol


envelope = y[x] - sol[[2]];
Solve[{envelope == 0, D[envelope, C[1]] == 0}, {y[x], C[1]}]


## Third example

ode = y'[x]^2 == 4 y[x];
sol = DSolve[ode, y[x], x]


Mathematica does not give the solution $$y=0$$ which can't be obtained from the above for any values for $$c_1$$.

envelope = y[x] - (y[x] /. sol)[[1]]
Solve[{envelope == 0, D[envelope, C[1]] == 0}, {y[x], C[1]}]


sol2 = {{y -> Function[{x}, 0]}};
ode /. sol2


References

(3) https://groups.google.com/forum/#!topic/comp.soft-sys.math.mathematica/rxO6yVz-_pk See answer in this link by Devendra Kapadia which the above is mostly based on.

There are other ways to find these singular solutions. Reference (1) above shows more formal methods.

• It should be noticed the command of Maple dsolve(y(x) - diff(y(x), x)*x - diff(y(x), x)^2 = 0) produces y(x) = -x^2/4, y(x) = _C1^2 + _C1*x. May 9, 2020 at 13:36

The equilibrium manifold as well as a generic solution can be obtained thru

n = 2;
y[x_] := Sum[Subscript[a, k] x^k, {k, 0, n}]
A = Table[Subscript[a, k], {k, 0, n}]
dif = y[x] - x y'[x] - y'[x]^2
coef = Take[CoefficientList[dif, x], {1, n + 1}]
sols = NSolve[coef == 0, A, Reals]
y[x] /. sols


The new DSolve option IncludeSingularSolutions has been implemented in Mathematica 13.1. With this option, the singular solutions of all three examples can be easily found now.

First example:

DSolve[y[x] - y'[x] x - y'[x]^2 == 0, y[x], x, IncludeSingularSolutions -> True]


Second example:

ode = 1 + y'[x]^2 == 1/y[x]^2;
DSolve[ode, y[x], x, IncludeSingularSolutions -> True]


Third example:

ode = y'[x]^2 == 4 y[x];
DSolve[ode, y[x], x, IncludeSingularSolutions -> True]