# How to obtain this solution using ProductLog in Mathematica, found by Wolfram Alpha?

I was looking at this step from Wolfram alpha

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

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]]


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

• If I combine the Log by hand, Solve[Log[(1-y)/y]+1/y==x+c,y], I get ProductLog in V12.3. Commented Nov 8, 2022 at 6:11
• @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. Commented Nov 8, 2022 at 6:13
• Personally I think Mathematica is conservative when dealing with branch cut. Commented Nov 8, 2022 at 13:12

\$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
`

• Do you think this is something that Mathematica should have done automatically? Should I report this? Commented Nov 8, 2022 at 6:24
• @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. Commented Nov 8, 2022 at 6:30