3
$\begingroup$

I have a series $$\Phi_2=\sum_{0\leq n\leq N}a_nq^n+O(q)^{N+1}$$ whose coefficients $a_n$ are Laurent polynomials in the variables $X_1,X_2$.

I want to find $\Phi^3$. This is should be pretty simple as it is just adding some of the $a_n$ polynomials. However Mathematica is returning a series whose coefficients are rational functions. Upon using Simplify it returns the good result with polynomials as coefficient.

This is quite puzzling to me and as this is in the middle of a big calculation using Simplify in every step takes a very long time. I'd like to know why are these rational function appearing to use Simplify only when strictly necessary.

Here is the actual function. Sorry for the huge expression but I couldn't find a smaller example for which I get the same mistake

In[140]:= Φ2

Out[140]= SeriesData[q, 0, {
 Complex[0, -6] Pi + Complex[0, 1] Pi/X[
   1] + Complex[0, 1] Pi X[1] + Complex[0, 1] Pi/X[
   2] + Complex[0, 1] Pi X[1]/X[
   2] + Complex[0, 1] Pi X[2] + Complex[0, 1] Pi X[1]^(-1) X[2], 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  Complex[0, -54] Pi + Complex[0, 1] Pi X[1]^(-2) + Complex[0, 14]
     Pi/X[1] + Complex[0, 14] Pi X[1] + Complex[0, 1]
     Pi X[1]^2 + Complex[0, 1] Pi X[2]^(-2) + Complex[0, -6] Pi X[1]
     X[2]^(-2) + Complex[0, 1] Pi X[1]^2 X[2]^(-2) + Complex[0, 14]
     Pi/X[2] + Complex[0, -6] Pi X[1]^(-1)/X[
   2] + Complex[0, 14] Pi X[1]/X[2] + Complex[0, -6] Pi X[1]^2/X[
   2] + Complex[0, 14] Pi X[2] + Complex[0, -6] Pi X[1]^(-2) X[
    2] + Complex[0, 14] Pi X[1]^(-1) X[2] + Complex[0, -6] Pi X[1] X[
    2] + Complex[0, 1] Pi X[2]^2 + Complex[0, 1]
     Pi X[1]^(-2) X[2]^2 + Complex[0, -6] Pi X[1]^(-1) X[2]^2, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  Complex[0, -324] Pi + Complex[0, 14] Pi X[1]^(-2) + Complex[0, 92]
     Pi/X[1] + Complex[0, 92] Pi X[1] + Complex[0, 14]
     Pi X[1]^2 + Complex[0, 1] Pi X[1] X[2]^(-3) + Complex[0, 1]
     Pi X[1]^2 X[2]^(-3) + Complex[0, 14] Pi X[2]^(-2) + Complex[0, 1]
     Pi X[1]^(-1) X[2]^(-2) + Complex[0, -54] Pi X[1]
     X[2]^(-2) + Complex[0, 14] Pi X[1]^2 X[2]^(-2) + Complex[0, 1]
     Pi X[1]^3 X[2]^(-2) + Complex[0, 92] Pi/X[
   2] + Complex[0, 1] Pi X[1]^(-2)/X[
   2] + Complex[0, -54] Pi X[1]^(-1)/X[2] + Complex[0, 92] Pi X[1]/X[
   2] + Complex[0, -54] Pi X[1]^2/X[2] + Complex[0, 1] Pi X[1]^3/X[
   2] + Complex[0, 92] Pi X[2] + Complex[0, 1] Pi X[1]^(-3) X[
    2] + Complex[0, -54] Pi X[1]^(-2) X[2] + Complex[0, 92]
     Pi X[1]^(-1) X[2] + Complex[0, -54] Pi X[1] X[2] + Complex[0, 1]
     Pi X[1]^2 X[2] + Complex[0, 14] Pi X[2]^2 + Complex[0, 1]
     Pi X[1]^(-3) X[2]^2 + Complex[0, 14]
     Pi X[1]^(-2) X[2]^2 + Complex[0, -54]
     Pi X[1]^(-1) X[2]^2 + Complex[0, 1] Pi X[1] X[2]^2 + Complex[
    0, 1] Pi X[1]^(-2) X[2]^3 + Complex[0, 1]
     Pi X[1]^(-1) X[2]^3}, 0, 72, 24]

In[141]:= Φ2^3

Out[141]= SeriesData[q, 0, {(
   Complex[0, -6] Pi + Complex[0, 1] Pi/X[
    1] + Complex[0, 1] Pi X[1] + Complex[0, 1] Pi/X[
    2] + Complex[0, 1] Pi X[1]/X[
    2] + Complex[0, 1] Pi X[2] + Complex[0, 1] Pi X[1]^(-1) X[2])^3, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   3 (Complex[0, -6] Pi + Complex[0, 1] Pi/X[
     1] + Complex[0, 1] Pi X[1] + Complex[0, 1] Pi/X[
     2] + Complex[0, 1] Pi X[1]/X[
     2] + Complex[0, 1] Pi X[2] + Complex[0, 1] Pi X[1]^(-1) X[2])^2 (
   Complex[0, -54] Pi + Complex[0, 1] Pi X[1]^(-2) + Complex[0, 14]
      Pi/X[1] + Complex[0, 14] Pi X[1] + Complex[0, 1]
      Pi X[1]^2 + Complex[0, 1] Pi X[2]^(-2) + Complex[0, -6] Pi X[1]
      X[2]^(-2) + Complex[0, 1] Pi X[1]^2 X[2]^(-2) + Complex[0, 14]
      Pi/X[2] + Complex[0, -6] Pi X[1]^(-1)/X[
    2] + Complex[0, 14] Pi X[1]/X[2] + Complex[0, -6] Pi X[1]^2/X[
    2] + Complex[0, 14] Pi X[2] + Complex[0, -6] Pi X[1]^(-2) X[
     2] + Complex[0, 14] Pi X[1]^(-1) X[2] + Complex[0, -6] Pi X[1] X[
     2] + Complex[0, 1] Pi X[2]^2 + Complex[0, 1]
      Pi X[1]^(-2) X[2]^2 + Complex[0, -6] Pi X[1]^(-1) X[2]^2), 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, (Complex[0, -6] Pi + Complex[0, 1] Pi/X[
     1] + Complex[0, 1] Pi X[1] + Complex[0, 1] Pi/X[
     2] + Complex[0, 1] Pi X[1]/X[
     2] + Complex[0, 1] Pi X[2] + Complex[0, 1] Pi X[1]^(-1) X[2])^3 (
   3 (Complex[0, -6] Pi + Complex[0, 1] Pi/X[
       1] + Complex[0, 1] Pi X[1] + Complex[0, 1] Pi/X[
       2] + Complex[0, 1] Pi X[1]/X[
       2] + Complex[0, 1] Pi X[2] + Complex[0, 1] Pi X[1]^(-1) X[
        2])^(-2) (
      Complex[0, -54] Pi + Complex[0, 1] Pi X[1]^(-2) + Complex[0, 14]
         Pi/X[1] + Complex[0, 14] Pi X[1] + Complex[0, 1]
         Pi X[1]^2 + Complex[0, 1] Pi X[2]^(-2) + Complex[0, -6] Pi X[
        1] X[2]^(-2) + Complex[0, 1] Pi X[1]^2 X[2]^(-2) + Complex[
        0, 14] Pi/X[2] + Complex[0, -6] Pi X[1]^(-1)/X[
       2] + Complex[0, 14] Pi X[1]/X[2] + Complex[0, -6] Pi X[1]^2/X[
       2] + Complex[0, 14] Pi X[2] + Complex[0, -6] Pi X[1]^(-2) X[
        2] + Complex[0, 14] Pi X[1]^(-1) X[2] + Complex[0, -6] Pi X[1]
         X[2] + Complex[0, 1] Pi X[2]^2 + Complex[0, 1]
         Pi X[1]^(-2) X[2]^2 + Complex[0, -6]
         Pi X[1]^(-1) X[2]^2)^2 + 3 (
      Complex[0, -6] Pi + Complex[0, 1] Pi/X[
       1] + Complex[0, 1] Pi X[1] + Complex[0, 1] Pi/X[
       2] + Complex[0, 1] Pi X[1]/X[
       2] + Complex[0, 1] Pi X[2] + Complex[0, 1] Pi X[1]^(-1) X[
        2])^(-1) (
     Complex[0, -324] Pi + Complex[0, 14] Pi X[1]^(-2) + Complex[
       0, 92] Pi/X[
      1] + Complex[0, 92] Pi X[1] + Complex[0, 14]
        Pi X[1]^2 + Complex[0, 1] Pi X[1] X[2]^(-3) + Complex[0, 1]
        Pi X[1]^2 X[2]^(-3) + Complex[0, 14] Pi X[2]^(-2) + Complex[
       0, 1] Pi X[1]^(-1) X[2]^(-2) + Complex[0, -54] Pi X[1]
        X[2]^(-2) + Complex[0, 14] Pi X[1]^2 X[2]^(-2) + Complex[0, 1]
        Pi X[1]^3 X[2]^(-2) + Complex[0, 92] Pi/X[
      2] + Complex[0, 1] Pi X[1]^(-2)/X[
      2] + Complex[0, -54] Pi X[1]^(-1)/X[
      2] + Complex[0, 92] Pi X[1]/X[2] + Complex[0, -54] Pi X[1]^2/X[
      2] + Complex[0, 1] Pi X[1]^3/X[
      2] + Complex[0, 92] Pi X[2] + Complex[0, 1] Pi X[1]^(-3) X[
       2] + Complex[0, -54] Pi X[1]^(-2) X[2] + Complex[0, 92]
        Pi X[1]^(-1) X[2] + Complex[0, -54] Pi X[1] X[2] + Complex[
       0, 1] Pi X[1]^2 X[2] + Complex[0, 14] Pi X[2]^2 + Complex[0, 1]
        Pi X[1]^(-3) X[2]^2 + Complex[0, 14]
        Pi X[1]^(-2) X[2]^2 + Complex[0, -54]
        Pi X[1]^(-1) X[2]^2 + Complex[0, 1] Pi X[1] X[2]^2 + Complex[
       0, 1] Pi X[1]^(-2) X[2]^3 + Complex[0, 1]
        Pi X[1]^(-1) X[2]^3))}, 0, 72, 24]

I tried with Mathematica 11.2 and 12 and I get the same mistake.

$\endgroup$
  • $\begingroup$ I haven't looked at your problem specifically, but you may find that Expand (for example) gives the same result as Simplify, but much faster. $\endgroup$ – mikado Sep 28 '19 at 9:14
  • $\begingroup$ Nope 'Expand' doesn't get rid of the undesired denominators. It just gives each term separate. I still get a sum of rational functions instead of a polynomial. $\endgroup$ – David Jaramillo Sep 29 '19 at 10:35
  • $\begingroup$ Map[Factor, Φ2^3] shows there are denominators anyway (monomials X[1]^k X[2]^k, as in the answer below) $\endgroup$ – მამუკა ჯიბლაძე Mar 2 at 19:34
  • $\begingroup$ Hi I didn't expected a comment so much time after. The point is not that I get something in the denominator as below, the problem is that I get a rational function (with sums in the denominator) $\frac{\dots +\dots +\dots}{\dots +\dots +\dots}$ This is what is puzzling me. At the end I decided to use the solution below but I am still confused on why do I get some big expression in the denominator $\endgroup$ – David Jaramillo Mar 3 at 16:12
3
$\begingroup$

You could try using cubing the normal version, and then converting back to a series:

Normal[Φ2]^3 + O[q]^3 //TeXForm

$-\frac{i \left(\pi X(2) X(1)^2+\pi X(1)^2+\pi X(2)^2 X(1)-6 \pi X(2) X(1)+\pi X(1)+\pi X(2)^2+\pi X(2)\right)^3}{X(1)^3 X(2)^3}-\frac{3 i \pi ^3 q \left(X(2) X(1)^2+X(1)^2+X(2)^2 X(1)-6 X(2) X(1)+X(1)+X(2)^2+X(2)\right)^2 \left(X(2)^2 X(1)^4-6 X(2) X(1)^4+X(1)^4-6 X(2)^3 X(1)^3+14 X(2)^2 X(1)^3+14 X(2) X(1)^3-6 X(1)^3+X(2)^4 X(1)^2+14 X(2)^3 X(1)^2-54 X(2)^2 X(1)^2+14 X(2) X(1)^2+X(1)^2-6 X(2)^4 X(1)+14 X(2)^3 X(1)+14 X(2)^2 X(1)-6 X(2) X(1)+X(2)^4-6 X(2)^3+X(2)^2\right)}{X(1)^4 X(2)^4}-\frac{3 i \pi ^3 q^2 \left(X(2) X(1)^2+X(1)^2+X(2)^2 X(1)-6 X(2) X(1)+X(1)+X(2)^2+X(2)\right) \left(X(2)^4 X(1)^8-11 X(2)^3 X(1)^8+40 X(2)^2 X(1)^8-11 X(2) X(1)^8+X(1)^8-11 X(2)^5 X(1)^7+116 X(2)^4 X(1)^7-197 X(2)^3 X(1)^7-197 X(2)^2 X(1)^7+116 X(2) X(1)^7-11 X(1)^7+40 X(2)^6 X(1)^6-197 X(2)^5 X(1)^6-344 X(2)^4 X(1)^6+1706 X(2)^3 X(1)^6-344 X(2)^2 X(1)^6-197 X(2) X(1)^6+40 X(1)^6-11 X(2)^7 X(1)^5-197 X(2)^6 X(1)^5+1706 X(2)^5 X(1)^5-2238 X(2)^4 X(1)^5-2238 X(2)^3 X(1)^5+1706 X(2)^2 X(1)^5-197 X(2) X(1)^5-11 X(1)^5+X(2)^8 X(1)^4+116 X(2)^7 X(1)^4-344 X(2)^6 X(1)^4-2238 X(2)^5 X(1)^4+6810 X(2)^4 X(1)^4-2238 X(2)^3 X(1)^4-344 X(2)^2 X(1)^4+116 X(2) X(1)^4+X(1)^4-11 X(2)^8 X(1)^3-197 X(2)^7 X(1)^3+1706 X(2)^6 X(1)^3-2238 X(2)^5 X(1)^3-2238 X(2)^4 X(1)^3+1706 X(2)^3 X(1)^3-197 X(2)^2 X(1)^3-11 X(2) X(1)^3+40 X(2)^8 X(1)^2-197 X(2)^7 X(1)^2-344 X(2)^6 X(1)^2+1706 X(2)^5 X(1)^2-344 X(2)^4 X(1)^2-197 X(2)^3 X(1)^2+40 X(2)^2 X(1)^2-11 X(2)^8 X(1)+116 X(2)^7 X(1)-197 X(2)^6 X(1)-197 X(2)^5 X(1)+116 X(2)^4 X(1)-11 X(2)^3 X(1)+X(2)^8-11 X(2)^7+40 X(2)^6-11 X(2)^5+X(2)^4\right)}{X(1)^5 X(2)^5}+O\left(q^3\right)$

| improve this answer | |
$\endgroup$

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.