Taylor expansion in SageMath returns error
Hi, I need to find the Taylor coefficient of order 7 in the variable "x4" of the following function:
var('x1 x2 x3 x4 w1 w2 w3 w4 w5 w5 w6');
g= 1/4*((w1^2*w3^2*x1^4*x2^6*x3^8 + 2*(w1^2*w3^2*x1^4*x2^6 + w1^2*w3*x1^3*x2^5)*x3^7 + (w1^2*w3^2*x1^4*x2^6 + 2*w1^2*w3*x1^3*x2^5 + 2*w1^2*x1^2*x2^4)*x3^6)*x4^6 + 2*((w1^2*w3^2*x1^4*x2^6 + (w1^2*w3^2*x1^4 + (2*w1^2*w3 + w1*w3^2)*x1^3)*x2^5)*x3^7 + 2*(w1^2*w3^2*x1^4*x2^6 + (w1^2*w3^2*x1^4 + (3*w1^2*w3 + w1*w3^2)*x1^3)*x2^5 + (w1^2*w3*x1^3 + (w1^2 + w1*w3)*x1^2)*x2^4)*x3^6 + (w1^2*w3^2*x1^4*x2^6 + (w1^2*w3^2*x1^4 + (4*w1^2*w3 + w1*w3^2)*x1^3)*x2^5 + 2*(w1^2*w3*x1^3 + (2*w1^2 + w1*w3)*x1^2)*x2^4 + 2*(w1^2*x1^2 + w1*x1)*x2^3)*x3^5)*x4^5 + ((w1^2*w3^2*x1^4*x2^6 + 2*(w1^2*w3^2*x1^4 + (3*w1^2*w3 + 2*w1*w3^2)*x1^3)*x2^5 + (w1^2*w3^2*x1^4 + 2*(3*w1^2*w3 + 2*w1*w3^2)*x1^3 + 2*(3*w1^2 + 6*w1*w3 + w3^2)*x1^2)*x2^4)*x3^6 + 2*(w1^2*w3^2*x1^4*x2^6 + (2*w1^2*w3^2*x1^4 + (7*w1^2*w3 + 4*w1*w3^2)*x1^3)*x2^5 + (w1^2*w3^2*x1^4 + 4*(2*w1^2*w3 + w1*w3^2)*x1^3 + (9*w1^2 + 16*w1*w3 + 2*w3^2)*x1^2)*x2^4 + (w1^2*w3*x1^3 + (3*w1^2 + 4*w1*w3)*x1^2 + 2*(3*w1 + w3)*x1)*x2^3)*x3^5 + (w1^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 3*(x2^3 + x2^2)*x3^3*e^(w5*x1*x2) + (x2^3 + x2^2)*x3^2*e^(w5*x1*x2))*x4^2*e^(w6*x1*x2*x3) + 3*((x2^3 + 2*x2^2 + x2)*x3^4*e^(w5*x1*x2) + 3*(x2^3 + 2*x2^2 + x2)*x3^3*e^(w5*x1*x2) + 3*(x2^3 + 2*x2^2 + x2)*x3^2*e^(w5*x1*x2) + (x2^3 + 2*x2^2 + x2)*x3*e^(w5*x1*x2))*x4*e^(w6*x1*x2*x3) + ((x2^3 + 3*x2^2 + 3*x2 + 1)*x3^3*e^(w5*x1*x2) + 3*(x2^3 + 3*x2^2 + 3*x2 + 1)*x3^2*e^(w5*x1*x2) + 3*(x2^3 + 3*x2^2 + 3*x2 + 1)*x3*e^(w5*x1*x2) + (x2^3 + 3*x2^2 + 3*x2 + 1)*e^(w5*x1*x2))*e^(w6*x1*x2*x3))
For this we used the command:
taylor(g,x4,0,7)
Then, this return:
RuntimeError: ECL says: THROW: The catch RAT-ERR is undefined.
During handling of the above exception, another exception occurred:
......
TypeError: ECL says: THROW: The catch RAT-ERR is undefined.
However, if I compute taylor(g,x4,0,3)
returns its expansion without problems, but in order > 3, returns error.
Can anybody say me why don't returns its taylor expansion in order beyond 3?
Edited for legibility.
If you want to insert code in your question, indent it by four spaces (or use Ctrl-K or the "101010" button).