I was surprised Mathematica did this automatically. I have an ode and wanted to factor it. I did not think Factor will work and I need to write special code to do it. But Mathematica did it

ClearAll[y, x];
odeLHS = y'[x]*y[x]*y''[x] + y'[x]^2*y[x] + y'[x]*y[x]

We see by looking at the above that $y y'$ is a factor. So

List @@ Factor[odeLHS]

Mathematica graphics

So it broke the ode into 3 products which is what I wanted. But how did it do it since it is not a polynomial.

Only reference I found is in the help, under Advanced Uses it says

Some non-polynomial expressions can be factored:

But some is not very clear to me. On what basis does it do it? Could one predict beforehand if Factor will work or not on an expression? How did Factor work on non-polynomials?

btw, in Maple, the factor() command does not work on this since not polynomial., and I had to write special code to factor on an ode. So this is much easier in Mathematica to do.

V 13.2

  • 1
    $\begingroup$ Have you tried PolynomialQ[odeLHS, Variables[odeLHS]]? And perhaps Variables[odeLHS]? $\endgroup$
    – Michael E2
    Jan 29, 2023 at 2:43

1 Answer 1


Seems that Factor has just treated those derivatives as new variables. This can be verified with:

odeLHS /. Derivative[n_][y_] :> Symbol[ToString@y <> ToString@n] // Factor
(* y[x] y1[x] (1 + y1[x] + y2[x]) *)

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.