Consider an equation of the following type:

( poly = (3 x)/35 + (6 y)/7 ) == 0

If we apply the command Factor to this expression, we get


3/35 (x + 10 y)

which would suggest to divide out the factor 3/35. However, doing the factorization manually, we can also find the following shape

3/7 (1/5 x + 2 y)

Which suggests to divide out 3/7. I personally prefer the latter since the remaining coefficients are only one digit numbers 1/5 and 2, while the factorized result produced by Mathematica involves a coefficient 10 with two digits and therefore higher complexity. If we go to more complicated examples where rationals might involve integers with hundreds of digits, I would prefer the factorization to leave behind coefficients with numerators and denominators containing as little amount of digits as possible. Is there a way to tell Mathematica to factorize based on number of digits instead of the standard procedure? Or maybe one can implement such a factorization routine in a convenient way? Thanks for any suggestion.

  • $\begingroup$ Please consider changing The latter is preferred by I prefer the latter :) $\endgroup$ – Dr. belisarius Nov 10 '15 at 22:47
  • $\begingroup$ I have done as you suggest! :) $\endgroup$ – Kagaratsch Nov 10 '15 at 22:51
  • 1
    $\begingroup$ @Kagaratsch, take a look at one approach: 1/7 Simplify[poly*7] $\endgroup$ – garej Dec 23 '15 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.