\(\int \frac {1}{(d+e x^n) (a+b x^n+c x^{2 n})^3} \, dx\) [77]

Optimal result
Mathematica [B] (warning: unable to verify)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F(-1)]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 26, antiderivative size = 1787 \[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx =\text {Too large to display} \] Output:

1/2*x*(c*(-2*a*c+b^2)*d-b*(-3*a*c+b^2)*e+c*(2*a*c*e-b^2*e+b*c*d)*x^n)/a/(- 
4*a*c+b^2)/(a*e^2-b*d*e+c*d^2)/n/(a+b*x^n+c*x^(2*n))^2-1/2*x*(a*b^3*c*e*(c 
*d^2*(11-30*n)+a*e^2*(6-29*n))-2*a^2*b*c^2*e*(a*e^2*(4-23*n)+c*d^2*(6-19*n 
))+4*a^2*c^3*d*(a*e^2*(1-8*n)+c*d^2*(1-4*n))-b^4*c*d*(a*e^2*(5-11*n)-c*d^2 
*(1-2*n))-b^5*e*(a*e^2*(1-4*n)+2*c*d^2*(1-2*n))+b^6*d*e^2*(1-2*n)-a*b^2*c^ 
2*d*(5*c*d^2*(1-3*n)-a*e^2*(3+5*n))+c*(a*b^2*c*e*(c*d^2*(9-28*n)+a*e^2*(5- 
26*n))-4*a^2*c^2*e*(a*e^2*(1-7*n)+c*d^2*(1-3*n))-b^3*c*d*(2*a*e^2*(2-5*n)- 
c*d^2*(1-2*n))-b^4*e*(a*e^2*(1-4*n)+2*c*d^2*(1-2*n))+b^5*d*e^2*(1-2*n)-2*a 
*b*c^2*d*(c*d^2*(2-7*n)-5*a*e^2*n))*x^n)/a^2/(-4*a*c+b^2)^2/(a*e^2-b*d*e+c 
*d^2)^2/n^2/(a+b*x^n+c*x^(2*n))-c*e^4*(2*c*d-(b+(-4*a*c+b^2)^(1/2))*e)*x*h 
ypergeom([1, 1/n],[1+1/n],-2*c*x^n/(b-(-4*a*c+b^2)^(1/2)))/(b^2-4*a*c-b*(- 
4*a*c+b^2)^(1/2))/(a*e^2-b*d*e+c*d^2)^3+1/2*c*((1-n)*(a*b^2*c*e*(c*d^2*(9- 
28*n)+a*e^2*(5-26*n))-4*a^2*c^2*e*(a*e^2*(1-7*n)+c*d^2*(1-3*n))-b^3*c*d*(2 
*a*e^2*(2-5*n)-c*d^2*(1-2*n))-b^4*e*(a*e^2*(1-4*n)+2*c*d^2*(1-2*n))+b^5*d* 
e^2*(1-2*n)-2*a*b*c^2*d*(c*d^2*(2-7*n)-5*a*e^2*n))+(8*a^2*c^3*d*(a*e^2*(1- 
8*n)+c*d^2*(1-4*n))*(1-2*n)-b^4*c*d*(2*a*e^2*(3-7*n)-c*d^2*(1-2*n))*(1-n)- 
b^5*e*(a*e^2*(1-4*n)+2*c*d^2*(1-2*n))*(1-n)+b^6*d*e^2*(2*n^2-3*n+1)-2*a*b^ 
2*c^2*d*(3*c*d^2*(3*n^2-4*n+1)-a*e^2*(5*n^2-6*n+3))-4*a^2*b*c^2*e*(a*e^2*( 
25*n^2-21*n+3)+c*d^2*(29*n^2-25*n+5))+a*b^3*c*e*(c*d^2*(36*n^2-49*n+13)+a* 
e^2*(38*n^2-41*n+7)))/(-4*a*c+b^2)^(1/2))*x*hypergeom([1, 1/n],[1+1/n],...
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(43535\) vs. \(2(1787)=3574\).

Time = 8.79 (sec) , antiderivative size = 43535, normalized size of antiderivative = 24.36 \[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\text {Result too large to show} \] Input:

Integrate[1/((d + e*x^n)*(a + b*x^n + c*x^(2*n))^3),x]
 

Output:

Result too large to show
 

Rubi [A] (verified)

Time = 4.22 (sec) , antiderivative size = 1708, normalized size of antiderivative = 0.96, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {1766, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx\)

\(\Big \downarrow \) 1766

\(\displaystyle \int \left (-\frac {e^2 \left (b e-c d+c e x^n\right )}{\left (a e^2-b d e+c d^2\right )^2 \left (a+b x^n+c x^{2 n}\right )^2}+\frac {-b e+c d-c e x^n}{\left (a e^2-b d e+c d^2\right ) \left (a+b x^n+c x^{2 n}\right )^3}+\frac {e^6}{\left (d+e x^n\right ) \left (a e^2-b d e+c d^2\right )^3}-\frac {e^4 \left (b e-c d+c e x^n\right )}{\left (a e^2-b d e+c d^2\right )^3 \left (a+b x^n+c x^{2 n}\right )}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {e x^n}{d}\right ) e^6}{d \left (c d^2-b e d+a e^2\right )^3}-\frac {c \left (2 c d-\left (b+\sqrt {b^2-4 a c}\right ) e\right ) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right ) e^4}{\left (b^2-\sqrt {b^2-4 a c} b-4 a c\right ) \left (c d^2-b e d+a e^2\right )^3}-\frac {c \left (2 c d-\left (b-\sqrt {b^2-4 a c}\right ) e\right ) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right ) e^4}{\left (b^2+\sqrt {b^2-4 a c} b-4 a c\right ) \left (c d^2-b e d+a e^2\right )^3}+\frac {c \left (-e (1-n) b^3+\left (c d-\sqrt {b^2-4 a c} e\right ) (1-n) b^2+c \left (2 a e (2-3 n)+\sqrt {b^2-4 a c} d (1-n)\right ) b-2 a c \left (2 c d (1-2 n)-\sqrt {b^2-4 a c} e (1-n)\right )\right ) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right ) e^2}{a \left (b^2-4 a c\right ) \left (b^2-\sqrt {b^2-4 a c} b-4 a c\right ) \left (c d^2-b e d+a e^2\right )^2 n}+\frac {c \left (-e (1-n) b^3+\left (c d+\sqrt {b^2-4 a c} e\right ) (1-n) b^2+c \left (2 a e (2-3 n)-\sqrt {b^2-4 a c} d (1-n)\right ) b-2 a c \left (2 c d (1-2 n)+\sqrt {b^2-4 a c} e (1-n)\right )\right ) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right ) e^2}{a \left (b^2-4 a c\right ) \left (b^2+\sqrt {b^2-4 a c} b-4 a c\right ) \left (c d^2-b e d+a e^2\right )^2 n}+\frac {x \left (c \left (-e b^2+c d b+2 a c e\right ) x^n-2 a c^2 d+b^2 c d-b^3 e+3 a b c e\right ) e^2}{a \left (b^2-4 a c\right ) \left (c d^2-b e d+a e^2\right )^2 n \left (b x^n+c x^{2 n}+a\right )}-\frac {c \left (-e \left (2 n^2-3 n+1\right ) b^5+\left (c d-\sqrt {b^2-4 a c} e\right ) \left (2 n^2-3 n+1\right ) b^4+c \left (a e (7-18 n)+\sqrt {b^2-4 a c} d (1-2 n)\right ) (1-n) b^3+a c \left (\sqrt {b^2-4 a c} e (5-14 n)-6 c d (1-3 n)\right ) (1-n) b^2-2 a c^2 \left (\sqrt {b^2-4 a c} d \left (7 n^2-9 n+2\right )+2 a e \left (13 n^2-13 n+3\right )\right ) b-4 a^2 c^2 \left (\sqrt {b^2-4 a c} e \left (3 n^2-4 n+1\right )-2 c d \left (8 n^2-6 n+1\right )\right )\right ) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{2 a^2 \left (b^2-4 a c\right )^2 \left (b^2-\sqrt {b^2-4 a c} b-4 a c\right ) \left (c d^2-b e d+a e^2\right ) n^2}+\frac {c \left (e \left (2 n^2-3 n+1\right ) b^5-\left (c d+\sqrt {b^2-4 a c} e\right ) \left (2 n^2-3 n+1\right ) b^4-c \left (a e (7-18 n)-\sqrt {b^2-4 a c} d (1-2 n)\right ) (1-n) b^3+a c \left (\sqrt {b^2-4 a c} e (5-14 n)+6 c d (1-3 n)\right ) (1-n) b^2-2 a c^2 \left (\sqrt {b^2-4 a c} d \left (7 n^2-9 n+2\right )-2 a e \left (13 n^2-13 n+3\right )\right ) b-4 a^2 c^2 \left (\sqrt {b^2-4 a c} e \left (3 n^2-4 n+1\right )+2 c d \left (8 n^2-6 n+1\right )\right )\right ) x \operatorname {Hypergeometric2F1}\left (1,\frac {1}{n},1+\frac {1}{n},-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{2 a^2 \left (b^2-4 a c\right )^2 \left (b^2+\sqrt {b^2-4 a c} b-4 a c\right ) \left (c d^2-b e d+a e^2\right ) n^2}+\frac {x \left (-c \left (-e (1-2 n) b^4+c d (1-2 n) b^3+a c e (5-14 n) b^2-2 a c^2 d (2-7 n) b-4 a^2 c^2 e (1-3 n)\right ) x^n+2 a^2 b c^2 e (4-11 n)-3 a b^3 c e (2-5 n)-4 a^2 c^3 d (1-4 n)+5 a b^2 c^2 d (1-3 n)-b^4 c d (1-2 n)+b^5 (e-2 e n)\right )}{2 a^2 \left (b^2-4 a c\right )^2 \left (c d^2-b e d+a e^2\right ) n^2 \left (b x^n+c x^{2 n}+a\right )}+\frac {x \left (c \left (-e b^2+c d b+2 a c e\right ) x^n-2 a c^2 d+b^2 c d-b^3 e+3 a b c e\right )}{2 a \left (b^2-4 a c\right ) \left (c d^2-b e d+a e^2\right ) n \left (b x^n+c x^{2 n}+a\right )^2}\)

Input:

Int[1/((d + e*x^n)*(a + b*x^n + c*x^(2*n))^3),x]
 

Output:

(x*(b^2*c*d - 2*a*c^2*d - b^3*e + 3*a*b*c*e + c*(b*c*d - b^2*e + 2*a*c*e)* 
x^n))/(2*a*(b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)*n*(a + b*x^n + c*x^(2*n)) 
^2) + (e^2*x*(b^2*c*d - 2*a*c^2*d - b^3*e + 3*a*b*c*e + c*(b*c*d - b^2*e + 
 2*a*c*e)*x^n))/(a*(b^2 - 4*a*c)*(c*d^2 - b*d*e + a*e^2)^2*n*(a + b*x^n + 
c*x^(2*n))) + (x*(2*a^2*b*c^2*e*(4 - 11*n) - 3*a*b^3*c*e*(2 - 5*n) - 4*a^2 
*c^3*d*(1 - 4*n) + 5*a*b^2*c^2*d*(1 - 3*n) - b^4*c*d*(1 - 2*n) + b^5*(e - 
2*e*n) - c*(a*b^2*c*e*(5 - 14*n) - 2*a*b*c^2*d*(2 - 7*n) - 4*a^2*c^2*e*(1 
- 3*n) + b^3*c*d*(1 - 2*n) - b^4*e*(1 - 2*n))*x^n))/(2*a^2*(b^2 - 4*a*c)^2 
*(c*d^2 - b*d*e + a*e^2)*n^2*(a + b*x^n + c*x^(2*n))) - (c*e^4*(2*c*d - (b 
 + Sqrt[b^2 - 4*a*c])*e)*x*Hypergeometric2F1[1, n^(-1), 1 + n^(-1), (-2*c* 
x^n)/(b - Sqrt[b^2 - 4*a*c])])/((b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])*(c*d^2 
 - b*d*e + a*e^2)^3) + (c*e^2*(b*c*(2*a*e*(2 - 3*n) + Sqrt[b^2 - 4*a*c]*d* 
(1 - n)) - 2*a*c*(2*c*d*(1 - 2*n) - Sqrt[b^2 - 4*a*c]*e*(1 - n)) - b^3*e*( 
1 - n) + b^2*(c*d - Sqrt[b^2 - 4*a*c]*e)*(1 - n))*x*Hypergeometric2F1[1, n 
^(-1), 1 + n^(-1), (-2*c*x^n)/(b - Sqrt[b^2 - 4*a*c])])/(a*(b^2 - 4*a*c)*( 
b^2 - 4*a*c - b*Sqrt[b^2 - 4*a*c])*(c*d^2 - b*d*e + a*e^2)^2*n) - (c*(a*b^ 
2*c*(Sqrt[b^2 - 4*a*c]*e*(5 - 14*n) - 6*c*d*(1 - 3*n))*(1 - n) + b^3*c*(a* 
e*(7 - 18*n) + Sqrt[b^2 - 4*a*c]*d*(1 - 2*n))*(1 - n) - b^5*e*(1 - 3*n + 2 
*n^2) + b^4*(c*d - Sqrt[b^2 - 4*a*c]*e)*(1 - 3*n + 2*n^2) - 4*a^2*c^2*(Sqr 
t[b^2 - 4*a*c]*e*(1 - 4*n + 3*n^2) - 2*c*d*(1 - 6*n + 8*n^2)) - 2*a*b*c...
 

Defintions of rubi rules used

rule 1766
Int[((d_) + (e_.)*(x_)^(n_))^(q_)*((a_) + (b_.)*(x_)^(n_) + (c_.)*(x_)^(n2_ 
))^(p_), x_Symbol] :> Int[ExpandIntegrand[(d + e*x^n)^q*(a + b*x^n + c*x^(2 
*n))^p, x], x] /; FreeQ[{a, b, c, d, e, n, p, q}, x] && EqQ[n2, 2*n] && NeQ 
[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && ((IntegersQ[p, q] && 
!IntegerQ[n]) || IGtQ[p, 0] || (IGtQ[q, 0] &&  !IntegerQ[n]))
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
Maple [F]

\[\int \frac {1}{\left (d +e \,x^{n}\right ) \left (a +b \,x^{n}+c \,x^{2 n}\right )^{3}}d x\]

Input:

int(1/(d+e*x^n)/(a+b*x^n+c*x^(2*n))^3,x)
 

Output:

int(1/(d+e*x^n)/(a+b*x^n+c*x^(2*n))^3,x)
 

Fricas [F]

\[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\int { \frac {1}{{\left (c x^{2 \, n} + b x^{n} + a\right )}^{3} {\left (e x^{n} + d\right )}} \,d x } \] Input:

integrate(1/(d+e*x^n)/(a+b*x^n+c*x^(2*n))^3,x, algorithm="fricas")
 

Output:

integral(1/(b^3*e*x^(4*n) + a^3*d + (c^3*e*x^n + c^3*d)*x^(6*n) + 3*(b*c^2 
*e*x^(2*n) + a*c^2*d + (b*c^2*d + a*c^2*e)*x^n)*x^(4*n) + (b^3*d + 3*a*b^2 
*e)*x^(3*n) + 3*(b^2*c*e*x^(3*n) + a^2*c*d + (b^2*c*d + 2*a*b*c*e)*x^(2*n) 
 + (2*a*b*c*d + a^2*c*e)*x^n)*x^(2*n) + 3*(a*b^2*d + a^2*b*e)*x^(2*n) + (3 
*a^2*b*d + a^3*e)*x^n), x)
 

Sympy [F(-1)]

Timed out. \[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\text {Timed out} \] Input:

integrate(1/(d+e*x**n)/(a+b*x**n+c*x**(2*n))**3,x)
 

Output:

Timed out
 

Maxima [F]

\[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\int { \frac {1}{{\left (c x^{2 \, n} + b x^{n} + a\right )}^{3} {\left (e x^{n} + d\right )}} \,d x } \] Input:

integrate(1/(d+e*x^n)/(a+b*x^n+c*x^(2*n))^3,x, algorithm="maxima")
 

Output:

e^6*integrate(1/(c^3*d^7 - 3*b*c^2*d^6*e + 3*b^2*c*d^5*e^2 - b^3*d^4*e^3 + 
 a^3*d*e^6 + 3*(c*d^3*e^4 - b*d^2*e^5)*a^2 + 3*(c^2*d^5*e^2 - 2*b*c*d^4*e^ 
3 + b^2*d^3*e^4)*a + (c^3*d^6*e - 3*b*c^2*d^5*e^2 + 3*b^2*c*d^4*e^3 - b^3* 
d^3*e^4 + a^3*e^7 + 3*(c*d^2*e^5 - b*d*e^6)*a^2 + 3*(c^2*d^4*e^3 - 2*b*c*d 
^3*e^4 + b^2*d^2*e^5)*a)*x^n), x) - 1/2*((4*a^3*c^4*e^3*(7*n - 1) - b^3*c^ 
4*d^3*(2*n - 1) + 2*b^4*c^3*d^2*e*(2*n - 1) - b^5*c^2*d*e^2*(2*n - 1) - (b 
^2*c^3*e^3*(26*n - 5) - 4*c^5*d^2*e*(3*n - 1) - 10*b*c^4*d*e^2*n)*a^2 - (b 
^2*c^4*d^2*e*(28*n - 9) - 2*b*c^5*d^3*(7*n - 2) - 2*b^3*c^3*d*e^2*(5*n - 2 
) - b^4*c^2*e^3*(4*n - 1))*a)*x*x^(3*n) - (2*b^4*c^3*d^3*(2*n - 1) - 4*b^5 
*c^2*d^2*e*(2*n - 1) + 2*b^6*c*d*e^2*(2*n - 1) - 2*(b*c^3*e^3*(37*n - 6) - 
 2*c^4*d*e^2*(8*n - 1))*a^3 - (2*b*c^4*d^2*e*(25*n - 8) + 3*b^2*c^3*d*e^2* 
(5*n + 1) - 11*b^3*c^2*e^3*(5*n - 1) - 4*c^5*d^3*(4*n - 1))*a^2 - (b^2*c^4 
*d^3*(29*n - 9) - 2*b^3*c^3*d^2*e*(29*n - 10) + 3*b^4*c^2*d*e^2*(7*n - 3) 
+ 2*b^5*c*e^3*(4*n - 1))*a)*x*x^(2*n) + (4*a^4*c^3*e^3*(9*n - 1) - b^5*c^2 
*d^3*(2*n - 1) + 2*b^6*c*d^2*e*(2*n - 1) - b^7*d*e^2*(2*n - 1) + (b^2*c^2* 
e^3*(14*n - 3) - 2*b*c^3*d*e^2*(13*n - 2) + 4*c^4*d^2*e*(5*n - 1))*a^3 - ( 
b^4*c*e^3*(24*n - 5) - b^3*c^2*d*e^2*(20*n - 1) - 2*b*c^4*d^3*n + 3*b^2*c^ 
3*d^2*e)*a^2 - (3*b^4*c^2*d^2*e*(8*n - 3) - b^6*e^3*(4*n - 1) - 4*b^3*c^3* 
d^3*(3*n - 1) - 4*b^5*c*d*e^2*(2*n - 1))*a)*x*x^n + (2*(b*c^2*e^3*(29*n - 
4) - 2*c^3*d*e^2*(10*n - 1))*a^4 + (2*b*c^3*d^2*e*(29*n - 6) - 4*c^4*d^...
 

Giac [F]

\[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\int { \frac {1}{{\left (c x^{2 \, n} + b x^{n} + a\right )}^{3} {\left (e x^{n} + d\right )}} \,d x } \] Input:

integrate(1/(d+e*x^n)/(a+b*x^n+c*x^(2*n))^3,x, algorithm="giac")
 

Output:

integrate(1/((c*x^(2*n) + b*x^n + a)^3*(e*x^n + d)), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\int \frac {1}{\left (d+e\,x^n\right )\,{\left (a+b\,x^n+c\,x^{2\,n}\right )}^3} \,d x \] Input:

int(1/((d + e*x^n)*(a + b*x^n + c*x^(2*n))^3),x)
 

Output:

int(1/((d + e*x^n)*(a + b*x^n + c*x^(2*n))^3), x)
 

Reduce [F]

\[ \int \frac {1}{\left (d+e x^n\right ) \left (a+b x^n+c x^{2 n}\right )^3} \, dx=\int \frac {1}{x^{7 n} c^{3} e +3 x^{6 n} b \,c^{2} e +x^{6 n} c^{3} d +3 x^{5 n} a \,c^{2} e +3 x^{5 n} b^{2} c e +3 x^{5 n} b \,c^{2} d +6 x^{4 n} a b c e +3 x^{4 n} a \,c^{2} d +x^{4 n} b^{3} e +3 x^{4 n} b^{2} c d +3 x^{3 n} a^{2} c e +3 x^{3 n} a \,b^{2} e +6 x^{3 n} a b c d +x^{3 n} b^{3} d +3 x^{2 n} a^{2} b e +3 x^{2 n} a^{2} c d +3 x^{2 n} a \,b^{2} d +x^{n} a^{3} e +3 x^{n} a^{2} b d +a^{3} d}d x \] Input:

int(1/(d+e*x^n)/(a+b*x^n+c*x^(2*n))^3,x)
 

Output:

int(1/(x**(7*n)*c**3*e + 3*x**(6*n)*b*c**2*e + x**(6*n)*c**3*d + 3*x**(5*n 
)*a*c**2*e + 3*x**(5*n)*b**2*c*e + 3*x**(5*n)*b*c**2*d + 6*x**(4*n)*a*b*c* 
e + 3*x**(4*n)*a*c**2*d + x**(4*n)*b**3*e + 3*x**(4*n)*b**2*c*d + 3*x**(3* 
n)*a**2*c*e + 3*x**(3*n)*a*b**2*e + 6*x**(3*n)*a*b*c*d + x**(3*n)*b**3*d + 
 3*x**(2*n)*a**2*b*e + 3*x**(2*n)*a**2*c*d + 3*x**(2*n)*a*b**2*d + x**n*a* 
*3*e + 3*x**n*a**2*b*d + a**3*d),x)