Group Abstract Group Abstract

Message Boards Message Boards

Solving differential equation in Mathematica without ProductLog

Posted 2 years ago

Im trying to solve this Differential Equation with Mathematica to see if the result equals the result I got by solving the equation by hand.

However Mathematica gives me an answer with ProductLog which doesn't make sence to me.

Answer given when solving by hand: y = xLn|((x+y)^2)/(x)| + Cx, where C is constant of integration

5 Replies

This is a simulation of doing it by hand step-by-step with your substitution:

(y'[x] == (x^2 + y[x]^2)/(x*y[x] - x^2)) /. y -> Function[t, t*v[t]]
Solve[%, v'[x]][[1, 1]] /. Rule -> Equal // Simplify
DivideSides[%, %[[2]] x, GenerateConditions -> False]
ApplySides[Integrate[#, x] &, %]
SubtractSides[%, 0 == C[1]]
% /. v -> Function[t, y[t]/t]
Solve[%, y[x]]
POSTED BY: Gianluca Gorni
POSTED BY: Mariusz Iwaniuk

Mathematica give you solution with explicit form it's a general solving diff equation.

EQ = y'[x] == (x^2 + y[x]^2)/(x*y[x] - x^2);
sol = DSolve[EQ, y, x] // Quiet
EQ /. sol[[1]] // FullSimplify(*A correct solution*)

Your solution by hand are implicit form:

Solve[y == x*Log[((x + y)^2)/(x)] + C[1]*x, y] // PowerExpand

(*{{y -> -x - 
    2 x ProductLog[-(E^(1/2 (-1 - C[1]))/(2 Sqrt[x]))]}, {y -> -x - 
    2 x ProductLog[E^(1/2 (-1 - C[1]))/(2 Sqrt[x])]}}*)

Regards M.I.

POSTED BY: Mariusz Iwaniuk
  S = DSolveChangeVariables[
     Inactive[DSolve][y'[x] == (x^2 + y[x]^2)/(x*y[x] - x^2), y, x], v, 
     x, y[x] == v[x]*x] // FullSimplify

   S // Activate
   (*{{v -> Function[{x}, -1 - 
        2 ProductLog[-(1/2) Sqrt[E^(-1 - C[1])/x]]]}, {v -> 
      Function[{x}, -1 - 2 ProductLog[1/2 Sqrt[E^(-1 - C[1])/x]]]}}*)

Looks the same.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard