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

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 = 22, antiderivative size = 255 \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=-\frac {2 i b^2 x}{d}+\frac {2}{3} a^2 x^{3/2}-\frac {8 i a b x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {4 b^2 \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {8 i a b \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {2 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {8 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {8 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x \tan \left (c+d \sqrt {x}\right )}{d} \] Output:

-2*I*b^2*x/d+2/3*a^2*x^(3/2)-8*I*a*b*x*arctan(exp(I*(c+d*x^(1/2))))/d+4*b^ 
2*x^(1/2)*ln(1+exp(2*I*(c+d*x^(1/2))))/d^2+8*I*a*b*x^(1/2)*polylog(2,-I*ex 
p(I*(c+d*x^(1/2))))/d^2-8*I*a*b*x^(1/2)*polylog(2,I*exp(I*(c+d*x^(1/2))))/ 
d^2-2*I*b^2*polylog(2,-exp(2*I*(c+d*x^(1/2))))/d^3-8*a*b*polylog(3,-I*exp( 
I*(c+d*x^(1/2))))/d^3+8*a*b*polylog(3,I*exp(I*(c+d*x^(1/2))))/d^3+2*b^2*x* 
tan(c+d*x^(1/2))/d
 

Mathematica [A] (verified)

Time = 0.52 (sec) , antiderivative size = 247, normalized size of antiderivative = 0.97 \[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {2 \left (-3 i b^2 d^2 x+a^2 d^3 x^{3/2}-12 i a b d^2 x \arctan \left (e^{i \left (c+d \sqrt {x}\right )}\right )+6 b^2 d \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )+12 i a b d \sqrt {x} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d \sqrt {x}\right )}\right )-12 i a b d \sqrt {x} \operatorname {PolyLog}\left (2,i e^{i \left (c+d \sqrt {x}\right )}\right )-3 i b^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )-12 a b \operatorname {PolyLog}\left (3,-i e^{i \left (c+d \sqrt {x}\right )}\right )+12 a b \operatorname {PolyLog}\left (3,i e^{i \left (c+d \sqrt {x}\right )}\right )+3 b^2 d^2 x \tan \left (c+d \sqrt {x}\right )\right )}{3 d^3} \] Input:

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

Output:

(2*((-3*I)*b^2*d^2*x + a^2*d^3*x^(3/2) - (12*I)*a*b*d^2*x*ArcTan[E^(I*(c + 
 d*Sqrt[x]))] + 6*b^2*d*Sqrt[x]*Log[1 + E^((2*I)*(c + d*Sqrt[x]))] + (12*I 
)*a*b*d*Sqrt[x]*PolyLog[2, (-I)*E^(I*(c + d*Sqrt[x]))] - (12*I)*a*b*d*Sqrt 
[x]*PolyLog[2, I*E^(I*(c + d*Sqrt[x]))] - (3*I)*b^2*PolyLog[2, -E^((2*I)*( 
c + d*Sqrt[x]))] - 12*a*b*PolyLog[3, (-I)*E^(I*(c + d*Sqrt[x]))] + 12*a*b* 
PolyLog[3, I*E^(I*(c + d*Sqrt[x]))] + 3*b^2*d^2*x*Tan[c + d*Sqrt[x]]))/(3* 
d^3)
 

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 256, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4692, 3042, 4678, 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 \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4692

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

\(\Big \downarrow \) 3042

\(\displaystyle 2 \int x \left (a+b \csc \left (c+d \sqrt {x}+\frac {\pi }{2}\right )\right )^2d\sqrt {x}\)

\(\Big \downarrow \) 4678

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

2*(((-I)*b^2*x)/d + (a^2*x^(3/2))/3 - ((4*I)*a*b*x*ArcTan[E^(I*(c + d*Sqrt 
[x]))])/d + (2*b^2*Sqrt[x]*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d^2 + ((4*I 
)*a*b*Sqrt[x]*PolyLog[2, (-I)*E^(I*(c + d*Sqrt[x]))])/d^2 - ((4*I)*a*b*Sqr 
t[x]*PolyLog[2, I*E^(I*(c + d*Sqrt[x]))])/d^2 - (I*b^2*PolyLog[2, -E^((2*I 
)*(c + d*Sqrt[x]))])/d^3 - (4*a*b*PolyLog[3, (-I)*E^(I*(c + d*Sqrt[x]))])/ 
d^3 + (4*a*b*PolyLog[3, I*E^(I*(c + d*Sqrt[x]))])/d^3 + (b^2*x*Tan[c + d*S 
qrt[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 4678
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], 
 x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
 

rule 4692
Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol 
] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Sec[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 \sqrt {x}\, \left (a +b \sec \left (c +d \sqrt {x}\right )\right )^{2}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

Integral(sqrt(x)*(a + b*sec(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. 1272 vs. \(2 (194) = 388\).

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

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

Output:

2/3*((d*sqrt(x) + c)^3*a^2 - 3*(d*sqrt(x) + c)^2*a^2*c + 3*(d*sqrt(x) + c) 
*a^2*c^2 + 6*a*b*c^2*log(sec(d*sqrt(x) + c) + tan(d*sqrt(x) + c)) + 3*(2*b 
^2*c^2 - 2*((d*sqrt(x) + c)^2*a*b - 2*(d*sqrt(x) + c)*a*b*c + ((d*sqrt(x) 
+ c)^2*a*b - 2*(d*sqrt(x) + c)*a*b*c)*cos(2*d*sqrt(x) + 2*c) + (I*(d*sqrt( 
x) + c)^2*a*b - 2*I*(d*sqrt(x) + c)*a*b*c)*sin(2*d*sqrt(x) + 2*c))*arctan2 
(cos(d*sqrt(x) + c), sin(d*sqrt(x) + c) + 1) - 2*((d*sqrt(x) + c)^2*a*b - 
2*(d*sqrt(x) + c)*a*b*c + ((d*sqrt(x) + c)^2*a*b - 2*(d*sqrt(x) + c)*a*b*c 
)*cos(2*d*sqrt(x) + 2*c) + (I*(d*sqrt(x) + c)^2*a*b - 2*I*(d*sqrt(x) + c)* 
a*b*c)*sin(2*d*sqrt(x) + 2*c))*arctan2(cos(d*sqrt(x) + c), -sin(d*sqrt(x) 
+ c) + 1) + 2*((d*sqrt(x) + c)*b^2 - b^2*c + ((d*sqrt(x) + c)*b^2 - b^2*c) 
*cos(2*d*sqrt(x) + 2*c) - (-I*(d*sqrt(x) + c)*b^2 + I*b^2*c)*sin(2*d*sqrt( 
x) + 2*c))*arctan2(sin(2*d*sqrt(x) + 2*c), cos(2*d*sqrt(x) + 2*c) + 1) - 2 
*((d*sqrt(x) + c)^2*b^2 - 2*(d*sqrt(x) + c)*b^2*c)*cos(2*d*sqrt(x) + 2*c) 
- (b^2*cos(2*d*sqrt(x) + 2*c) + I*b^2*sin(2*d*sqrt(x) + 2*c) + b^2)*dilog( 
-e^(2*I*d*sqrt(x) + 2*I*c)) - 4*((d*sqrt(x) + c)*a*b - a*b*c + ((d*sqrt(x) 
 + c)*a*b - a*b*c)*cos(2*d*sqrt(x) + 2*c) + (I*(d*sqrt(x) + c)*a*b - I*a*b 
*c)*sin(2*d*sqrt(x) + 2*c))*dilog(I*e^(I*d*sqrt(x) + I*c)) + 4*((d*sqrt(x) 
 + c)*a*b - a*b*c + ((d*sqrt(x) + c)*a*b - a*b*c)*cos(2*d*sqrt(x) + 2*c) - 
 (-I*(d*sqrt(x) + c)*a*b + I*a*b*c)*sin(2*d*sqrt(x) + 2*c))*dilog(-I*e^(I* 
d*sqrt(x) + I*c)) + (-I*(d*sqrt(x) + c)*b^2 + I*b^2*c + (-I*(d*sqrt(x) ...
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \sqrt {x} \left (a+b \sec \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {\frac {2 \sqrt {x}\, \cos \left (\sqrt {x}\, d +c \right ) a^{2} d^{3} x}{3}-\frac {2 \sqrt {x}\, \cos \left (\sqrt {x}\, d +c \right ) a b \,d^{3} x}{3}+4 \cos \left (\sqrt {x}\, d +c \right ) \left (\int \frac {\sqrt {x}}{\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{4}-2 \tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{2}+1}d x \right ) a b \,d^{3}+8 \cos \left (\sqrt {x}\, d +c \right ) \left (\int \frac {\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )}{\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{4}-2 \tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{2}+1}d x \right ) a b \,d^{2}-8 \cos \left (\sqrt {x}\, d +c \right ) \left (\int \frac {\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )}{\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{4}-2 \tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )^{2}+1}d x \right ) b^{2} d^{2}-4 \cos \left (\sqrt {x}\, d +c \right ) \mathrm {log}\left (\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )-1\right ) a b +4 \cos \left (\sqrt {x}\, d +c \right ) \mathrm {log}\left (\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )-1\right ) b^{2}+4 \cos \left (\sqrt {x}\, d +c \right ) \mathrm {log}\left (\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )+1\right ) a b -4 \cos \left (\sqrt {x}\, d +c \right ) \mathrm {log}\left (\tan \left (\frac {\sqrt {x}\, d}{2}+\frac {c}{2}\right )+1\right ) b^{2}-4 \sqrt {x}\, a b d +4 \sqrt {x}\, b^{2} d -2 \sin \left (\sqrt {x}\, d +c \right ) a b \,d^{2} x +2 \sin \left (\sqrt {x}\, d +c \right ) b^{2} d^{2} x}{\cos \left (\sqrt {x}\, d +c \right ) d^{3}} \] Input:

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

Output:

(2*(sqrt(x)*cos(sqrt(x)*d + c)*a**2*d**3*x - sqrt(x)*cos(sqrt(x)*d + c)*a* 
b*d**3*x + 6*cos(sqrt(x)*d + c)*int(sqrt(x)/(tan((sqrt(x)*d + c)/2)**4 - 2 
*tan((sqrt(x)*d + c)/2)**2 + 1),x)*a*b*d**3 + 12*cos(sqrt(x)*d + c)*int(ta 
n((sqrt(x)*d + c)/2)/(tan((sqrt(x)*d + c)/2)**4 - 2*tan((sqrt(x)*d + c)/2) 
**2 + 1),x)*a*b*d**2 - 12*cos(sqrt(x)*d + c)*int(tan((sqrt(x)*d + c)/2)/(t 
an((sqrt(x)*d + c)/2)**4 - 2*tan((sqrt(x)*d + c)/2)**2 + 1),x)*b**2*d**2 - 
 6*cos(sqrt(x)*d + c)*log(tan((sqrt(x)*d + c)/2) - 1)*a*b + 6*cos(sqrt(x)* 
d + c)*log(tan((sqrt(x)*d + c)/2) - 1)*b**2 + 6*cos(sqrt(x)*d + c)*log(tan 
((sqrt(x)*d + c)/2) + 1)*a*b - 6*cos(sqrt(x)*d + c)*log(tan((sqrt(x)*d + c 
)/2) + 1)*b**2 - 6*sqrt(x)*a*b*d + 6*sqrt(x)*b**2*d - 3*sin(sqrt(x)*d + c) 
*a*b*d**2*x + 3*sin(sqrt(x)*d + c)*b**2*d**2*x))/(3*cos(sqrt(x)*d + c)*d** 
3)