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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.20 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.90 \[ \int \frac {\sec ^2(c+d x) (A+B \sec (c+d x))}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\left (-3 \sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right )+2 \sqrt {1-\sec (c+d x)} (3 A-B+B \sec (c+d x))\right ) \tan (c+d x)}{3 d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.63 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.242, Rules used = {3042, 4498, 27, 3042, 4489, 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 ^2(c+d x) (A+B \sec (c+d x))}{\sqrt {a \sec (c+d x)+a}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4498

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4489

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2 a (3 A-2 B) \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}-3 a (A-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}{3 a}+\frac {2 B \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 a d}\)

\(\Big \downarrow \) 4282

\(\displaystyle \frac {\frac {6 a (A-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 )}{d}+\frac {2 a (3 A-2 B) \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}}{3 a}+\frac {2 B \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{3 a d}\)

\(\Big \downarrow \) 216

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

Input:

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

Output:

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

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 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 4489
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs 
c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*(( 
a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[(a*B*m + A*b*(m + 1))/(b*(m + 
 1))   Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m, x], x] /; FreeQ[{a, b, A, B 
, e, f, m}, 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)]
 

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

Time = 1.09 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.69

method result size
default \(-\frac {\sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (-6 A \sin \left (d x +c \right )+B \left (2 \sin \left (d x +c \right )-2 \tan \left (d x +c \right )\right )+3 \sqrt {2}\, \left (1+\cos \left (d x +c \right )\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \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 ) A -3 \sqrt {2}\, \left (1+\cos \left (d x +c \right )\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \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 ) B \right )}{3 d a \left (1+\cos \left (d x +c \right )\right )}\) \(200\)
parts \(\frac {A \left (-\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 ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-2 \cot \left (d x +c \right )+2 \csc \left (d x +c \right )\right ) \sqrt {a \left (1+\sec \left (d x +c \right )\right )}}{d a}+\frac {B \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (-2 \sin \left (d x +c \right )+2 \tan \left (d x +c \right )+3 \sqrt {2}\, \left (1+\cos \left (d x +c \right )\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{1+\cos \left (d x +c \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 )}{3 d a \left (1+\cos \left (d x +c \right )\right )}\) \(214\)

Input:

int(sec(d*x+c)^2*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(1/2),x,method=_RETURNV 
ERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 352, normalized size of antiderivative = 2.98 \[ \int \frac {\sec ^2(c+d x) (A+B \sec (c+d x))}{\sqrt {a+a \sec (c+d x)}} \, dx=\left [-\frac {3 \, \sqrt {2} {\left ({\left (A - B\right )} a \cos \left (d x + c\right )^{2} + {\left (A - B\right )} a \cos \left (d x + c\right )\right )} \sqrt {-\frac {1}{a}} \log \left (-\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 3 \, \cos \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) - 4 \, {\left ({\left (3 \, A - B\right )} \cos \left (d x + c\right ) + B\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{6 \, {\left (a d \cos \left (d x + c\right )^{2} + a d \cos \left (d x + c\right )\right )}}, \frac {2 \, {\left ({\left (3 \, A - B\right )} \cos \left (d x + c\right ) + B\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right ) + \frac {3 \, \sqrt {2} {\left ({\left (A - B\right )} a \cos \left (d x + c\right )^{2} + {\left (A - B\right )} a \cos \left (d x + c\right )\right )} \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 )}{\sqrt {a}}}{3 \, {\left (a d \cos \left (d x + c\right )^{2} + a d \cos \left (d x + c\right )\right )}}\right ] \] Input:

integrate(sec(d*x+c)^2*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(1/2),x, algorith 
m="fricas")
 

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

integrate(sec(d*x+c)^2*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(1/2),x, algorith 
m="maxima")
 

Output:

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

Giac [A] (verification not implemented)

Time = 0.54 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.40 \[ \int \frac {\sec ^2(c+d x) (A+B \sec (c+d x))}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\frac {3 \, \sqrt {2} {\left (A - 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} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {2 \, {\left (\frac {\sqrt {2} {\left (3 \, A a - 2 \, B a\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}{\mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {3 \, \sqrt {2} A a}{\mathrm {sgn}\left (\cos \left (d x + c\right )\right )}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}}}{3 \, d} \] Input:

integrate(sec(d*x+c)^2*(A+B*sec(d*x+c))/(a+a*sec(d*x+c))^(1/2),x, algorith 
m="giac")
 

Output:

1/3*(3*sqrt(2)*(A - B)*log(abs(-sqrt(-a)*tan(1/2*d*x + 1/2*c) + sqrt(-a*ta 
n(1/2*d*x + 1/2*c)^2 + a)))/(sqrt(-a)*sgn(cos(d*x + c))) + 2*(sqrt(2)*(3*A 
*a - 2*B*a)*tan(1/2*d*x + 1/2*c)^2/sgn(cos(d*x + c)) - 3*sqrt(2)*A*a/sgn(c 
os(d*x + c)))*tan(1/2*d*x + 1/2*c)/((a*tan(1/2*d*x + 1/2*c)^2 - a)*sqrt(-a 
*tan(1/2*d*x + 1/2*c)^2 + a)))/d
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {\sec ^2(c+d x) (A+B \sec (c+d x))}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\sqrt {a}\, \left (\left (\int \frac {\sqrt {\sec \left (d x +c \right )+1}\, \sec \left (d x +c \right )^{3}}{\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 )^{2}}{\sec \left (d x +c \right )+1}d x \right ) a \right )}{a} \] Input:

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

Output:

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