2
$\begingroup$

In 12.1.0 for Microsoft Windows (64-bit) (March 14, 2020), writing:

num = 7 (3764 + 3673 Sqrt[2]) x^4 - 12 (19302 + 10727 Sqrt[2]) x^3 y + 756 (-44 + 31 Sqrt[2]) x^2 y^2 + 864 (37 + 51 Sqrt[2]) x y^3 - 5184 (2 + Sqrt[2]) y^4;
den = ((7 + 10 Sqrt[2]) x - 6 y) ((9 + 32 Sqrt[2]) x + 12 (1 + Sqrt[2]) y);
FullSimplify[num/den^2]
FullSimplify[num/den]/den

I get:

enter image description here

where it's evident that the second expression is more compact than the first. Is there a way to get it automatically? Thanks!

$\endgroup$
7
$\begingroup$
MinimalBy[z /. Simplify@First@Solve[Reduce[z==num/den^2, #], z] & /@ {x, y}, LeafCount]

$\frac{\left(6-5 \sqrt{2}\right) x-12 \left(\sqrt{2}-2\right) y}{\left(23 \sqrt{2}-55\right) x-12 y}$

Another way

Factor[num/den^2, Extension -> Automatic]
With[{expr = (a x + b y)/(c x + d y)}, 
  expr /. RootReduce@SolveAlways[% == expr, {x, y}]] // FullSimplify
$\endgroup$
3
  • 1
    $\begingroup$ Cool +1. Any idea how to reduce the coefficients I got? Simplifying the difference of our answers yields zero, but gosh my numbers are huge. $\endgroup$
    – Michael E2
    Dec 21 '20 at 7:00
  • $\begingroup$ I had found the above simplification using the computer software of the TI-Nspire CX CAS calculator, but it would never have crossed my mind that it could be further simplified, at least in this way! Now I'll have to figure out "what" this code does, really cool, thanks! $\endgroup$
    – TeM
    Dec 21 '20 at 7:29
  • $\begingroup$ Btw v. 11.3 gives a longer result. $\endgroup$
    – Andrew
    Dec 21 '20 at 7:32
2
$\begingroup$

By default FullSimplify and Simplify avoid large numbers through the default complexity function. Use LeafCount instead if you don’t mind the large numbers:

FullSimplify[num/den^2, ComplexityFunction->LeafCount]
(*
  (6432772386615749160*x + 4548621517377519337*Sqrt[2]*x - 42218157353358559728*y - 
    29852856498186887412*Sqrt[2]*y) /
    (134971395315929658167*x + 
     95439426336007826330*Sqrt[2]*x + 72071013851545447140*y + 
     50961935174866167276*Sqrt[2]*y)
*)
$\endgroup$
1
  • $\begingroup$ Thanks to you too, I always learn new things, great! $\endgroup$
    – TeM
    Dec 21 '20 at 7:25
1
$\begingroup$

This way it simlifies even more (or less)

num/den^2 // Apart // FullSimplify // Factor // FullSimplify

$$ \frac{7 \left(124944256776+87864579823 \sqrt{2}\right) x-12 \left(476402576068+337753093375 \sqrt{2}\right) y}{\left(691401+441484 \sqrt{2}\right) \left(\left(13669487+10004398 \sqrt{2}\right) x+12 \left(616179+439573 \sqrt{2}\right) y\right)} $$

$\endgroup$
1
  • $\begingroup$ Thanks to you too, have a nice day! $\endgroup$
    – TeM
    Dec 21 '20 at 7:25

Your Answer

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

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