Message Boards Message Boards

I need help with a differential equation

Posted 9 years ago

Hi, I am trying to find the general solution of the differential equation 2xy-y^2/y'-x^2y'=4. I used DSolve the following way

DSolve[2xy[x] - (y[x])^2/y'[x] - x^2*y'[x] == 4, y[x], x]

The answer I get is:

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

My problem is, that I know, that y[x]=1/x is a solution, but this is not among the solutions Mathematica gives.

Any suggestions on what to do is appreciated. Thanks, Ferenc

POSTED BY: Ferenc Beleznay
4 Replies

The simplest classical example of nonuniqueness is

DSolve[{y'[x] == Sqrt[y[x]], y[0] == 0}, y, x]

Of the infinitely many solutions, Mathematica only gives one, which is itself correct only for x>=0. So, it seems that Mathematica is not (yet?) programmed for this sort of situation.

POSTED BY: Gianluca Gorni

Your equation is not in normal form. If you solve for y', you will get two branches, each of which is non-Lipschitz along your solution y=1/x:

Solve[2 x y[x] - y[x]^2/y'[x] - x^2 y'[x] == 4, y'[x]]

You will see that y=1/x happens exactly where the square root is zero, on the edge of the set of the admissible pairs (x,y). The solution y=1/x is the envelope of the family of straight line solutions that are given by Mathematica:

  Join[{1/x}, Table[(4 (-x + c))/c^2, {c, 1/4, 2, 1/4}]]], {x, .1, 3},
  PlotRange -> {-1, 10}]

It seems that Mathematica does not handle this special "envelope" solution, but only the "generic" ones.

POSTED BY: Gianluca Gorni

In this case, they are not mistaken. Suppose that the constant is 1-> C[1]=1 then:

sol = DSolve[2 x y[x] - y[x]^2/y'[x] - x^2 y'[x] == 4, y[x], x] /. 
  C[1] -> 1

Output:-> {{y[x] -> 4 (1 - x)}, {y[x] -> -4 (1 + x)}}

Let's check.The first solution:

Simplify[2 x sol[[1, 1, 2]] - sol[[1, 1, 2]]^2/D[sol[[1, 1, 2]], x] - 
   x^2 D[sol[[1, 1, 2]], x]] == 4

Output:-> True

The second solution:

Simplify[2 x sol[[2, 1, 2]] - sol[[2, 1, 2]]^2/D[sol[[2, 1, 2]], x] - 
   x^2 D[sol[[2, 1, 2]], x]] == 4

Output:-> True

POSTED BY: Mariusz Iwaniuk

I know, that the solutions Mathematica gives are indeed solutions, but I also know, that it is not a complete set of solutions. My question is: Is there any other solution Mathematica missed, or y[x]=1/x is the only one missed? I think this is the only one. I also know, that this differential equation is not a straighforward one, for example with the initial condition y[1]=1, there are two solutions, y[x]=1/x and y[x]=2-x. Also, my question is: how come Mathematica misses a solution? I guess it is because of the non-uniqueness, but I would expect at least a warning message. Is there anything I can give as option to DSolve to force it to find all solutions?

POSTED BY: Ferenc Beleznay
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract