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

Optimal result
Mathematica [A] (warning: unable to verify)
Rubi [A] (verified)
Maple [B] (warning: unable to verify)
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 = 45, antiderivative size = 119 \[ \int \frac {\sqrt {a+a \sec (c+d x)} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\frac {\sqrt {a} (2 B+C) \text {arcsinh}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {a (2 A-C) \sqrt {\sec (c+d x)} \sin (c+d x)}{d \sqrt {a+a \sec (c+d x)}}+\frac {C \sqrt {\sec (c+d x)} \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{d} \] Output:

a^(1/2)*(2*B+C)*arcsinh(a^(1/2)*tan(d*x+c)/(a+a*sec(d*x+c))^(1/2))/d+a*(2* 
A-C)*sec(d*x+c)^(1/2)*sin(d*x+c)/d/(a+a*sec(d*x+c))^(1/2)+C*sec(d*x+c)^(1/ 
2)*(a+a*sec(d*x+c))^(1/2)*sin(d*x+c)/d
 

Mathematica [A] (warning: unable to verify)

Time = 1.58 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.87 \[ \int \frac {\sqrt {a+a \sec (c+d x)} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\frac {a \left (C \arcsin \left (\sqrt {1-\sec (c+d x)}\right )-2 B \arcsin \left (\sqrt {\sec (c+d x)}\right )+(C+2 A \cos (c+d x)) \sqrt {(-1+\cos (c+d x)) \sec ^2(c+d x)}\right ) \tan (c+d x)}{d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \] Input:

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

Output:

(a*(C*ArcSin[Sqrt[1 - Sec[c + d*x]]] - 2*B*ArcSin[Sqrt[Sec[c + d*x]]] + (C 
 + 2*A*Cos[c + d*x])*Sqrt[(-1 + Cos[c + d*x])*Sec[c + d*x]^2])*Tan[c + d*x 
])/(d*Sqrt[1 - Sec[c + d*x]]*Sqrt[a*(1 + Sec[c + d*x])])
 

Rubi [A] (verified)

Time = 0.74 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.10, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.178, Rules used = {3042, 4576, 27, 3042, 4503, 3042, 4288, 222}

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 {\sqrt {a \sec (c+d x)+a} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4576

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4503

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4288

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

\(\Big \downarrow \) 222

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

Input:

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

Output:

(C*Sqrt[Sec[c + d*x]]*Sqrt[a + a*Sec[c + d*x]]*Sin[c + d*x])/d + ((2*a^(3/ 
2)*(2*B + C)*ArcSinh[(Sqrt[a]*Tan[c + d*x])/Sqrt[a + a*Sec[c + d*x]]])/d + 
 (2*a^2*(2*A - C)*Sqrt[Sec[c + d*x]]*Sin[c + d*x])/(d*Sqrt[a + a*Sec[c + d 
*x]]))/(2*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 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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

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

rule 4503
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) 
 + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[A*b^2*Co 
t[e + f*x]*((d*Csc[e + f*x])^n/(a*f*n*Sqrt[a + b*Csc[e + f*x]])), x] + Simp 
[(A*b*(2*n + 1) + 2*a*B*n)/(2*a*d*n)   Int[Sqrt[a + b*Csc[e + f*x]]*(d*Csc[ 
e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a 
*B, 0] && EqQ[a^2 - b^2, 0] && NeQ[A*b*(2*n + 1) + 2*a*B*n, 0] && LtQ[n, 0]
 

rule 4576
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a 
_))^(m_), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Cs 
c[e + f*x])^n/(f*(m + n + 1))), x] + Simp[1/(b*(m + n + 1))   Int[(a + b*Cs 
c[e + f*x])^m*(d*Csc[e + f*x])^n*Simp[A*b*(m + n + 1) + b*C*n + (a*C*m + b* 
B*(m + n + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C, m 
, n}, x] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)] &&  !LtQ[n, -2^(-1)] && 
NeQ[m + n + 1, 0]
 
Maple [B] (warning: unable to verify)

Leaf count of result is larger than twice the leaf count of optimal. \(296\) vs. \(2(105)=210\).

Time = 6.05 (sec) , antiderivative size = 297, normalized size of antiderivative = 2.50

method result size
default \(\frac {\sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (4 C \tan \left (d x +c \right )+8 A \sin \left (d x +c \right )+2 \sqrt {2}\, \left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {2}{\cos \left (d x +c \right )+1}}\, \arctan \left (\frac {-\cot \left (d x +c \right )+\csc \left (d x +c \right )-1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right ) B +\sqrt {2}\, \left (\cos \left (d x +c \right )+1\right ) C \sqrt {-\frac {2}{\cos \left (d x +c \right )+1}}\, \arctan \left (\frac {-\cot \left (d x +c \right )+\csc \left (d x +c \right )-1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right )+2 \sqrt {2}\, \left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {2}{\cos \left (d x +c \right )+1}}\, \arctan \left (\frac {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right ) B +\sqrt {2}\, \left (\cos \left (d x +c \right )+1\right ) C \sqrt {-\frac {2}{\cos \left (d x +c \right )+1}}\, \arctan \left (\frac {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right )\right )}{4 d \left (\cos \left (d x +c \right )+1\right ) \sqrt {\sec \left (d x +c \right )}}\) \(297\)
parts \(-\frac {2 A \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 \sqrt {\sec \left (d x +c \right )}}-\frac {B \left (\arctan \left (\frac {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right )-\arctan \left (\frac {\cot \left (d x +c \right )-\csc \left (d x +c \right )+1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right )\right ) \sqrt {\sec \left (d x +c \right )}\, \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \cos \left (d x +c \right )}{d \left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}+\frac {C \sec \left (d x +c \right )^{\frac {3}{2}} \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (\sin \left (d x +c \right ) \cos \left (d x +c \right ) \sqrt {2}\, \sqrt {-\frac {2}{\cos \left (d x +c \right )+1}}-\arctan \left (\frac {-\cot \left (d x +c \right )+\csc \left (d x +c \right )+1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right ) \cos \left (d x +c \right )^{2}+\cos \left (d x +c \right )^{2} \arctan \left (\frac {\cot \left (d x +c \right )-\csc \left (d x +c \right )+1}{2 \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\right )\right )}{2 d \left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {1}{\cos \left (d x +c \right )+1}}}\) \(334\)

Input:

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

Output:

1/4/d*(a*(1+sec(d*x+c)))^(1/2)/(cos(d*x+c)+1)/sec(d*x+c)^(1/2)*(4*C*tan(d* 
x+c)+8*A*sin(d*x+c)+2*2^(1/2)*(cos(d*x+c)+1)*(-2/(cos(d*x+c)+1))^(1/2)*arc 
tan(1/2*(-cot(d*x+c)+csc(d*x+c)-1)/(-1/(cos(d*x+c)+1))^(1/2))*B+2^(1/2)*(c 
os(d*x+c)+1)*C*(-2/(cos(d*x+c)+1))^(1/2)*arctan(1/2*(-cot(d*x+c)+csc(d*x+c 
)-1)/(-1/(cos(d*x+c)+1))^(1/2))+2*2^(1/2)*(cos(d*x+c)+1)*(-2/(cos(d*x+c)+1 
))^(1/2)*arctan(1/2*(-cot(d*x+c)+csc(d*x+c)+1)/(-1/(cos(d*x+c)+1))^(1/2))* 
B+2^(1/2)*(cos(d*x+c)+1)*C*(-2/(cos(d*x+c)+1))^(1/2)*arctan(1/2*(-cot(d*x+ 
c)+csc(d*x+c)+1)/(-1/(cos(d*x+c)+1))^(1/2)))
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 923 vs. \(2 (105) = 210\).

Time = 0.34 (sec) , antiderivative size = 923, normalized size of antiderivative = 7.76 \[ \int \frac {\sqrt {a+a \sec (c+d x)} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx=\text {Too large to display} \] Input:

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

Output:

1/4*(8*sqrt(2)*A*sqrt(a)*sin(1/2*d*x + 1/2*c) + 2*B*sqrt(a)*(log(2*cos(1/2 
*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c 
) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2 
*sin(1/2*d*x + 1/2*c)^2 + 2*sqrt(2)*cos(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1 
/2*d*x + 1/2*c) + 2) + log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2* 
c)^2 - 2*sqrt(2)*cos(1/2*d*x + 1/2*c) + 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2 
) - log(2*cos(1/2*d*x + 1/2*c)^2 + 2*sin(1/2*d*x + 1/2*c)^2 - 2*sqrt(2)*co 
s(1/2*d*x + 1/2*c) - 2*sqrt(2)*sin(1/2*d*x + 1/2*c) + 2)) - (4*sqrt(2)*cos 
(3/2*arctan2(sin(d*x + c), cos(d*x + c)))*sin(2*d*x + 2*c) - 4*sqrt(2)*cos 
(1/2*arctan2(sin(d*x + c), cos(d*x + c)))*sin(2*d*x + 2*c) - (cos(2*d*x + 
2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*log(2*cos(1/2*arctan 
2(sin(d*x + c), cos(d*x + c)))^2 + 2*sin(1/2*arctan2(sin(d*x + c), cos(d*x 
 + c)))^2 + 2*sqrt(2)*cos(1/2*arctan2(sin(d*x + c), cos(d*x + c))) + 2*sqr 
t(2)*sin(1/2*arctan2(sin(d*x + c), cos(d*x + c))) + 2) + (cos(2*d*x + 2*c) 
^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*log(2*cos(1/2*arctan2(si 
n(d*x + c), cos(d*x + c)))^2 + 2*sin(1/2*arctan2(sin(d*x + c), cos(d*x + c 
)))^2 + 2*sqrt(2)*cos(1/2*arctan2(sin(d*x + c), cos(d*x + c))) - 2*sqrt(2) 
*sin(1/2*arctan2(sin(d*x + c), cos(d*x + c))) + 2) - (cos(2*d*x + 2*c)^2 + 
 sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*log(2*cos(1/2*arctan2(sin(d* 
x + c), cos(d*x + c)))^2 + 2*sin(1/2*arctan2(sin(d*x + c), cos(d*x + c)...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 345 vs. \(2 (105) = 210\).

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

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

Output:

1/2*(4*sqrt(2)*A*a*sgn(cos(d*x + c))*tan(1/2*d*x + 1/2*c)/sqrt(a*tan(1/2*d 
*x + 1/2*c)^2 + a) + (2*B*sqrt(a)*sgn(cos(d*x + c)) + C*sqrt(a)*sgn(cos(d* 
x + c)))*log(abs((sqrt(a)*tan(1/2*d*x + 1/2*c) - sqrt(a*tan(1/2*d*x + 1/2* 
c)^2 + a))^2 - a*(2*sqrt(2) + 3))) - (2*B*sqrt(a)*sgn(cos(d*x + c)) + C*sq 
rt(a)*sgn(cos(d*x + c)))*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))^2 + a*(2*sqrt(2) - 3))) + 4*(3*sqrt(2)*(sqrt(a) 
*tan(1/2*d*x + 1/2*c) - sqrt(a*tan(1/2*d*x + 1/2*c)^2 + a))^2*C*a^(3/2)*sg 
n(cos(d*x + c)) - sqrt(2)*C*a^(5/2)*sgn(cos(d*x + c)))/((sqrt(a)*tan(1/2*d 
*x + 1/2*c) - sqrt(a*tan(1/2*d*x + 1/2*c)^2 + a))^4 - 6*(sqrt(a)*tan(1/2*d 
*x + 1/2*c) - sqrt(a*tan(1/2*d*x + 1/2*c)^2 + a))^2*a + a^2))/d
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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