\(\int x^2 (a+b \tan (c+d \sqrt {x}))^2 \, dx\) [31]

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

Optimal result

Integrand size = 20, antiderivative size = 402 \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=-\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {30 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {15 b^2 \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {30 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {15 i a b \operatorname {PolyLog}\left (6,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d} \] Output:

15*I*a*b*polylog(6,-exp(2*I*(c+d*x^(1/2))))/d^6+1/3*a^2*x^3+10*I*a*b*x^2*p 
olylog(2,-exp(2*I*(c+d*x^(1/2))))/d^2-1/3*b^2*x^3+10*b^2*x^2*ln(1+exp(2*I* 
(c+d*x^(1/2))))/d^2-4*a*b*x^(5/2)*ln(1+exp(2*I*(c+d*x^(1/2))))/d-20*I*b^2* 
x^(3/2)*polylog(2,-exp(2*I*(c+d*x^(1/2))))/d^3-30*I*a*b*x*polylog(4,-exp(2 
*I*(c+d*x^(1/2))))/d^4+30*b^2*x*polylog(3,-exp(2*I*(c+d*x^(1/2))))/d^4-20* 
a*b*x^(3/2)*polylog(3,-exp(2*I*(c+d*x^(1/2))))/d^3+30*I*b^2*x^(1/2)*polylo 
g(4,-exp(2*I*(c+d*x^(1/2))))/d^5+2/3*I*a*b*x^3-15*b^2*polylog(5,-exp(2*I*( 
c+d*x^(1/2))))/d^6+30*a*b*x^(1/2)*polylog(5,-exp(2*I*(c+d*x^(1/2))))/d^5-2 
*I*b^2*x^(5/2)/d+2*b^2*x^(5/2)*tan(c+d*x^(1/2))/d
 

Mathematica [A] (verified)

Time = 3.40 (sec) , antiderivative size = 567, normalized size of antiderivative = 1.41 \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {1}{3} \left (-\frac {i b e^{2 i c} \left (-12 b d^5 e^{-2 i c} x^{5/2}+4 a d^6 e^{-2 i c} x^3+30 i b d^4 e^{-2 i c} \left (1+e^{2 i c}\right ) x^2 \log \left (1+e^{-2 i \left (c+d \sqrt {x}\right )}\right )-12 i a d^5 e^{-2 i c} \left (1+e^{2 i c}\right ) x^{5/2} \log \left (1+e^{-2 i \left (c+d \sqrt {x}\right )}\right )-60 b d^3 \left (1+e^{-2 i c}\right ) x^{3/2} \operatorname {PolyLog}\left (2,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+30 a d^4 \left (1+e^{-2 i c}\right ) x^2 \operatorname {PolyLog}\left (2,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+90 i b d^2 e^{-2 i c} \left (1+e^{2 i c}\right ) x \operatorname {PolyLog}\left (3,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )-60 i a d^3 e^{-2 i c} \left (1+e^{2 i c}\right ) x^{3/2} \operatorname {PolyLog}\left (3,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+90 b d \left (1+e^{-2 i c}\right ) \sqrt {x} \operatorname {PolyLog}\left (4,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )-90 a d^2 \left (1+e^{-2 i c}\right ) x \operatorname {PolyLog}\left (4,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )-45 i b e^{-2 i c} \left (1+e^{2 i c}\right ) \operatorname {PolyLog}\left (5,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+90 i a d e^{-2 i c} \left (1+e^{2 i c}\right ) \sqrt {x} \operatorname {PolyLog}\left (5,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+45 a \left (1+e^{-2 i c}\right ) \operatorname {PolyLog}\left (6,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )\right )}{d^6 \left (1+e^{2 i c}\right )}+\frac {6 b^2 x^{5/2} \sec (c) \sec \left (c+d \sqrt {x}\right ) \sin \left (d \sqrt {x}\right )}{d}+x^3 \left (a^2-b^2+2 a b \tan (c)\right )\right ) \] Input:

Integrate[x^2*(a + b*Tan[c + d*Sqrt[x]])^2,x]
 

Output:

(((-I)*b*E^((2*I)*c)*((-12*b*d^5*x^(5/2))/E^((2*I)*c) + (4*a*d^6*x^3)/E^(( 
2*I)*c) + ((30*I)*b*d^4*(1 + E^((2*I)*c))*x^2*Log[1 + E^((-2*I)*(c + d*Sqr 
t[x]))])/E^((2*I)*c) - ((12*I)*a*d^5*(1 + E^((2*I)*c))*x^(5/2)*Log[1 + E^( 
(-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) - 60*b*d^3*(1 + E^((-2*I)*c))*x^(3/2 
)*PolyLog[2, -E^((-2*I)*(c + d*Sqrt[x]))] + 30*a*d^4*(1 + E^((-2*I)*c))*x^ 
2*PolyLog[2, -E^((-2*I)*(c + d*Sqrt[x]))] + ((90*I)*b*d^2*(1 + E^((2*I)*c) 
)*x*PolyLog[3, -E^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) - ((60*I)*a*d^3*( 
1 + E^((2*I)*c))*x^(3/2)*PolyLog[3, -E^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I) 
*c) + 90*b*d*(1 + E^((-2*I)*c))*Sqrt[x]*PolyLog[4, -E^((-2*I)*(c + d*Sqrt[ 
x]))] - 90*a*d^2*(1 + E^((-2*I)*c))*x*PolyLog[4, -E^((-2*I)*(c + d*Sqrt[x] 
))] - ((45*I)*b*(1 + E^((2*I)*c))*PolyLog[5, -E^((-2*I)*(c + d*Sqrt[x]))]) 
/E^((2*I)*c) + ((90*I)*a*d*(1 + E^((2*I)*c))*Sqrt[x]*PolyLog[5, -E^((-2*I) 
*(c + d*Sqrt[x]))])/E^((2*I)*c) + 45*a*(1 + E^((-2*I)*c))*PolyLog[6, -E^(( 
-2*I)*(c + d*Sqrt[x]))]))/(d^6*(1 + E^((2*I)*c))) + (6*b^2*x^(5/2)*Sec[c]* 
Sec[c + d*Sqrt[x]]*Sin[d*Sqrt[x]])/d + x^3*(a^2 - b^2 + 2*a*b*Tan[c]))/3
 

Rubi [A] (verified)

Time = 0.82 (sec) , antiderivative size = 407, normalized size of antiderivative = 1.01, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4234, 3042, 4205, 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 x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4234

\(\displaystyle 2 \int x^{5/2} \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2d\sqrt {x}\)

\(\Big \downarrow \) 3042

\(\displaystyle 2 \int x^{5/2} \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2d\sqrt {x}\)

\(\Big \downarrow \) 4205

\(\displaystyle 2 \int \left (a^2 x^{5/2}+b^2 \tan ^2\left (c+d \sqrt {x}\right ) x^{5/2}+2 a b \tan \left (c+d \sqrt {x}\right ) x^{5/2}\right )d\sqrt {x}\)

\(\Big \downarrow \) 2009

\(\displaystyle 2 \left (\frac {a^2 x^3}{6}+\frac {15 i a b \operatorname {PolyLog}\left (6,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{2 d^6}+\frac {15 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {15 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {10 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {5 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {2 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {1}{3} i a b x^3-\frac {15 b^2 \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{2 d^6}+\frac {15 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {15 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {10 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {5 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {i b^2 x^{5/2}}{d}-\frac {b^2 x^3}{6}\right )\)

Input:

Int[x^2*(a + b*Tan[c + d*Sqrt[x]])^2,x]
 

Output:

2*(((-I)*b^2*x^(5/2))/d + (a^2*x^3)/6 + (I/3)*a*b*x^3 - (b^2*x^3)/6 + (5*b 
^2*x^2*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d^2 - (2*a*b*x^(5/2)*Log[1 + E^ 
((2*I)*(c + d*Sqrt[x]))])/d - ((10*I)*b^2*x^(3/2)*PolyLog[2, -E^((2*I)*(c 
+ d*Sqrt[x]))])/d^3 + ((5*I)*a*b*x^2*PolyLog[2, -E^((2*I)*(c + d*Sqrt[x])) 
])/d^2 + (15*b^2*x*PolyLog[3, -E^((2*I)*(c + d*Sqrt[x]))])/d^4 - (10*a*b*x 
^(3/2)*PolyLog[3, -E^((2*I)*(c + d*Sqrt[x]))])/d^3 + ((15*I)*b^2*Sqrt[x]*P 
olyLog[4, -E^((2*I)*(c + d*Sqrt[x]))])/d^5 - ((15*I)*a*b*x*PolyLog[4, -E^( 
(2*I)*(c + d*Sqrt[x]))])/d^4 - (15*b^2*PolyLog[5, -E^((2*I)*(c + d*Sqrt[x] 
))])/(2*d^6) + (15*a*b*Sqrt[x]*PolyLog[5, -E^((2*I)*(c + d*Sqrt[x]))])/d^5 
 + (((15*I)/2)*a*b*PolyLog[6, -E^((2*I)*(c + d*Sqrt[x]))])/d^6 + (b^2*x^(5 
/2)*Tan[c + d*Sqrt[x]])/d)
 

Defintions of rubi rules used

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4205
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 

rule 4234
Int[(x_)^(m_.)*((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol 
] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Tan[c + d*x])^ 
p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[(m + 
 1)/n], 0] && IntegerQ[p]
 
Maple [F]

\[\int x^{2} \left (a +b \tan \left (c +d \sqrt {x}\right )\right )^{2}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral(b^2*x^2*tan(d*sqrt(x) + c)^2 + 2*a*b*x^2*tan(d*sqrt(x) + c) + a^2 
*x^2, x)
 

Sympy [F]

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

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

Output:

Integral(x**2*(a + b*tan(c + d*sqrt(x)))**2, x)
 

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2421 vs. \(2 (320) = 640\).

Time = 0.31 (sec) , antiderivative size = 2421, normalized size of antiderivative = 6.02 \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\text {Too large to display} \] Input:

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

Output:

1/3*((d*sqrt(x) + c)^6*a^2 - 6*(d*sqrt(x) + c)^5*a^2*c + 15*(d*sqrt(x) + c 
)^4*a^2*c^2 - 20*(d*sqrt(x) + c)^3*a^2*c^3 + 15*(d*sqrt(x) + c)^2*a^2*c^4 
- 6*(d*sqrt(x) + c)*a^2*c^5 - 12*a*b*c^5*log(sec(d*sqrt(x) + c)) - 6*(30*I 
*(d*sqrt(x) + c)*b^2*c^5 - 5*(2*a*b + I*b^2)*(d*sqrt(x) + c)^6 + 30*(2*a*b 
 + I*b^2)*(d*sqrt(x) + c)^5*c - 75*(2*a*b + I*b^2)*(d*sqrt(x) + c)^4*c^2 + 
 100*(2*a*b + I*b^2)*(d*sqrt(x) + c)^3*c^3 - 75*(2*a*b + I*b^2)*(d*sqrt(x) 
 + c)^2*c^4 + 60*b^2*c^5 + 2*(96*(d*sqrt(x) + c)^5*a*b - 75*b^2*c^4 - 150* 
(2*a*b*c + b^2)*(d*sqrt(x) + c)^4 + 400*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c)^ 
3 - 150*(2*a*b*c^3 + 3*b^2*c^2)*(d*sqrt(x) + c)^2 + 150*(a*b*c^4 + 2*b^2*c 
^3)*(d*sqrt(x) + c) + (96*(d*sqrt(x) + c)^5*a*b - 75*b^2*c^4 - 150*(2*a*b* 
c + b^2)*(d*sqrt(x) + c)^4 + 400*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c)^3 - 150 
*(2*a*b*c^3 + 3*b^2*c^2)*(d*sqrt(x) + c)^2 + 150*(a*b*c^4 + 2*b^2*c^3)*(d* 
sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) - (-96*I*(d*sqrt(x) + c)^5*a*b + 75*I 
*b^2*c^4 + 150*(2*I*a*b*c + I*b^2)*(d*sqrt(x) + c)^4 + 400*(-I*a*b*c^2 - I 
*b^2*c)*(d*sqrt(x) + c)^3 + 150*(2*I*a*b*c^3 + 3*I*b^2*c^2)*(d*sqrt(x) + c 
)^2 + 150*(-I*a*b*c^4 - 2*I*b^2*c^3)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2* 
c))*arctan2(sin(2*d*sqrt(x) + 2*c), cos(2*d*sqrt(x) + 2*c) + 1) - 5*((2*a* 
b + I*b^2)*(d*sqrt(x) + c)^6 - 6*(2*b^2 + (2*a*b + I*b^2)*c)*(d*sqrt(x) + 
c)^5 + 15*(4*b^2*c + (2*a*b + I*b^2)*c^2)*(d*sqrt(x) + c)^4 - 20*(6*b^2*c^ 
2 + (2*a*b + I*b^2)*c^3)*(d*sqrt(x) + c)^3 + 15*(8*b^2*c^3 + (2*a*b + I...
 

Giac [F]

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

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

Output:

integrate((b*tan(d*sqrt(x) + c) + a)^2*x^2, x)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {6 \sqrt {x}\, \tan \left (\sqrt {x}\, d +c \right ) b^{2} x^{2}-15 \left (\int \sqrt {x}\, \tan \left (\sqrt {x}\, d +c \right ) x d x \right ) b^{2}+6 \left (\int \tan \left (\sqrt {x}\, d +c \right ) x^{2}d x \right ) a b d +a^{2} d \,x^{3}-b^{2} d \,x^{3}}{3 d} \] Input:

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

Output:

(6*sqrt(x)*tan(sqrt(x)*d + c)*b**2*x**2 - 15*int(sqrt(x)*tan(sqrt(x)*d + c 
)*x,x)*b**2 + 6*int(tan(sqrt(x)*d + c)*x**2,x)*a*b*d + a**2*d*x**3 - b**2* 
d*x**3)/(3*d)