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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [B] (verification not implemented)
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 20, antiderivative size = 114 \[ \int \frac {(c+d x)^n \left (a+b x^2\right )^2}{x^2} \, dx=\frac {b \left (b c^2+2 a d^2\right ) (c+d x)^{1+n}}{d^3 (1+n)}-\frac {2 b^2 c (c+d x)^{2+n}}{d^3 (2+n)}+\frac {b^2 (c+d x)^{3+n}}{d^3 (3+n)}+\frac {a^2 d (c+d x)^{1+n} \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,1+\frac {d x}{c}\right )}{c^2 (1+n)} \] Output:

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

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.00 \[ \int \frac {(c+d x)^n \left (a+b x^2\right )^2}{x^2} \, dx=\frac {b \left (b c^2+2 a d^2\right ) (c+d x)^{1+n}}{d^3 (1+n)}-\frac {2 b^2 c (c+d x)^{2+n}}{d^3 (2+n)}+\frac {b^2 (c+d x)^{3+n}}{d^3 (3+n)}+\frac {a^2 d (c+d x)^{1+n} \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,1+\frac {d x}{c}\right )}{c^2 (1+n)} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.27, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {520, 25, 2123, 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 {\left (a+b x^2\right )^2 (c+d x)^n}{x^2} \, dx\)

\(\Big \downarrow \) 520

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2123

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {a^2 d n (c+d x)^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {d x}{c}+1\right )}{c (n+1)}+\frac {b c \left (2 a d^2+b c^2\right ) (c+d x)^{n+1}}{d^3 (n+1)}-\frac {2 b^2 c^2 (c+d x)^{n+2}}{d^3 (n+2)}+\frac {b^2 c (c+d x)^{n+3}}{d^3 (n+3)}}{c}-\frac {a^2 (c+d x)^{n+1}}{c x}\)

Input:

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

Output:

-((a^2*(c + d*x)^(1 + n))/(c*x)) + ((b*c*(b*c^2 + 2*a*d^2)*(c + d*x)^(1 + 
n))/(d^3*(1 + n)) - (2*b^2*c^2*(c + d*x)^(2 + n))/(d^3*(2 + n)) + (b^2*c*( 
c + d*x)^(3 + n))/(d^3*(3 + n)) - (a^2*d*n*(c + d*x)^(1 + n)*Hypergeometri 
c2F1[1, 1 + n, 2 + n, 1 + (d*x)/c])/(c*(1 + n)))/c
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 520
Int[((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_.), 
 x_Symbol] :> With[{Qx = PolynomialQuotient[(a + b*x^2)^p, e*x, x], R = Pol 
ynomialRemainder[(a + b*x^2)^p, e*x, x]}, Simp[R*(e*x)^(m + 1)*((c + d*x)^( 
n + 1)/((m + 1)*(e*c))), x] + Simp[1/((m + 1)*(e*c))   Int[(e*x)^(m + 1)*(c 
 + d*x)^n*ExpandToSum[(m + 1)*(e*c)*Qx - d*R*(m + n + 2), x], x], x]] /; Fr 
eeQ[{a, b, c, d, e, n}, x] && IGtQ[p, 0] && LtQ[m, -1] &&  !IntegerQ[n]
 

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

rule 2123
Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] 
:> Int[ExpandIntegrand[Px*(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c 
, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2])
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 600 vs. \(2 (100) = 200\).

Time = 2.34 (sec) , antiderivative size = 785, normalized size of antiderivative = 6.89 \[ \int \frac {(c+d x)^n \left (a+b x^2\right )^2}{x^2} \, dx =\text {Too large to display} \] Input:

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

Output:

-a**2*d**(n + 2)*n*(c/d + x)**(n + 1)*gamma(n + 1)/(c*d*x*gamma(n + 2)) - 
a**2*d**(n + 2)*(c/d + x)**(n + 1)*gamma(n + 1)/(c*d*x*gamma(n + 2)) - a** 
2*d**(n + 2)*n**2*(c/d + x)**(n + 1)*lerchphi(1 + d*x/c, 1, n + 1)*gamma(n 
 + 1)/(c**2*gamma(n + 2)) - a**2*d**(n + 2)*n*(c/d + x)**(n + 1)*lerchphi( 
1 + d*x/c, 1, n + 1)*gamma(n + 1)/(c**2*gamma(n + 2)) + 2*a*b*Piecewise((c 
**n*x, Eq(d, 0)), (Piecewise(((c + d*x)**(n + 1)/(n + 1), Ne(n, -1)), (log 
(c + d*x), True))/d, True)) + b**2*Piecewise((c**n*x**3/3, Eq(d, 0)), (2*c 
**2*log(c/d + x)/(2*c**2*d**3 + 4*c*d**4*x + 2*d**5*x**2) + 3*c**2/(2*c**2 
*d**3 + 4*c*d**4*x + 2*d**5*x**2) + 4*c*d*x*log(c/d + x)/(2*c**2*d**3 + 4* 
c*d**4*x + 2*d**5*x**2) + 4*c*d*x/(2*c**2*d**3 + 4*c*d**4*x + 2*d**5*x**2) 
 + 2*d**2*x**2*log(c/d + x)/(2*c**2*d**3 + 4*c*d**4*x + 2*d**5*x**2), Eq(n 
, -3)), (-2*c**2*log(c/d + x)/(c*d**3 + d**4*x) - 2*c**2/(c*d**3 + d**4*x) 
 - 2*c*d*x*log(c/d + x)/(c*d**3 + d**4*x) + d**2*x**2/(c*d**3 + d**4*x), E 
q(n, -2)), (c**2*log(c/d + x)/d**3 - c*x/d**2 + x**2/(2*d), Eq(n, -1)), (2 
*c**3*(c + d*x)**n/(d**3*n**3 + 6*d**3*n**2 + 11*d**3*n + 6*d**3) - 2*c**2 
*d*n*x*(c + d*x)**n/(d**3*n**3 + 6*d**3*n**2 + 11*d**3*n + 6*d**3) + c*d** 
2*n**2*x**2*(c + d*x)**n/(d**3*n**3 + 6*d**3*n**2 + 11*d**3*n + 6*d**3) + 
c*d**2*n*x**2*(c + d*x)**n/(d**3*n**3 + 6*d**3*n**2 + 11*d**3*n + 6*d**3) 
+ d**3*n**2*x**3*(c + d*x)**n/(d**3*n**3 + 6*d**3*n**2 + 11*d**3*n + 6*d** 
3) + 3*d**3*n*x**3*(c + d*x)**n/(d**3*n**3 + 6*d**3*n**2 + 11*d**3*n + ...
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {(c+d x)^n \left (a+b x^2\right )^2}{x^2} \, dx=\frac {-\left (d x +c \right )^{n} a^{2} d^{3} n^{3}-6 \left (d x +c \right )^{n} a^{2} d^{3} n^{2}-11 \left (d x +c \right )^{n} a^{2} d^{3} n -6 \left (d x +c \right )^{n} a^{2} d^{3}+2 \left (d x +c \right )^{n} a b c \,d^{2} n^{2} x +10 \left (d x +c \right )^{n} a b c \,d^{2} n x +12 \left (d x +c \right )^{n} a b c \,d^{2} x +2 \left (d x +c \right )^{n} a b \,d^{3} n^{2} x^{2}+10 \left (d x +c \right )^{n} a b \,d^{3} n \,x^{2}+12 \left (d x +c \right )^{n} a b \,d^{3} x^{2}+2 \left (d x +c \right )^{n} b^{2} c^{3} x -2 \left (d x +c \right )^{n} b^{2} c^{2} d n \,x^{2}+\left (d x +c \right )^{n} b^{2} c \,d^{2} n^{2} x^{3}+\left (d x +c \right )^{n} b^{2} c \,d^{2} n \,x^{3}+\left (d x +c \right )^{n} b^{2} d^{3} n^{2} x^{4}+3 \left (d x +c \right )^{n} b^{2} d^{3} n \,x^{4}+2 \left (d x +c \right )^{n} b^{2} d^{3} x^{4}+\left (\int \frac {\left (d x +c \right )^{n}}{d \,x^{2}+c x}d x \right ) a^{2} d^{4} n^{4} x +6 \left (\int \frac {\left (d x +c \right )^{n}}{d \,x^{2}+c x}d x \right ) a^{2} d^{4} n^{3} x +11 \left (\int \frac {\left (d x +c \right )^{n}}{d \,x^{2}+c x}d x \right ) a^{2} d^{4} n^{2} x +6 \left (\int \frac {\left (d x +c \right )^{n}}{d \,x^{2}+c x}d x \right ) a^{2} d^{4} n x}{d^{3} x \left (n^{3}+6 n^{2}+11 n +6\right )} \] Input:

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

Output:

( - (c + d*x)**n*a**2*d**3*n**3 - 6*(c + d*x)**n*a**2*d**3*n**2 - 11*(c + 
d*x)**n*a**2*d**3*n - 6*(c + d*x)**n*a**2*d**3 + 2*(c + d*x)**n*a*b*c*d**2 
*n**2*x + 10*(c + d*x)**n*a*b*c*d**2*n*x + 12*(c + d*x)**n*a*b*c*d**2*x + 
2*(c + d*x)**n*a*b*d**3*n**2*x**2 + 10*(c + d*x)**n*a*b*d**3*n*x**2 + 12*( 
c + d*x)**n*a*b*d**3*x**2 + 2*(c + d*x)**n*b**2*c**3*x - 2*(c + d*x)**n*b* 
*2*c**2*d*n*x**2 + (c + d*x)**n*b**2*c*d**2*n**2*x**3 + (c + d*x)**n*b**2* 
c*d**2*n*x**3 + (c + d*x)**n*b**2*d**3*n**2*x**4 + 3*(c + d*x)**n*b**2*d** 
3*n*x**4 + 2*(c + d*x)**n*b**2*d**3*x**4 + int((c + d*x)**n/(c*x + d*x**2) 
,x)*a**2*d**4*n**4*x + 6*int((c + d*x)**n/(c*x + d*x**2),x)*a**2*d**4*n**3 
*x + 11*int((c + d*x)**n/(c*x + d*x**2),x)*a**2*d**4*n**2*x + 6*int((c + d 
*x)**n/(c*x + d*x**2),x)*a**2*d**4*n*x)/(d**3*x*(n**3 + 6*n**2 + 11*n + 6) 
)