\(\int \frac {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))} \, dx\) [585]

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

Optimal result

Integrand size = 23, antiderivative size = 29 \[ \int \frac {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))} \, dx=\frac {2 \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{(a+b) d} \] Output:

2*EllipticPi(sin(1/2*d*x+1/2*c),2*b/(a+b),2^(1/2))/(a+b)/d
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))} \, dx=\frac {2 \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{(a+b) d} \] Input:

Integrate[1/(Sqrt[Cos[c + d*x]]*(a + b*Cos[c + d*x])),x]
 

Output:

(2*EllipticPi[(2*b)/(a + b), (c + d*x)/2, 2])/((a + b)*d)
 

Rubi [A] (verified)

Time = 0.22 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3042, 3284}

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 {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sqrt {\sin \left (c+d x+\frac {\pi }{2}\right )} \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )}dx\)

\(\Big \downarrow \) 3284

\(\displaystyle \frac {2 \operatorname {EllipticPi}\left (\frac {2 b}{a+b},\frac {1}{2} (c+d x),2\right )}{d (a+b)}\)

Input:

Int[1/(Sqrt[Cos[c + d*x]]*(a + b*Cos[c + d*x])),x]
 

Output:

(2*EllipticPi[(2*b)/(a + b), (c + d*x)/2, 2])/((a + b)*d)
 

Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3284
Int[1/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*Sqrt[(c_.) + (d_.)*sin[(e_.) 
 + (f_.)*(x_)]]), x_Symbol] :> Simp[(2/(f*(a + b)*Sqrt[c + d]))*EllipticPi[ 
2*(b/(a + b)), (1/2)*(e - Pi/2 + f*x), 2*(d/(c + d))], x] /; FreeQ[{a, b, c 
, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 
0] && GtQ[c + d, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(149\) vs. \(2(31)=62\).

Time = 1.59 (sec) , antiderivative size = 150, normalized size of antiderivative = 5.17

method result size
default \(-\frac {2 \sqrt {\left (2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1}\, \operatorname {EllipticPi}\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), -\frac {2 b}{a -b}, \sqrt {2}\right )}{\left (a -b \right ) \sqrt {-2 \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1}\, d}\) \(150\)

Input:

int(1/cos(d*x+c)^(1/2)/(a+cos(d*x+c)*b),x,method=_RETURNVERBOSE)
 

Output:

-2*((2*cos(1/2*d*x+1/2*c)^2-1)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(sin(1/2*d*x+1/ 
2*c)^2)^(1/2)*(-2*cos(1/2*d*x+1/2*c)^2+1)^(1/2)*EllipticPi(cos(1/2*d*x+1/2 
*c),-2*b/(a-b),2^(1/2))/(a-b)/(-2*sin(1/2*d*x+1/2*c)^4+sin(1/2*d*x+1/2*c)^ 
2)^(1/2)/sin(1/2*d*x+1/2*c)/(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2)/d
 

Fricas [F(-1)]

Timed out. \[ \int \frac {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))} \, dx=\text {Timed out} \] Input:

integrate(1/cos(d*x+c)^(1/2)/(a+b*cos(d*x+c)),x, algorithm="fricas")
 

Output:

Timed out
 

Sympy [F(-1)]

Timed out. \[ \int \frac {1}{\sqrt {\cos (c+d x)} (a+b \cos (c+d x))} \, dx=\text {Timed out} \] Input:

integrate(1/cos(d*x+c)**(1/2)/(a+b*cos(d*x+c)),x)
 

Output:

Timed out
 

Maxima [F]

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

integrate(1/cos(d*x+c)^(1/2)/(a+b*cos(d*x+c)),x, algorithm="maxima")
 

Output:

integrate(1/((b*cos(d*x + c) + a)*sqrt(cos(d*x + c))), x)
 

Giac [F]

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

integrate(1/cos(d*x+c)^(1/2)/(a+b*cos(d*x+c)),x, algorithm="giac")
 

Output:

integrate(1/((b*cos(d*x + c) + a)*sqrt(cos(d*x + c))), x)
                                                                                    
                                                                                    
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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