\(\int (1+\sec ^2(x))^{3/2} \, dx\) [255]

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

Optimal result

Integrand size = 10, antiderivative size = 42 \[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=2 \text {arcsinh}\left (\frac {\tan (x)}{\sqrt {2}}\right )+\arctan \left (\frac {\tan (x)}{\sqrt {2+\tan ^2(x)}}\right )+\frac {1}{2} \tan (x) \sqrt {2+\tan ^2(x)} \] Output:

2*arcsinh(1/2*tan(x)*2^(1/2))+arctan(tan(x)/(2+tan(x)^2)^(1/2))+1/2*tan(x) 
*(2+tan(x)^2)^(1/2)
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.13 (sec) , antiderivative size = 109, normalized size of antiderivative = 2.60 \[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\frac {\left (1+\cos ^2(x)\right ) \sec (x) \sqrt {1+\sec ^2(x)} \left (4 \sqrt {2} \text {arctanh}\left (\frac {\sqrt {2} \sin (x)}{\sqrt {3+\cos (2 x)}}\right ) \cos ^2(x)-2 i \sqrt {2} \cos ^2(x) \log \left (\sqrt {3+\cos (2 x)}+i \sqrt {2} \sin (x)\right )+\sqrt {3+\cos (2 x)} \sin (x)\right )}{(3+\cos (2 x))^{3/2}} \] Input:

Integrate[(1 + Sec[x]^2)^(3/2),x]
 

Output:

((1 + Cos[x]^2)*Sec[x]*Sqrt[1 + Sec[x]^2]*(4*Sqrt[2]*ArcTanh[(Sqrt[2]*Sin[ 
x])/Sqrt[3 + Cos[2*x]]]*Cos[x]^2 - (2*I)*Sqrt[2]*Cos[x]^2*Log[Sqrt[3 + Cos 
[2*x]] + I*Sqrt[2]*Sin[x]] + Sqrt[3 + Cos[2*x]]*Sin[x]))/(3 + Cos[2*x])^(3 
/2)
 

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.800, Rules used = {3042, 4616, 318, 27, 398, 222, 291, 216}

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 (\sec ^2(x)+1\right )^{3/2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (\sec (x)^2+1\right )^{3/2}dx\)

\(\Big \downarrow \) 4616

\(\displaystyle \int \frac {\left (\tan ^2(x)+2\right )^{3/2}}{\tan ^2(x)+1}d\tan (x)\)

\(\Big \downarrow \) 318

\(\displaystyle \frac {1}{2} \int \frac {2 \left (2 \tan ^2(x)+3\right )}{\left (\tan ^2(x)+1\right ) \sqrt {\tan ^2(x)+2}}d\tan (x)+\frac {1}{2} \sqrt {\tan ^2(x)+2} \tan (x)\)

\(\Big \downarrow \) 27

\(\displaystyle \int \frac {2 \tan ^2(x)+3}{\left (\tan ^2(x)+1\right ) \sqrt {\tan ^2(x)+2}}d\tan (x)+\frac {1}{2} \sqrt {\tan ^2(x)+2} \tan (x)\)

\(\Big \downarrow \) 398

\(\displaystyle 2 \int \frac {1}{\sqrt {\tan ^2(x)+2}}d\tan (x)+\int \frac {1}{\left (\tan ^2(x)+1\right ) \sqrt {\tan ^2(x)+2}}d\tan (x)+\frac {1}{2} \sqrt {\tan ^2(x)+2} \tan (x)\)

\(\Big \downarrow \) 222

\(\displaystyle \int \frac {1}{\left (\tan ^2(x)+1\right ) \sqrt {\tan ^2(x)+2}}d\tan (x)+2 \text {arcsinh}\left (\frac {\tan (x)}{\sqrt {2}}\right )+\frac {1}{2} \tan (x) \sqrt {\tan ^2(x)+2}\)

\(\Big \downarrow \) 291

\(\displaystyle \int \frac {1}{\frac {\tan ^2(x)}{\tan ^2(x)+2}+1}d\frac {\tan (x)}{\sqrt {\tan ^2(x)+2}}+2 \text {arcsinh}\left (\frac {\tan (x)}{\sqrt {2}}\right )+\frac {1}{2} \tan (x) \sqrt {\tan ^2(x)+2}\)

\(\Big \downarrow \) 216

\(\displaystyle 2 \text {arcsinh}\left (\frac {\tan (x)}{\sqrt {2}}\right )+\arctan \left (\frac {\tan (x)}{\sqrt {\tan ^2(x)+2}}\right )+\frac {1}{2} \tan (x) \sqrt {\tan ^2(x)+2}\)

Input:

Int[(1 + Sec[x]^2)^(3/2),x]
 

Output:

2*ArcSinh[Tan[x]/Sqrt[2]] + ArcTan[Tan[x]/Sqrt[2 + Tan[x]^2]] + (Tan[x]*Sq 
rt[2 + Tan[x]^2])/2
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 222
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt 
[a])]/Rt[b, 2], x] /; FreeQ[{a, b}, x] && GtQ[a, 0] && PosQ[b]
 

rule 291
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst 
[Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, 
d}, x] && NeQ[b*c - a*d, 0]
 

rule 318
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[d*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 1)/(b*(2*(p + q) + 1))), x] + S 
imp[1/(b*(2*(p + q) + 1))   Int[(a + b*x^2)^p*(c + d*x^2)^(q - 2)*Simp[c*(b 
*c*(2*(p + q) + 1) - a*d) + d*(b*c*(2*(p + 2*q - 1) + 1) - a*d*(2*(q - 1) + 
 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, p}, x] && NeQ[b*c - a*d, 0] && G 
tQ[q, 1] && NeQ[2*(p + q) + 1, 0] &&  !IGtQ[p, 1] && IntBinomialQ[a, b, c, 
d, 2, p, q, x]
 

rule 398
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]) 
, x_Symbol] :> Simp[f/b   Int[1/Sqrt[c + d*x^2], x], x] + Simp[(b*e - a*f)/ 
b   Int[1/((a + b*x^2)*Sqrt[c + d*x^2]), x], x] /; FreeQ[{a, b, c, d, e, f} 
, x]
 

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

rule 4616
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = 
FreeFactors[Tan[e + f*x], x]}, Simp[ff/f   Subst[Int[(a + b + b*ff^2*x^2)^p 
/(1 + ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] 
&& NeQ[a + b, 0] && NeQ[p, -1]
 
Maple [B] (warning: unable to verify)

Leaf count of result is larger than twice the leaf count of optimal. \(180\) vs. \(2(35)=70\).

Time = 9.31 (sec) , antiderivative size = 181, normalized size of antiderivative = 4.31

method result size
default \(-\frac {\sqrt {2}\, \sqrt {2+2 \sec \left (x \right )^{2}}\, \left (2 \cos \left (x \right ) \arctan \left (\frac {2 \cot \left (x \right )-2 \csc \left (x \right )}{\sqrt {2 \cot \left (x \right )^{4}-8 \cot \left (x \right )^{3} \csc \left (x \right )+12 \cot \left (x \right )^{2} \csc \left (x \right )^{2}-8 \cot \left (x \right ) \csc \left (x \right )^{3}+2 \csc \left (x \right )^{4}+2}}\right )+2 \cos \left (x \right ) \operatorname {arctanh}\left (\frac {\sin \left (x \right )-2}{\left (\cos \left (x \right )+1\right ) \sqrt {\frac {\cos \left (x \right )^{2}+1}{\left (\cos \left (x \right )+1\right )^{2}}}}\right )+2 \cos \left (x \right ) \operatorname {arctanh}\left (\frac {\sin \left (x \right )+2}{\left (\cos \left (x \right )+1\right ) \sqrt {\frac {\cos \left (x \right )^{2}+1}{\left (\cos \left (x \right )+1\right )^{2}}}}\right )+\sqrt {\frac {\cos \left (x \right )^{2}+1}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (-\sin \left (x \right )-\tan \left (x \right )\right )\right )}{4 \left (\cos \left (x \right )+1\right ) \sqrt {\frac {\cos \left (x \right )^{2}+1}{\left (\cos \left (x \right )+1\right )^{2}}}}\) \(181\)

Input:

int((1+sec(x)^2)^(3/2),x,method=_RETURNVERBOSE)
 

Output:

-1/4*2^(1/2)*(2+2*sec(x)^2)^(1/2)/(cos(x)+1)/((cos(x)^2+1)/(cos(x)+1)^2)^( 
1/2)*(2*cos(x)*arctan(2*(cot(x)-csc(x))/(2*cot(x)^4-8*cot(x)^3*csc(x)+12*c 
ot(x)^2*csc(x)^2-8*cot(x)*csc(x)^3+2*csc(x)^4+2)^(1/2))+2*cos(x)*arctanh(( 
sin(x)-2)/(cos(x)+1)/((cos(x)^2+1)/(cos(x)+1)^2)^(1/2))+2*cos(x)*arctanh(( 
sin(x)+2)/(cos(x)+1)/((cos(x)^2+1)/(cos(x)+1)^2)^(1/2))+((cos(x)^2+1)/(cos 
(x)+1)^2)^(1/2)*(-sin(x)-tan(x)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (35) = 70\).

Time = 0.10 (sec) , antiderivative size = 160, normalized size of antiderivative = 3.81 \[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\frac {\arctan \left (\frac {\sqrt {\frac {\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} \cos \left (x\right )^{3} \sin \left (x\right ) + \cos \left (x\right ) \sin \left (x\right )}{\cos \left (x\right )^{4} + \cos \left (x\right )^{2} - 1}\right ) \cos \left (x\right ) - \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right ) \cos \left (x\right ) + 2 \, \cos \left (x\right ) \log \left (\cos \left (x\right )^{2} + \cos \left (x\right ) \sin \left (x\right ) + {\left (\cos \left (x\right )^{2} + \cos \left (x\right ) \sin \left (x\right )\right )} \sqrt {\frac {\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} + 1\right ) - 2 \, \cos \left (x\right ) \log \left (\cos \left (x\right )^{2} - \cos \left (x\right ) \sin \left (x\right ) + {\left (\cos \left (x\right )^{2} - \cos \left (x\right ) \sin \left (x\right )\right )} \sqrt {\frac {\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} + 1\right ) + \sqrt {\frac {\cos \left (x\right )^{2} + 1}{\cos \left (x\right )^{2}}} \sin \left (x\right )}{2 \, \cos \left (x\right )} \] Input:

integrate((1+sec(x)^2)^(3/2),x, algorithm="fricas")
 

Output:

1/2*(arctan((sqrt((cos(x)^2 + 1)/cos(x)^2)*cos(x)^3*sin(x) + cos(x)*sin(x) 
)/(cos(x)^4 + cos(x)^2 - 1))*cos(x) - arctan(sin(x)/cos(x))*cos(x) + 2*cos 
(x)*log(cos(x)^2 + cos(x)*sin(x) + (cos(x)^2 + cos(x)*sin(x))*sqrt((cos(x) 
^2 + 1)/cos(x)^2) + 1) - 2*cos(x)*log(cos(x)^2 - cos(x)*sin(x) + (cos(x)^2 
 - cos(x)*sin(x))*sqrt((cos(x)^2 + 1)/cos(x)^2) + 1) + sqrt((cos(x)^2 + 1) 
/cos(x)^2)*sin(x))/cos(x)
 

Sympy [F]

\[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\int \left (\sec ^{2}{\left (x \right )} + 1\right )^{\frac {3}{2}}\, dx \] Input:

integrate((1+sec(x)**2)**(3/2),x)
 

Output:

Integral((sec(x)**2 + 1)**(3/2), x)
 

Maxima [F]

\[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\int { {\left (\sec \left (x\right )^{2} + 1\right )}^{\frac {3}{2}} \,d x } \] Input:

integrate((1+sec(x)^2)^(3/2),x, algorithm="maxima")
 

Output:

integrate((sec(x)^2 + 1)^(3/2), x)
 

Giac [F]

\[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\int { {\left (\sec \left (x\right )^{2} + 1\right )}^{\frac {3}{2}} \,d x } \] Input:

integrate((1+sec(x)^2)^(3/2),x, algorithm="giac")
 

Output:

integrate((sec(x)^2 + 1)^(3/2), x)
 

Mupad [F(-1)]

Timed out. \[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\int {\left (\frac {1}{{\cos \left (x\right )}^2}+1\right )}^{3/2} \,d x \] Input:

int((1/cos(x)^2 + 1)^(3/2),x)
 

Output:

int((1/cos(x)^2 + 1)^(3/2), x)
 

Reduce [F]

\[ \int \left (1+\sec ^2(x)\right )^{3/2} \, dx=\int \sqrt {\sec \left (x \right )^{2}+1}d x +\int \sqrt {\sec \left (x \right )^{2}+1}\, \sec \left (x \right )^{2}d x \] Input:

int((1+sec(x)^2)^(3/2),x)
 

Output:

int(sqrt(sec(x)**2 + 1),x) + int(sqrt(sec(x)**2 + 1)*sec(x)**2,x)