\(\int \sqrt {a+a \sec (c+d x)} (A+B \sec (c+d x)) \, dx\) [122]

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.37 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.15 \[ \int \sqrt {a+a \sec (c+d x)} (A+B \sec (c+d x)) \, dx=\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \sqrt {a (1+\sec (c+d x))} \left (\sqrt {2} A \arcsin \left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \sqrt {\cos (c+d x)}+2 B \sin \left (\frac {1}{2} (c+d x)\right )\right )}{d} \] Input:

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

Output:

(Sec[(c + d*x)/2]*Sqrt[a*(1 + Sec[c + d*x])]*(Sqrt[2]*A*ArcSin[Sqrt[2]*Sin 
[(c + d*x)/2]]*Sqrt[Cos[c + d*x]] + 2*B*Sin[(c + d*x)/2]))/d
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3042, 4403, 3042, 4261, 216, 4279}

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 {a \sec (c+d x)+a} (A+B \sec (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4403

\(\displaystyle A \int \sqrt {\sec (c+d x) a+a}dx+B \int \sec (c+d x) \sqrt {\sec (c+d x) a+a}dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4261

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 4279

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

Input:

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

Output:

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

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 4261
Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*(b/d) 
  Subst[Int[1/(a + x^2), x], x, b*(Cot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], 
 x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
 

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

rule 4403
Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(d_ 
.) + (c_)), x_Symbol] :> Simp[c   Int[Sqrt[a + b*Csc[e + f*x]], x], x] + Si 
mp[d   Int[Sqrt[a + b*Csc[e + f*x]]*Csc[e + f*x], x], x] /; FreeQ[{a, b, c, 
 d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0]
 
Maple [A] (verified)

Time = 1.30 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.62

method result size
default \(\frac {\sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (\left (2 \csc \left (d x +c \right )-2 \cot \left (d x +c \right )\right ) B +A \sqrt {2}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}\right )\right )}{d}\) \(107\)
parts \(\frac {A \sqrt {2}\, \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 )}}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}\right )}{d}-\frac {2 B \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (-\csc \left (d x +c \right )+\cot \left (d x +c \right )\right )}{d}\) \(120\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

[((A*cos(d*x + c) + A)*sqrt(-a)*log((2*a*cos(d*x + c)^2 - 2*sqrt(-a)*sqrt( 
(a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)*sin(d*x + c) + a*cos(d*x + 
 c) - a)/(cos(d*x + c) + 1)) + 2*B*sqrt((a*cos(d*x + c) + a)/cos(d*x + c)) 
*sin(d*x + c))/(d*cos(d*x + c) + d), -2*((A*cos(d*x + c) + A)*sqrt(a)*arct 
an(sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + 
 c))) - B*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/(d*cos(d*x 
 + c) + d)]
 

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (58) = 116\).

Time = 0.16 (sec) , antiderivative size = 147, normalized size of antiderivative = 2.23 \[ \int \sqrt {a+a \sec (c+d x)} (A+B \sec (c+d x)) \, dx=\frac {A \sqrt {a} \arctan \left ({\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \sin \left (d x + c\right ), {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \cos \left (d x + c\right )\right )}{d} \] Input:

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

Output:

A*sqrt(a)*arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 
 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) 
+ sin(d*x + c), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2 
*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 
cos(d*x + c))/d
 

Giac [B] (verification not implemented)

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

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

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

Output:

-(2*sqrt(2)*sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a)*B*a*sgn(cos(d*x + c))*tan( 
1/2*d*x + 1/2*c)/(a*tan(1/2*d*x + 1/2*c)^2 - a) + A*sqrt(-a)*a*log(abs(2*( 
sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))^2 - 4 
*sqrt(2)*abs(a) - 6*a)/abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan( 
1/2*d*x + 1/2*c)^2 + a))^2 + 4*sqrt(2)*abs(a) - 6*a))*sgn(cos(d*x + c))/ab 
s(a))/d
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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