0
$\begingroup$

I have a very complicated output from Mathematica - which may run to several pages - and I want to keep only some of the terms.

The expression I am working with is a double summation. It results in (several pages) of output, but many of the terms include variables raised to a power where the power is a function of $n$. For example:

\begin{equation}
a^4b^2(2a^3+a^7-4abc(6a-9)+a^{2n+6}\left(8+9bc-6a^{2n-8}\right))
\end{equation}

In my problem, $n$ is very large, such that I want to be able to ignore any individual terms involving this power because they become negligible. The expression above would become:

\begin{equation}
a^4 b^2 (2a^3 + a^7 - 4abc(6a-9) )
\end{equation}

Any assistance gratefully received - I have about 5 pages of output to sift through otherwise!

I have looked at this post

enter link description here

and have tried the delete with function suggested, but it removes all of the terms in the above example.

Here is a small sample of the Mathematica Output I am trying to simplify:

((1 - a)^2 (1 - b)^2 (1 - 
 c)^2 (a^(4 + 2 n) (-1 + b^2) (b - c)^2 (-1 + b c) (-1 + c^2) + 
 a^(6 + 2 n) b (-1 + b^2) (b - c)^2 c (-1 + b c) (-1 + c^2) - 
 a^(5 + 2 n) (-1 + b^2) (b - c)^2 (-1 + c^2) (-c + b^2 c + 
    b (-1 + c^2)) + 
 2 a^(2 + n)
   b c (-b c^(5 + n) + b^3 c^(5 + n) + b^(5 + n) c (-1 + c^2) + 
    c^(2 + n) (-1 + c^2) - b^4 c^(2 + n) (-1 + c^2) + 
    b^(2 + n) (-1 + c^4) - b^(4 + n) (-1 + c^4)) + 
 2 a^(6 + n)
   b c (-b c^(1 + n) + b^3 c^(1 + n) + b^(1 + n) c (-1 + c^2) - 
    c^(2 + n) (-1 + c^2) + b^4 c^(2 + n) (-1 + c^2) - 
    b^(2 + n) (-1 + c^4) + b^(4 + n) (-1 + c^4)) + 
 2 a^(5 + 
   n) (-c^(3 + n) - b^2 c^(3 + n) + b^4 c^(3 + n) + 
    b^6 c^(3 + n) + b^(3 + n) (-1 + c^2) (1 + c^2)^2 + 
    b^(6 + n) c (-1 + c^4) - b c^(2 + n) (-1 + c^4) + 
    b^5 c^(2 + n) (-1 + c^4) + b^(2 + n) (c - c^5)) - 
 2 a^(3 + 
   n) (c^(5 + n) + b^2 c^(5 + n) - b^4 c^(5 + n) - b^6 c^(5 + n) -
     b^(5 + n) (-1 + c^2) (1 + c^2)^2 + b^(6 + n) c (-1 + c^4) - 
    b c^(2 + n) (-1 + c^4) + b^5 c^(2 + n) (-1 + c^4) + 
    b^(2 + n) (c - c^5)) + 
 a^3 (-b^(5 + 2 n) (-1 + c^2) (1 + c^2)^2 - 
    2 b^3 (-1 + (a b)^n) (-1 + c^2) (1 + c^2)^2 + 
    b^(4 + 2 n) c (-1 + c^4) + b^(6 + 2 n) c (-1 + c^4) - 
    b c^2 (1 + c^2) (-2 + c^2 + c^(2 + 2 n)) + 
    b^5 (1 + c^2) (1 - 2 c^2 + c^(4 + 2 n)) + 
    c^3 (-2 + c^2 + c^(2 + 2 n) + 2 (a c)^n) - 
    b^6 c (1 + c^(4 + 2 n) + 2 c^2 (-1 + (a c)^n)) + 
    b^2 c (2 - c^4 + c^(4 + 2 n) + 2 c^2 (-1 + (a c)^n)) - 
    b^4 c (-1 + 2 c^4 + c^(4 + 2 n) + 2 c^2 (-1 + (a c)^n))) + 
 a^5 (c^3 - c^(5 + 2 n) + 2 c^5 (a c)^n - 2 b^6 c^5 (a c)^n + 
    b^(4 + 2 n) c (-1 + c^2) - 2 b^(2 + n) c^(3 + n) (-1 + c^2) + 
    2 b^(6 + n) c^(3 + n) (-1 + c^2) + b^(5 + 2 n) (-1 + c^4) - 
    2 b^(3 + n) c^(2 + n) (-1 + c^4) + 
    2 b^(5 + n) c^(2 + n) (-1 + c^4) + 
    b^(6 + 2 n) (c + c^3 - 2 c^5) + 
    b c^2 (-1 + c^2) (1 + c^(2 + 2 n)) + 
    b^3 (1 + c^2) (1 - 2 c^2 + c^(4 + 2 n)) - 
    2 b^5 (-(a b)^n - (1 + (a b)^n) c^2 + (a b)^n c^4 + (a b)^
        n c^6 + c^(6 + 2 n)) + 
    b^4 (c - 2 c^3 + c^(5 + 2 n) - 2 c^5 (a c)^n) + 
    b^2 c (-1 - c^2 + 2 c^4 (1 + (a c)^n))) + 
 a^6 b c (2 b^(4 + n) c^(2 + n) + 2 b^(2 + n) c^(4 + n) - 
    2 (b c)^(4 + n) - b^(4 + 2 n) (-1 + c^2) + 
    b^(5 + 2 n) c (-1 + c^2) - 2 b^5 (a b)^n c (-1 + c^2) + 
    c^2 (-1 + c^(2 + 2 n)) + 
    b^3 c (-1 + c^(4 + 2 n) - 2 c^4 (a c)^n) - 
    b c (-2 + c^2 + c^(4 + 2 n) - 2 c^4 (a c)^n) - 
    b^2 (1 + c^(4 + 2 n) + 2 c^2 (-1 + (b c)^n))) + 
 a^4 (c^2 - 2 c^4 + 2 b^(6 + n) c^(2 + n) + 
    2 b^(5 + n) c^(3 + n) + 2 b^(3 + n) c^(5 + n) + 
    2 b^(2 + n) c^(6 + n) + c^(4 + 2 n) + 
    b^(5 + 2 n) c^3 (-1 + c^2) + b^(4 + 2 n) (1 + c^2 - 2 c^4) + 
    b^(6 + 2 n) c^2 (-1 + c^4) + b c (-2 + c^2 + c^4) - 
    2 b^4 (1 + c^2 - 3 c^4 + c^(4 + 2 n)) + 
    b^6 c^2 (-1 + c^(4 + 2 n) - 2 c^4 (b c)^n) + 
    b^5 (c - 2 c^3 + c^(5 + 2 n) - 2 c^5 (b c)^n) - 
    b^3 c (-1 + 2 c^4 + c^(4 + 2 n) + 2 c^2 (-1 + (b c)^n)) - 
    b^2 (-1 + 2 c^4 + c^6 - c^(4 + 2 n) + c^(6 + 2 n) + 
       2 c^2 (-1 + (b c)^n))) - 
 a^2 (2 b^(6 + n) c^(2 + n) + 2 b^(5 + n) c^(3 + n) + 
    2 b^(3 + n) c^(5 + n) + 2 b^(2 + n) c^(6 + n) + 
    b^(5 + 2 n) (c - c^3) - b^(4 + 2 n) (-1 + c^4) + 
    b^(6 + 2 n) c^2 (-2 + c^2 + c^4) + c^4 (-1 + c^(2 n)) + 
    b c^3 (-2 + c^2 + c^(2 + 2 n)) - 
    2 b^2 c^2 (-3 + (a b)^n - (-1 + (a b)^n) c^2 + c^4 + c^(
       4 + 2 n) + (a c)^n + (b c)^n) + 
    b^6 c^2 (-2 + c^2 + c^(4 + 2 n) - 2 c^4 (b c)^n) + 
    b^4 (-1 + 2 c^4 + c^6 - c^(4 + 2 n) + c^(6 + 2 n) + 
       2 c^2 (-1 + (a c)^n)) - 
    b^3 c (2 - c^4 + c^(4 + 2 n) + 2 c^2 (-1 + (b c)^n)) + 
    b^5 (c + c^3 - 2 c^5 (1 + (b c)^n))) - 
 b^2 c^2 (-b^(2 + 2 n) (-1 + c^2) + b^(3 + 2 n) c (-1 + c^2) + 
    c^2 (-1 + c^(2 n)) - b^2 (1 - 2 c^2 + c^(2 + 2 n)) + 
    b^3 c (-1 + c^(2 + 2 n) + 2 (b c)^n - 2 c^2 (b c)^n) + 
    b c (2 - c^(2 + 2 n) - 2 (b c)^n + c^2 (-1 + 2 (b c)^n))) + 
 a b c (2 b^(2 + n) c^(5 + n) - 2 b^(4 + n) c^(5 + n) + 
    b^(5 + 2 n) c^2 (-1 + c^2) - 
    2 b^(5 + n) c^(2 + n) (-1 + c^2) + b^(4 + 2 n) c (-1 + c^4) + 
    b^3 (-2 + c^2 + c^4) - b^(3 + 2 n) (-2 + c^2 + c^4) + 
    2 c^3 (-1 + c^(2 n)) + b^5 c^2 (-1 + c^(2 + 2 n)) + 
    b^4 c (-1 + c^2 - c^(2 + 2 n) + c^(4 + 2 n) + 2 (b c)^n) - 
    b^2 c (-2 - c^2 + c^4 + c^(2 + 2 n) + c^(4 + 2 n) + 
       2 (b c)^n) + 
    b c^2 (2 - c^(2 + 2 n) - 2 (b c)^n + 
       c^2 (-1 + 2 (b c)^n)))))/((-1 + a^2) (a - b)^2 (-1 + 
 a b) (-1 + b^2) (a - c)^2 (b - c)^2 (-1 + a c) (-1 + b c) (-1 + 
 c^2))
$\endgroup$
4
$\begingroup$

For your long expression (call it expr) above:

expr2 = (expr /. e_^(a_. * n + b_.) :> 0) // Simplify

(* -(((-1 + a) (-1 + b) (-1 + c) (-1 - b c + a^2 b c (1 + b c) + 
       a (-c + b^2 c + b (-1 + c^2))))/((1 + a) (1 + b) (-1 + a b) (1 + 
       c) (-1 + a c) (-1 + b c))) *)
$\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.