3
$\begingroup$

I was looking at this step from Wolfram alpha

enter image description here

In the above $W$ is LambertW function which Mathematica calls ProductLog

enter image description here

When I try to obtain this solution in Mathematica 13.1, it can not solve it. Then how did Wolfram Alpha obtain this solution?

eq = Log[1 - y[x]] - Log[y[x]] + 1/y[x] == x + C[1]
Solve[eq, y[x]]

Mathematica graphics

Adding Reals did not help.

To see the solution above produced by Wolfram alpha, you can type this command inside Mathematica

WolframAlpha["solve y'=y^2*(y-1), y(0)=1"]

Then when the result comes back to the notebook, click on the Show steps button on the top right of the result, and now you will see the above solution/step in the middle of the steps shown.

Btw, Mathematica also solved this ODE and gives same answer as Wolfram alpha.

DSolve[{y'[x] == y[x]^2*(y[x] - 1), y[0] == 1}, y[x], x]
(*{{y[x] -> 1}}*)

Which is correct solution. So it must have done same step internally. But the question why does the Solve command not work in Mathematica? Is there a work around to solve this in Mathematica as shown in Wolfram Alpha steps?

I also tried Reduce and it also could not solve it. Is Wolfram Alpha getting smarter than Wolfram Mathematica?

V 13.1 on windows

$\endgroup$
3
  • 1
    $\begingroup$ If I combine the Log by hand, Solve[Log[(1-y)/y]+1/y==x+c,y], I get ProductLog in V12.3. $\endgroup$
    – user293787
    Commented Nov 8, 2022 at 6:11
  • 1
    $\begingroup$ @user293787 you are right! But I would have expected Mathematica to do this then. It looks like Wolfram Alpha is getting smarter than Wolfram Mathematica these days. May be because it uses A.I. $\endgroup$
    – Nasser
    Commented Nov 8, 2022 at 6:13
  • 1
    $\begingroup$ Personally I think Mathematica is conservative when dealing with branch cut. $\endgroup$
    – Lacia
    Commented Nov 8, 2022 at 13:12

1 Answer 1

3
$\begingroup$
$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global`*"]

eq = Log[1 - y[x]] - Log[y[x]] + 1/y[x] == x + C[1];

Off[Solve::ifun]

(sol = Solve[ApplySides[Exp, eq], y[x]][[1]]) // TraditionalForm

enter image description here

$\endgroup$
2
  • $\begingroup$ Do you think this is something that Mathematica should have done automatically? Should I report this? $\endgroup$
    – Nasser
    Commented Nov 8, 2022 at 6:24
  • $\begingroup$ @Nasser - The solution throws an inverse function warning. Presumably, it balked at this and left it to the user to decide whether to proceed. It didn't give an erroneous result so I wouldn't consider it worth reporting. $\endgroup$
    – Bob Hanlon
    Commented Nov 8, 2022 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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