\(\int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \cot (c+d x)}} \, dx\) [241]

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

Optimal result

Integrand size = 25, antiderivative size = 276 \[ \int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \cot (c+d x)}} \, dx=\frac {4 a^2 \sin (c+d x)}{d \sqrt {e \cot (c+d x)}}-\frac {4 a^2 \cos (c+d x) E\left (\left .c-\frac {\pi }{4}+d x\right |2\right )}{d \sqrt {e \cot (c+d x)} \sqrt {\sin (2 c+2 d x)}}-\frac {a^2 \arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2} d \sqrt {e \cot (c+d x)} \sqrt {\tan (c+d x)}}+\frac {a^2 \arctan \left (1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2} d \sqrt {e \cot (c+d x)} \sqrt {\tan (c+d x)}}-\frac {a^2 \text {arctanh}\left (\frac {\sqrt {2} \sqrt {\tan (c+d x)}}{1+\tan (c+d x)}\right )}{\sqrt {2} d \sqrt {e \cot (c+d x)} \sqrt {\tan (c+d x)}}+\frac {2 a^2 \tan (c+d x)}{3 d \sqrt {e \cot (c+d x)}} \] Output:

4*a^2*sin(d*x+c)/d/(e*cot(d*x+c))^(1/2)+4*a^2*cos(d*x+c)*EllipticE(cos(c+1 
/4*Pi+d*x),2^(1/2))/d/(e*cot(d*x+c))^(1/2)/sin(2*d*x+2*c)^(1/2)+1/2*a^2*ar 
ctan(-1+2^(1/2)*tan(d*x+c)^(1/2))*2^(1/2)/d/(e*cot(d*x+c))^(1/2)/tan(d*x+c 
)^(1/2)+1/2*a^2*arctan(1+2^(1/2)*tan(d*x+c)^(1/2))*2^(1/2)/d/(e*cot(d*x+c) 
)^(1/2)/tan(d*x+c)^(1/2)-1/2*a^2*arctanh(2^(1/2)*tan(d*x+c)^(1/2)/(1+tan(d 
*x+c)))*2^(1/2)/d/(e*cot(d*x+c))^(1/2)/tan(d*x+c)^(1/2)+2/3*a^2*tan(d*x+c) 
/d/(e*cot(d*x+c))^(1/2)
 

Mathematica [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 24.90 (sec) , antiderivative size = 221, normalized size of antiderivative = 0.80 \[ \int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \cot (c+d x)}} \, dx=\frac {a^2 \cos ^5\left (\frac {1}{2} (c+d x)\right ) \left (4 \operatorname {Hypergeometric2F1}\left (-\frac {3}{4},1,\frac {1}{4},-\cot ^2(c+d x)\right )+8 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3}{4},\frac {7}{4},-\tan ^2(c+d x)\right )+3 \sqrt {2} \cot ^{\frac {3}{2}}(c+d x) \left (2 \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )-2 \arctan \left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )+\log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )-\log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )\right )\right ) \sec (c+d x) \sec ^4\left (\frac {1}{2} \cot ^{-1}(\cot (c+d x))\right ) \sin \left (\frac {1}{2} (c+d x)\right )}{3 d \sqrt {e \cot (c+d x)}} \] Input:

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

Output:

(a^2*Cos[(c + d*x)/2]^5*(4*Hypergeometric2F1[-3/4, 1, 1/4, -Cot[c + d*x]^2 
] + 8*Hypergeometric2F1[1/2, 3/4, 7/4, -Tan[c + d*x]^2] + 3*Sqrt[2]*Cot[c 
+ d*x]^(3/2)*(2*ArcTan[1 - Sqrt[2]*Sqrt[Cot[c + d*x]]] - 2*ArcTan[1 + Sqrt 
[2]*Sqrt[Cot[c + d*x]]] + Log[1 - Sqrt[2]*Sqrt[Cot[c + d*x]] + Cot[c + d*x 
]] - Log[1 + Sqrt[2]*Sqrt[Cot[c + d*x]] + Cot[c + d*x]]))*Sec[c + d*x]*Sec 
[ArcCot[Cot[c + d*x]]/2]^4*Sin[(c + d*x)/2])/(3*d*Sqrt[e*Cot[c + d*x]])
 

Rubi [A] (verified)

Time = 0.63 (sec) , antiderivative size = 262, normalized size of antiderivative = 0.95, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3042, 4388, 3042, 4374, 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 {(a \sec (c+d x)+a)^2}{\sqrt {e \cot (c+d x)}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \sec (c+d x)+a)^2}{\sqrt {e \cot (c+d x)}}dx\)

\(\Big \downarrow \) 4388

\(\displaystyle \frac {\int (\sec (c+d x) a+a)^2 \sqrt {\tan (c+d x)}dx}{\sqrt {\tan (c+d x)} \sqrt {e \cot (c+d x)}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \sqrt {-\cot \left (c+d x+\frac {\pi }{2}\right )} \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2dx}{\sqrt {\tan (c+d x)} \sqrt {e \cot (c+d x)}}\)

\(\Big \downarrow \) 4374

\(\displaystyle \frac {\int \left (\sec ^2(c+d x) \sqrt {\tan (c+d x)} a^2+2 \sec (c+d x) \sqrt {\tan (c+d x)} a^2+\sqrt {\tan (c+d x)} a^2\right )dx}{\sqrt {\tan (c+d x)} \sqrt {e \cot (c+d x)}}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {a^2 \arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2} d}+\frac {a^2 \arctan \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2} d}+\frac {2 a^2 \tan ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {a^2 \log \left (\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{2 \sqrt {2} d}-\frac {a^2 \log \left (\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{2 \sqrt {2} d}+\frac {4 a^2 \cos (c+d x) \tan ^{\frac {3}{2}}(c+d x)}{d}-\frac {4 a^2 \cos (c+d x) \sqrt {\tan (c+d x)} E\left (\left .c+d x-\frac {\pi }{4}\right |2\right )}{d \sqrt {\sin (2 c+2 d x)}}}{\sqrt {\tan (c+d x)} \sqrt {e \cot (c+d x)}}\)

Input:

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

Output:

(-((a^2*ArcTan[1 - Sqrt[2]*Sqrt[Tan[c + d*x]]])/(Sqrt[2]*d)) + (a^2*ArcTan 
[1 + Sqrt[2]*Sqrt[Tan[c + d*x]]])/(Sqrt[2]*d) + (a^2*Log[1 - Sqrt[2]*Sqrt[ 
Tan[c + d*x]] + Tan[c + d*x]])/(2*Sqrt[2]*d) - (a^2*Log[1 + Sqrt[2]*Sqrt[T 
an[c + d*x]] + Tan[c + d*x]])/(2*Sqrt[2]*d) - (4*a^2*Cos[c + d*x]*Elliptic 
E[c - Pi/4 + d*x, 2]*Sqrt[Tan[c + d*x]])/(d*Sqrt[Sin[2*c + 2*d*x]]) + (2*a 
^2*Tan[c + d*x]^(3/2))/(3*d) + (4*a^2*Cos[c + d*x]*Tan[c + d*x]^(3/2))/d)/ 
(Sqrt[e*Cot[c + d*x]]*Sqrt[Tan[c + d*x]])
 

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 4374
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_))^(n_), x_Symbol] :> Int[ExpandIntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[ 
c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]
 

rule 4388
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*((a_) + (b_.)*sec[(c_.) + (d_.)*(x 
_)])^(n_.), x_Symbol] :> Simp[(e*Cot[c + d*x])^m*Tan[c + d*x]^m   Int[(a + 
b*Sec[c + d*x])^n/Tan[c + d*x]^m, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] 
 &&  !IntegerQ[m]
 
Maple [A] (verified)

Time = 1.87 (sec) , antiderivative size = 428, normalized size of antiderivative = 1.55

method result size
parts \(-\frac {a^{2} \left (e^{2}\right )^{\frac {1}{4}} \sqrt {2}\, \left (\ln \left (\frac {e \cot \left (d x +c \right )+\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}{e \cot \left (d x +c \right )-\left (e^{2}\right )^{\frac {1}{4}} \sqrt {e \cot \left (d x +c \right )}\, \sqrt {2}+\sqrt {e^{2}}}\right )+2 \arctan \left (\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )-2 \arctan \left (-\frac {\sqrt {2}\, \sqrt {e \cot \left (d x +c \right )}}{\left (e^{2}\right )^{\frac {1}{4}}}+1\right )\right )}{4 d e}+\frac {2 a^{2} e}{3 d \left (e \cot \left (d x +c \right )\right )^{\frac {3}{2}}}+\frac {a^{2} \sqrt {2}\, \left (2 \sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \left (1+\cos \left (d x +c \right )\right ) \operatorname {EllipticE}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {\sqrt {2}}{2}\right )+\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \left (-1-\cos \left (d x +c \right )\right ) \operatorname {EllipticF}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {\sqrt {2}}{2}\right )-2 \cos \left (d x +c \right )+2\right ) \sqrt {-\frac {2 \sin \left (d x +c \right ) \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right )^{2}}}\, \csc \left (d x +c \right )}{d \sqrt {e \cot \left (d x +c \right )}\, \sqrt {-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right )^{2}}}}\) \(428\)
default \(\frac {a^{2} \sqrt {2}\, \sqrt {-\frac {2 \sin \left (d x +c \right ) \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right )^{2}}}\, \left (i \sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \operatorname {EllipticPi}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right ) \left (3 \cot \left (d x +c \right )+3 \csc \left (d x +c \right )\right )+i \sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \operatorname {EllipticPi}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right ) \left (-3 \cot \left (d x +c \right )-3 \csc \left (d x +c \right )\right )+\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \operatorname {EllipticPi}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {1}{2}-\frac {i}{2}, \frac {\sqrt {2}}{2}\right ) \left (-3 \cot \left (d x +c \right )-3 \csc \left (d x +c \right )\right )+\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \operatorname {EllipticPi}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right ) \left (-3 \cot \left (d x +c \right )-3 \csc \left (d x +c \right )\right )+\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \operatorname {EllipticE}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {\sqrt {2}}{2}\right ) \left (24 \cot \left (d x +c \right )+24 \csc \left (d x +c \right )\right )+\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}\, \sqrt {2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )+2}\, \sqrt {-\csc \left (d x +c \right )+\cot \left (d x +c \right )}\, \operatorname {EllipticF}\left (\sqrt {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}, \frac {\sqrt {2}}{2}\right ) \left (-12 \cot \left (d x +c \right )-12 \csc \left (d x +c \right )\right )-28 \cot \left (d x +c \right )+24 \csc \left (d x +c \right )+4 \sec \left (d x +c \right ) \csc \left (d x +c \right )\right )}{12 d \sqrt {e \cot \left (d x +c \right )}\, \sqrt {-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{\left (1+\cos \left (d x +c \right )\right )^{2}}}}\) \(703\)

Input:

int((a+a*sec(d*x+c))^2/(e*cot(d*x+c))^(1/2),x,method=_RETURNVERBOSE)
 

Output:

-1/4*a^2/d/e*(e^2)^(1/4)*2^(1/2)*(ln((e*cot(d*x+c)+(e^2)^(1/4)*(e*cot(d*x+ 
c))^(1/2)*2^(1/2)+(e^2)^(1/2))/(e*cot(d*x+c)-(e^2)^(1/4)*(e*cot(d*x+c))^(1 
/2)*2^(1/2)+(e^2)^(1/2)))+2*arctan(2^(1/2)/(e^2)^(1/4)*(e*cot(d*x+c))^(1/2 
)+1)-2*arctan(-2^(1/2)/(e^2)^(1/4)*(e*cot(d*x+c))^(1/2)+1))+2/3*a^2/d*e/(e 
*cot(d*x+c))^(3/2)+a^2/d*2^(1/2)*(2*(-cot(d*x+c)+csc(d*x+c)+1)^(1/2)*(2*co 
t(d*x+c)-2*csc(d*x+c)+2)^(1/2)*(-csc(d*x+c)+cot(d*x+c))^(1/2)*(1+cos(d*x+c 
))*EllipticE((-cot(d*x+c)+csc(d*x+c)+1)^(1/2),1/2*2^(1/2))+(-cot(d*x+c)+cs 
c(d*x+c)+1)^(1/2)*(2*cot(d*x+c)-2*csc(d*x+c)+2)^(1/2)*(-csc(d*x+c)+cot(d*x 
+c))^(1/2)*(-1-cos(d*x+c))*EllipticF((-cot(d*x+c)+csc(d*x+c)+1)^(1/2),1/2* 
2^(1/2))-2*cos(d*x+c)+2)*(-2*sin(d*x+c)*cos(d*x+c)/(1+cos(d*x+c))^2)^(1/2) 
/(e*cot(d*x+c))^(1/2)/(-sin(d*x+c)*cos(d*x+c)/(1+cos(d*x+c))^2)^(1/2)*csc( 
d*x+c)
 

Fricas [F(-1)]

Timed out. \[ \int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \cot (c+d x)}} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Sympy [F]

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

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

Output:

a**2*(Integral(1/sqrt(e*cot(c + d*x)), x) + Integral(2*sec(c + d*x)/sqrt(e 
*cot(c + d*x)), x) + Integral(sec(c + d*x)**2/sqrt(e*cot(c + d*x)), x))
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {(a+a \sec (c+d x))^2}{\sqrt {e \cot (c+d x)}} \, dx=\text {Exception raised: ValueError} \] Input:

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(e>0)', see `assume?` for more de 
tails)Is e
 

Giac [F]

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

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

Output:

integrate((a*sec(d*x + c) + a)^2/sqrt(e*cot(d*x + c)), x)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(sqrt(e)*a**2*(int(sqrt(cot(c + d*x))/cot(c + d*x),x) + int((sqrt(cot(c + 
d*x))*sec(c + d*x)**2)/cot(c + d*x),x) + 2*int((sqrt(cot(c + d*x))*sec(c + 
 d*x))/cot(c + d*x),x)))/e