Integrand size = 32, antiderivative size = 636 \[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\frac {(C d (4+n+2 p)-c D (6+n+4 p)) (c+d x)^{1+n} \left (a+b x^2\right )^{1+p}}{b d^2 (3+n+2 p) (4+n+2 p)}+\frac {D (c+d x)^{2+n} \left (a+b x^2\right )^{1+p}}{b d^2 (4+n+2 p)}-\frac {\left (a (1+n) (C d (4+n+2 p)-c D (6+n+4 p))-\frac {b \left (2 c^2 C d (1+p) (4+n+2 p)-2 c^3 D \left (3+5 p+2 p^2\right )-B c d^2 \left (12+7 n+n^2+14 p+4 n p+4 p^2\right )+A d^3 \left (12+7 n+n^2+14 p+4 n p+4 p^2\right )\right )}{d^2}\right ) (c+d x)^{1+n} \left (a+b x^2\right )^p \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \left (1-\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \operatorname {AppellF1}\left (1+n,-p,-p,2+n,\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}},\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right )}{b d^2 (1+n) (3+n+2 p) (4+n+2 p)}-\frac {\left (a d^2 D (2+n) (3+n+2 p)+b \left (2 c C d (1+p) (4+n+2 p)-2 c^2 D \left (3+5 p+2 p^2\right )-B d^2 \left (12+7 n+n^2+14 p+4 n p+4 p^2\right )\right )\right ) (c+d x)^{2+n} \left (a+b x^2\right )^p \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \left (1-\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \operatorname {AppellF1}\left (2+n,-p,-p,3+n,\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}},\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right )}{b d^4 (2+n) (3+n+2 p) (4+n+2 p)} \] Output:
(C*d*(4+n+2*p)-c*D*(6+n+4*p))*(d*x+c)^(1+n)*(b*x^2+a)^(p+1)/b/d^2/(3+n+2*p )/(4+n+2*p)+D*(d*x+c)^(2+n)*(b*x^2+a)^(p+1)/b/d^2/(4+n+2*p)-(a*(1+n)*(C*d* (4+n+2*p)-c*D*(6+n+4*p))-b*(2*c^2*C*d*(p+1)*(4+n+2*p)-2*c^3*D*(2*p^2+5*p+3 )-B*c*d^2*(n^2+4*n*p+4*p^2+7*n+14*p+12)+A*d^3*(n^2+4*n*p+4*p^2+7*n+14*p+12 ))/d^2)*(d*x+c)^(1+n)*(b*x^2+a)^p*AppellF1(1+n,-p,-p,2+n,(d*x+c)/(c-(-a)^( 1/2)*d/b^(1/2)),(d*x+c)/(c+(-a)^(1/2)*d/b^(1/2)))/b/d^2/(1+n)/(3+n+2*p)/(4 +n+2*p)/((1-(d*x+c)/(c-(-a)^(1/2)*d/b^(1/2)))^p)/((1-(d*x+c)/(c+(-a)^(1/2) *d/b^(1/2)))^p)-(a*d^2*D*(2+n)*(3+n+2*p)+b*(2*c*C*d*(p+1)*(4+n+2*p)-2*c^2* D*(2*p^2+5*p+3)-B*d^2*(n^2+4*n*p+4*p^2+7*n+14*p+12)))*(d*x+c)^(2+n)*(b*x^2 +a)^p*AppellF1(2+n,-p,-p,3+n,(d*x+c)/(c-(-a)^(1/2)*d/b^(1/2)),(d*x+c)/(c+( -a)^(1/2)*d/b^(1/2)))/b/d^4/(2+n)/(3+n+2*p)/(4+n+2*p)/((1-(d*x+c)/(c-(-a)^ (1/2)*d/b^(1/2)))^p)/((1-(d*x+c)/(c+(-a)^(1/2)*d/b^(1/2)))^p)
\[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx \] Input:
Integrate[(c + d*x)^n*(a + b*x^2)^p*(A + B*x + C*x^2 + D*x^3),x]
Output:
Integrate[(c + d*x)^n*(a + b*x^2)^p*(A + B*x + C*x^2 + D*x^3), x]
Time = 1.17 (sec) , antiderivative size = 615, normalized size of antiderivative = 0.97, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2185, 25, 2185, 25, 27, 719, 514, 150}
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 \left (a+b x^2\right )^p (c+d x)^n \left (A+B x+C x^2+D x^3\right ) \, dx\) |
\(\Big \downarrow \) 2185 |
\(\displaystyle \frac {\int -(c+d x)^n \left (b x^2+a\right )^p \left (-b (C d (n+2 p+4)-c D (n+4 p+6)) x^2 d^2+(a c D (n+2)-A b d (n+2 p+4)) d^2+\left (2 b D (p+1) c^2+a d^2 D (n+2)-b B d^2 (n+2 p+4)\right ) x d\right )dx}{b d^3 (n+2 p+4)}+\frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {\int (c+d x)^n \left (b x^2+a\right )^p \left (-b (C d (n+2 p+4)-c D (n+4 p+6)) x^2 d^2+(a c D (n+2)-A b d (n+2 p+4)) d^2+\left (2 b D (p+1) c^2+a d^2 D (n+2)-b B d^2 (n+2 p+4)\right ) x d\right )dx}{b d^3 (n+2 p+4)}\) |
\(\Big \downarrow \) 2185 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {\frac {\int -b d^3 (c+d x)^n \left (d \left (2 a c D n (p+1)-a C d (n+1) (n+2 p+4)+A b d \left (n^2+4 p n+7 n+4 p^2+14 p+12\right )\right )-\left (a D (n+2) (n+2 p+3) d^2+b \left (-2 D \left (2 p^2+5 p+3\right ) c^2+2 C d (p+1) (n+2 p+4) c-B d^2 \left (n^2+4 p n+7 n+4 p^2+14 p+12\right )\right )\right ) x\right ) \left (b x^2+a\right )^pdx}{b d^2 (n+2 p+3)}-\frac {d \left (a+b x^2\right )^{p+1} (c+d x)^{n+1} (C d (n+2 p+4)-c D (n+4 p+6))}{n+2 p+3}}{b d^3 (n+2 p+4)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {-\frac {\int b d^3 (c+d x)^n \left (d \left (2 a c D n (p+1)-a C d (n+1) (n+2 p+4)+A b d \left (n^2+4 p n+7 n+4 p^2+14 p+12\right )\right )-\left (a D (n+2) (n+2 p+3) d^2+b \left (-2 D \left (2 p^2+5 p+3\right ) c^2+2 C d (p+1) (n+2 p+4) c-B d^2 \left (n^2+4 p n+7 n+4 p^2+14 p+12\right )\right )\right ) x\right ) \left (b x^2+a\right )^pdx}{b d^2 (n+2 p+3)}-\frac {d \left (a+b x^2\right )^{p+1} (c+d x)^{n+1} (C d (n+2 p+4)-c D (n+4 p+6))}{n+2 p+3}}{b d^3 (n+2 p+4)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {-\frac {d \int (c+d x)^n \left (d \left (2 a c D n (p+1)-a C d (n+1) (n+2 p+4)+A b d \left (n^2+4 p n+7 n+4 p^2+14 p+12\right )\right )-\left (a D (n+2) (n+2 p+3) d^2+b \left (-2 D \left (2 p^2+5 p+3\right ) c^2+2 C d (p+1) (n+2 p+4) c-B d^2 \left (n^2+4 p n+7 n+4 p^2+14 p+12\right )\right )\right ) x\right ) \left (b x^2+a\right )^pdx}{n+2 p+3}-\frac {d \left (a+b x^2\right )^{p+1} (c+d x)^{n+1} (C d (n+2 p+4)-c D (n+4 p+6))}{n+2 p+3}}{b d^3 (n+2 p+4)}\) |
\(\Big \downarrow \) 719 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {-\frac {d \left (-\frac {\left (a d^2 (n+1) (C d (n+2 p+4)-c D (n+4 p+6))-b \left (A d^3 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-B c d^2 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-2 c^3 D \left (2 p^2+5 p+3\right )+2 c^2 C d (p+1) (n+2 p+4)\right )\right ) \int (c+d x)^n \left (b x^2+a\right )^pdx}{d}-\frac {\left (a d^2 D (n+2) (n+2 p+3)+b \left (-B d^2 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-2 c^2 D \left (2 p^2+5 p+3\right )+2 c C d (p+1) (n+2 p+4)\right )\right ) \int (c+d x)^{n+1} \left (b x^2+a\right )^pdx}{d}\right )}{n+2 p+3}-\frac {d \left (a+b x^2\right )^{p+1} (c+d x)^{n+1} (C d (n+2 p+4)-c D (n+4 p+6))}{n+2 p+3}}{b d^3 (n+2 p+4)}\) |
\(\Big \downarrow \) 514 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {-\frac {d \left (-\frac {\left (a+b x^2\right )^p \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \left (1-\frac {c+d x}{\frac {\sqrt {-a} d}{\sqrt {b}}+c}\right )^{-p} \left (a d^2 (n+1) (C d (n+2 p+4)-c D (n+4 p+6))-b \left (A d^3 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-B c d^2 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-2 c^3 D \left (2 p^2+5 p+3\right )+2 c^2 C d (p+1) (n+2 p+4)\right )\right ) \int (c+d x)^n \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^p \left (1-\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^pd(c+d x)}{d^2}-\frac {\left (a+b x^2\right )^p \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \left (1-\frac {c+d x}{\frac {\sqrt {-a} d}{\sqrt {b}}+c}\right )^{-p} \left (a d^2 D (n+2) (n+2 p+3)+b \left (-B d^2 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-2 c^2 D \left (2 p^2+5 p+3\right )+2 c C d (p+1) (n+2 p+4)\right )\right ) \int (c+d x)^{n+1} \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^p \left (1-\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^pd(c+d x)}{d^2}\right )}{n+2 p+3}-\frac {d \left (a+b x^2\right )^{p+1} (c+d x)^{n+1} (C d (n+2 p+4)-c D (n+4 p+6))}{n+2 p+3}}{b d^3 (n+2 p+4)}\) |
\(\Big \downarrow \) 150 |
\(\displaystyle \frac {D \left (a+b x^2\right )^{p+1} (c+d x)^{n+2}}{b d^2 (n+2 p+4)}-\frac {-\frac {d \left (-\frac {\left (a+b x^2\right )^p (c+d x)^{n+1} \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \left (1-\frac {c+d x}{\frac {\sqrt {-a} d}{\sqrt {b}}+c}\right )^{-p} \operatorname {AppellF1}\left (n+1,-p,-p,n+2,\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}},\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right ) \left (a d^2 (n+1) (C d (n+2 p+4)-c D (n+4 p+6))-b \left (A d^3 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-B c d^2 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-2 c^3 D \left (2 p^2+5 p+3\right )+2 c^2 C d (p+1) (n+2 p+4)\right )\right )}{d^2 (n+1)}-\frac {\left (a+b x^2\right )^p (c+d x)^{n+2} \left (1-\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}}\right )^{-p} \left (1-\frac {c+d x}{\frac {\sqrt {-a} d}{\sqrt {b}}+c}\right )^{-p} \operatorname {AppellF1}\left (n+2,-p,-p,n+3,\frac {c+d x}{c-\frac {\sqrt {-a} d}{\sqrt {b}}},\frac {c+d x}{c+\frac {\sqrt {-a} d}{\sqrt {b}}}\right ) \left (a d^2 D (n+2) (n+2 p+3)+b \left (-B d^2 \left (n^2+4 n p+7 n+4 p^2+14 p+12\right )-2 c^2 D \left (2 p^2+5 p+3\right )+2 c C d (p+1) (n+2 p+4)\right )\right )}{d^2 (n+2)}\right )}{n+2 p+3}-\frac {d \left (a+b x^2\right )^{p+1} (c+d x)^{n+1} (C d (n+2 p+4)-c D (n+4 p+6))}{n+2 p+3}}{b d^3 (n+2 p+4)}\) |
Input:
Int[(c + d*x)^n*(a + b*x^2)^p*(A + B*x + C*x^2 + D*x^3),x]
Output:
(D*(c + d*x)^(2 + n)*(a + b*x^2)^(1 + p))/(b*d^2*(4 + n + 2*p)) - (-((d*(C *d*(4 + n + 2*p) - c*D*(6 + n + 4*p))*(c + d*x)^(1 + n)*(a + b*x^2)^(1 + p ))/(3 + n + 2*p)) - (d*(-(((a*d^2*(1 + n)*(C*d*(4 + n + 2*p) - c*D*(6 + n + 4*p)) - b*(2*c^2*C*d*(1 + p)*(4 + n + 2*p) - 2*c^3*D*(3 + 5*p + 2*p^2) - B*c*d^2*(12 + 7*n + n^2 + 14*p + 4*n*p + 4*p^2) + A*d^3*(12 + 7*n + n^2 + 14*p + 4*n*p + 4*p^2)))*(c + d*x)^(1 + n)*(a + b*x^2)^p*AppellF1[1 + n, - p, -p, 2 + n, (c + d*x)/(c - (Sqrt[-a]*d)/Sqrt[b]), (c + d*x)/(c + (Sqrt[- a]*d)/Sqrt[b])])/(d^2*(1 + n)*(1 - (c + d*x)/(c - (Sqrt[-a]*d)/Sqrt[b]))^p *(1 - (c + d*x)/(c + (Sqrt[-a]*d)/Sqrt[b]))^p)) - ((a*d^2*D*(2 + n)*(3 + n + 2*p) + b*(2*c*C*d*(1 + p)*(4 + n + 2*p) - 2*c^2*D*(3 + 5*p + 2*p^2) - B *d^2*(12 + 7*n + n^2 + 14*p + 4*n*p + 4*p^2)))*(c + d*x)^(2 + n)*(a + b*x^ 2)^p*AppellF1[2 + n, -p, -p, 3 + n, (c + d*x)/(c - (Sqrt[-a]*d)/Sqrt[b]), (c + d*x)/(c + (Sqrt[-a]*d)/Sqrt[b])])/(d^2*(2 + n)*(1 - (c + d*x)/(c - (S qrt[-a]*d)/Sqrt[b]))^p*(1 - (c + d*x)/(c + (Sqrt[-a]*d)/Sqrt[b]))^p)))/(3 + n + 2*p))/(b*d^3*(4 + n + 2*p))
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_ ] :> Simp[c^n*e^p*((b*x)^(m + 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2 , (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p}, x] && !In tegerQ[m] && !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[ {q = Rt[-a/b, 2]}, Simp[(a + b*x^2)^p/(d*(1 - (c + d*x)/(c - d*q))^p*(1 - ( c + d*x)/(c + d*q))^p) Subst[Int[x^n*Simp[1 - x/(c + d*q), x]^p*Simp[1 - x/(c - d*q), x]^p, x], x, c + d*x], x]] /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c^2 + a*d^2, 0]
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p _.), x_Symbol] :> Simp[g/e Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Simp[(e*f - d*g)/e Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m, p}, x] && !IGtQ[m, 0]
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] : > With[{q = Expon[Pq, x], f = Coeff[Pq, x, Expon[Pq, x]]}, Simp[f*(d + e*x) ^(m + q - 1)*((a + b*x^2)^(p + 1)/(b*e^(q - 1)*(m + q + 2*p + 1))), x] + Si mp[1/(b*e^q*(m + q + 2*p + 1)) Int[(d + e*x)^m*(a + b*x^2)^p*ExpandToSum[ b*e^q*(m + q + 2*p + 1)*Pq - b*f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x )^(q - 2)*(a*e^2*(m + q - 1) - b*d^2*(m + q + 2*p + 1) - 2*b*d*e*(m + q + p )*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, d , e, m, p}, x] && PolyQ[Pq, x] && NeQ[b*d^2 + a*e^2, 0] && !(EqQ[d, 0] && True) && !(IGtQ[m, 0] && RationalQ[a, b, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))
\[\int \left (d x +c \right )^{n} \left (b \,x^{2}+a \right )^{p} \left (D x^{3}+C \,x^{2}+B x +A \right )d x\]
Input:
int((d*x+c)^n*(b*x^2+a)^p*(D*x^3+C*x^2+B*x+A),x)
Output:
int((d*x+c)^n*(b*x^2+a)^p*(D*x^3+C*x^2+B*x+A),x)
\[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\int { {\left (D x^{3} + C x^{2} + B x + A\right )} {\left (b x^{2} + a\right )}^{p} {\left (d x + c\right )}^{n} \,d x } \] Input:
integrate((d*x+c)^n*(b*x^2+a)^p*(D*x^3+C*x^2+B*x+A),x, algorithm="fricas")
Output:
integral((D*x^3 + C*x^2 + B*x + A)*(b*x^2 + a)^p*(d*x + c)^n, x)
Timed out. \[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\text {Timed out} \] Input:
integrate((d*x+c)**n*(b*x**2+a)**p*(D*x**3+C*x**2+B*x+A),x)
Output:
Timed out
\[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\int { {\left (D x^{3} + C x^{2} + B x + A\right )} {\left (b x^{2} + a\right )}^{p} {\left (d x + c\right )}^{n} \,d x } \] Input:
integrate((d*x+c)^n*(b*x^2+a)^p*(D*x^3+C*x^2+B*x+A),x, algorithm="maxima")
Output:
integrate((D*x^3 + C*x^2 + B*x + A)*(b*x^2 + a)^p*(d*x + c)^n, x)
\[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\int { {\left (D x^{3} + C x^{2} + B x + A\right )} {\left (b x^{2} + a\right )}^{p} {\left (d x + c\right )}^{n} \,d x } \] Input:
integrate((d*x+c)^n*(b*x^2+a)^p*(D*x^3+C*x^2+B*x+A),x, algorithm="giac")
Output:
integrate((D*x^3 + C*x^2 + B*x + A)*(b*x^2 + a)^p*(d*x + c)^n, x)
Timed out. \[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\int {\left (b\,x^2+a\right )}^p\,{\left (c+d\,x\right )}^n\,\left (A+B\,x+C\,x^2+x^3\,D\right ) \,d x \] Input:
int((a + b*x^2)^p*(c + d*x)^n*(A + B*x + C*x^2 + x^3*D),x)
Output:
int((a + b*x^2)^p*(c + d*x)^n*(A + B*x + C*x^2 + x^3*D), x)
\[ \int (c+d x)^n \left (a+b x^2\right )^p \left (A+B x+C x^2+D x^3\right ) \, dx=\text {too large to display} \] Input:
int((d*x+c)^n*(b*x^2+a)^p*(D*x^3+C*x^2+B*x+A),x)
Output:
((c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3*n**3 + 6*(c + d*x)**n*(a + b*x** 2)**p*a**2*b*d**3*n**2*p + 9*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3*n**2 + 12*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3*n*p**2 + 36*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3*n*p + 26*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d** 3*n + 8*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3*p**3 + 36*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3*p**2 + 52*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d* *3*p + 24*(c + d*x)**n*(a + b*x**2)**p*a**2*b*d**3 - 3*(c + d*x)**n*(a + b *x**2)**p*a**2*c*d**3*n**3 - 8*(c + d*x)**n*(a + b*x**2)**p*a**2*c*d**3*n* *2*p - 16*(c + d*x)**n*(a + b*x**2)**p*a**2*c*d**3*n**2 - 4*(c + d*x)**n*( a + b*x**2)**p*a**2*c*d**3*n*p**2 - 28*(c + d*x)**n*(a + b*x**2)**p*a**2*c *d**3*n*p - 27*(c + d*x)**n*(a + b*x**2)**p*a**2*c*d**3*n - 12*(c + d*x)** n*(a + b*x**2)**p*a**2*c*d**3*p**2 - 28*(c + d*x)**n*(a + b*x**2)**p*a**2* c*d**3*p - 14*(c + d*x)**n*(a + b*x**2)**p*a**2*c*d**3 + (c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d**2*n**3*x + 2*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c *d**2*n**3 + 6*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d**2*n**2*p*x + 10*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d**2*n**2*p + 9*(c + d*x)**n*(a + b*x* *2)**p*a*b**2*c*d**2*n**2*x + 15*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d** 2*n**2 + 12*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d**2*n*p**2*x + 16*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d**2*n*p**2 + 36*(c + d*x)**n*(a + b*x**2 )**p*a*b**2*c*d**2*n*p*x + 46*(c + d*x)**n*(a + b*x**2)**p*a*b**2*c*d**...