\(\int \frac {\sec (c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^{3/2}} \, dx\) [155]

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

Optimal result

Integrand size = 31, antiderivative size = 87 \[ \int \frac {\sec (c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^{3/2}} \, dx=\frac {(A+3 B) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{2 \sqrt {2} a^{3/2} d}+\frac {(A-B) \tan (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}} \] Output:

1/4*(A+3*B)*arctan(1/2*a^(1/2)*tan(d*x+c)*2^(1/2)/(a+a*sec(d*x+c))^(1/2))* 
2^(1/2)/a^(3/2)/d+1/2*(A-B)*tan(d*x+c)/d/(a+a*sec(d*x+c))^(3/2)
 

Mathematica [A] (verified)

Time = 0.57 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.46 \[ \int \frac {\sec (c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^{3/2}} \, dx=\frac {2 (A-B) \sqrt {1-\sec (c+d x)} \sin (c+d x)+2 \sqrt {2} (A+3 B) \text {arctanh}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right ) \cos ^2\left (\frac {1}{2} (c+d x)\right ) \tan (c+d x)}{4 a d (1+\cos (c+d x)) \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \] Input:

Integrate[(Sec[c + d*x]*(A + B*Sec[c + d*x]))/(a + a*Sec[c + d*x])^(3/2),x 
]
 

Output:

(2*(A - B)*Sqrt[1 - Sec[c + d*x]]*Sin[c + d*x] + 2*Sqrt[2]*(A + 3*B)*ArcTa 
nh[Sqrt[1 - Sec[c + d*x]]/Sqrt[2]]*Cos[(c + d*x)/2]^2*Tan[c + d*x])/(4*a*d 
*(1 + Cos[c + d*x])*Sqrt[1 - Sec[c + d*x]]*Sqrt[a*(1 + Sec[c + d*x])])
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3042, 4488, 3042, 4282, 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 \frac {\sec (c+d x) (A+B \sec (c+d x))}{(a \sec (c+d x)+a)^{3/2}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right ) \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^{3/2}}dx\)

\(\Big \downarrow \) 4488

\(\displaystyle \frac {(A+3 B) \int \frac {\sec (c+d x)}{\sqrt {\sec (c+d x) a+a}}dx}{4 a}+\frac {(A-B) \tan (c+d x)}{2 d (a \sec (c+d x)+a)^{3/2}}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {(A+3 B) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}}dx}{4 a}+\frac {(A-B) \tan (c+d x)}{2 d (a \sec (c+d x)+a)^{3/2}}\)

\(\Big \downarrow \) 4282

\(\displaystyle \frac {(A-B) \tan (c+d x)}{2 d (a \sec (c+d x)+a)^{3/2}}-\frac {(A+3 B) \int \frac {1}{\frac {a^2 \tan ^2(c+d x)}{\sec (c+d x) a+a}+2 a}d\left (-\frac {a \tan (c+d x)}{\sqrt {\sec (c+d x) a+a}}\right )}{2 a d}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {(A+3 B) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{2 \sqrt {2} a^{3/2} d}+\frac {(A-B) \tan (c+d x)}{2 d (a \sec (c+d x)+a)^{3/2}}\)

Input:

Int[(Sec[c + d*x]*(A + B*Sec[c + d*x]))/(a + a*Sec[c + d*x])^(3/2),x]
 

Output:

((A + 3*B)*ArcTan[(Sqrt[a]*Tan[c + d*x])/(Sqrt[2]*Sqrt[a + a*Sec[c + d*x]] 
)])/(2*Sqrt[2]*a^(3/2)*d) + ((A - B)*Tan[c + d*x])/(2*d*(a + a*Sec[c + d*x 
])^(3/2))
 

Defintions of rubi rules used

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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4282
Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_S 
ymbol] :> Simp[-2/f   Subst[Int[1/(2*a + x^2), x], x, b*(Cot[e + f*x]/Sqrt[ 
a + b*Csc[e + f*x]])], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]
 

rule 4488
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs 
c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(A*b - a*B)*Cot[e + 
f*x]*((a + b*Csc[e + f*x])^m/(a*f*(2*m + 1))), x] + Simp[(a*B*m + A*b*(m + 
1))/(a*b*(2*m + 1))   Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1), x], x] 
 /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] 
&& NeQ[a*B*m + A*b*(m + 1), 0] && LtQ[m, -2^(-1)]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(193\) vs. \(2(72)=144\).

Time = 1.58 (sec) , antiderivative size = 194, normalized size of antiderivative = 2.23

method result size
default \(\frac {\sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (-A \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+B \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+A \ln \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )+3 B \ln \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )\right )}{4 d \,a^{2}}\) \(194\)
parts \(\frac {A \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (-\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+\ln \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )\right )}{4 d \,a^{2}}+\frac {B \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )+3 \ln \left (\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )\right )}{4 d \,a^{2}}\) \(233\)

Input:

int(sec(d*x+c)*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(3/2),x,method=_RETURNVER 
BOSE)
 

Output:

1/4/d/a^2*(a*(1+sec(d*x+c)))^(1/2)*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*(- 
A*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*(csc(d*x+c)-cot(d*x+c))+B*(-2*cos(d 
*x+c)/(1+cos(d*x+c)))^(1/2)*(csc(d*x+c)-cot(d*x+c))+A*ln((-2*cos(d*x+c)/(1 
+cos(d*x+c)))^(1/2)-cot(d*x+c)+csc(d*x+c))+3*B*ln((-2*cos(d*x+c)/(1+cos(d* 
x+c)))^(1/2)-cot(d*x+c)+csc(d*x+c)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 159 vs. \(2 (72) = 144\).

Time = 0.11 (sec) , antiderivative size = 367, normalized size of antiderivative = 4.22 \[ \int \frac {\sec (c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^{3/2}} \, dx=\left [\frac {4 \, {\left (A - B\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - \sqrt {2} {\left ({\left (A + 3 \, B\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (A + 3 \, B\right )} \cos \left (d x + c\right ) + A + 3 \, B\right )} \sqrt {-a} \log \left (\frac {2 \, \sqrt {2} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, a \cos \left (d x + c\right )^{2} + 2 \, a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right )}{8 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}}, \frac {2 \, {\left (A - B\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - \sqrt {2} {\left ({\left (A + 3 \, B\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (A + 3 \, B\right )} \cos \left (d x + c\right ) + A + 3 \, B\right )} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{4 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}}\right ] \] Input:

integrate(sec(d*x+c)*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(3/2),x, algorithm= 
"fricas")
 

Output:

[1/8*(4*(A - B)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)*sin(d 
*x + c) - sqrt(2)*((A + 3*B)*cos(d*x + c)^2 + 2*(A + 3*B)*cos(d*x + c) + A 
 + 3*B)*sqrt(-a)*log((2*sqrt(2)*sqrt(-a)*sqrt((a*cos(d*x + c) + a)/cos(d*x 
 + c))*cos(d*x + c)*sin(d*x + c) + 3*a*cos(d*x + c)^2 + 2*a*cos(d*x + c) - 
 a)/(cos(d*x + c)^2 + 2*cos(d*x + c) + 1)))/(a^2*d*cos(d*x + c)^2 + 2*a^2* 
d*cos(d*x + c) + a^2*d), 1/4*(2*(A - B)*sqrt((a*cos(d*x + c) + a)/cos(d*x 
+ c))*cos(d*x + c)*sin(d*x + c) - sqrt(2)*((A + 3*B)*cos(d*x + c)^2 + 2*(A 
 + 3*B)*cos(d*x + c) + A + 3*B)*sqrt(a)*arctan(sqrt(2)*sqrt((a*cos(d*x + c 
) + a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c))))/(a^2*d*cos(d*x 
+ c)^2 + 2*a^2*d*cos(d*x + c) + a^2*d)]
 

Sympy [F]

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

integrate(sec(d*x+c)*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))**(3/2),x)
 

Output:

Integral((A + B*sec(c + d*x))*sec(c + d*x)/(a*(sec(c + d*x) + 1))**(3/2), 
x)
 

Maxima [F]

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

integrate(sec(d*x+c)*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(3/2),x, algorithm= 
"maxima")
 

Output:

integrate((B*sec(d*x + c) + A)*sec(d*x + c)/(a*sec(d*x + c) + a)^(3/2), x)
 

Giac [A] (verification not implemented)

Time = 0.55 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.53 \[ \int \frac {\sec (c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^{3/2}} \, dx=-\frac {\frac {{\left (\sqrt {2} A + 3 \, \sqrt {2} B\right )} \log \left ({\left | -\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \right |}\right )}{\sqrt {-a} a \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {{\left (\sqrt {2} A a \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - \sqrt {2} B a \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{3}}}{4 \, d} \] Input:

integrate(sec(d*x+c)*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(3/2),x, algorithm= 
"giac")
 

Output:

-1/4*((sqrt(2)*A + 3*sqrt(2)*B)*log(abs(-sqrt(-a)*tan(1/2*d*x + 1/2*c) + s 
qrt(-a*tan(1/2*d*x + 1/2*c)^2 + a)))/(sqrt(-a)*a*sgn(cos(d*x + c))) - (sqr 
t(2)*A*a*sgn(cos(d*x + c)) - sqrt(2)*B*a*sgn(cos(d*x + c)))*sqrt(-a*tan(1/ 
2*d*x + 1/2*c)^2 + a)*tan(1/2*d*x + 1/2*c)/a^3)/d
 

Mupad [F(-1)]

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

int((A + B/cos(c + d*x))/(cos(c + d*x)*(a + a/cos(c + d*x))^(3/2)),x)
 

Output:

int((A + B/cos(c + d*x))/(cos(c + d*x)*(a + a/cos(c + d*x))^(3/2)), x)
 

Reduce [F]

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

int(sec(d*x+c)*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(3/2),x)
 

Output:

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