\(\int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \, dx\) [566]

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

Optimal result

Integrand size = 20, antiderivative size = 100 \[ \int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \, dx=\frac {\text {arctanh}\left (\frac {\sqrt {c} \tan (2 a+2 b x)}{\sqrt {-c+c \sec (2 a+2 b x)}}\right )}{b \sqrt {c}}-\frac {\text {arctanh}\left (\frac {\sqrt {c} \tan (2 a+2 b x)}{\sqrt {2} \sqrt {-c+c \sec (2 a+2 b x)}}\right )}{\sqrt {2} b \sqrt {c}} \] Output:

arctanh(c^(1/2)*tan(2*b*x+2*a)/(-c+c*sec(2*b*x+2*a))^(1/2))/b/c^(1/2)-1/2* 
arctanh(1/2*c^(1/2)*tan(2*b*x+2*a)*2^(1/2)/(-c+c*sec(2*b*x+2*a))^(1/2))*2^ 
(1/2)/b/c^(1/2)
 

Mathematica [A] (verified)

Time = 0.44 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.96 \[ \int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \, dx=-\frac {\left (\sqrt {2} \text {arctanh}\left (\sqrt {1-\tan ^2(a+b x)}\right )-2 \text {arctanh}\left (\frac {\sqrt {1-\tan ^2(a+b x)}}{\sqrt {2}}\right )\right ) \tan (a+b x)}{b \sqrt {2-2 \tan ^2(a+b x)} \sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \] Input:

Integrate[1/Sqrt[c*Tan[a + b*x]*Tan[2*(a + b*x)]],x]
 

Output:

-(((Sqrt[2]*ArcTanh[Sqrt[1 - Tan[a + b*x]^2]] - 2*ArcTanh[Sqrt[1 - Tan[a + 
 b*x]^2]/Sqrt[2]])*Tan[a + b*x])/(b*Sqrt[2 - 2*Tan[a + b*x]^2]*Sqrt[c*Tan[ 
a + b*x]*Tan[2*(a + b*x)]]))
 

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.450, Rules used = {3042, 4897, 3042, 4263, 3042, 4261, 220, 4282, 220}

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 {c \tan (a+b x) \tan (2 (a+b x))}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 a+2 b x)}}dx\)

\(\Big \downarrow \) 4897

\(\displaystyle \int \frac {1}{\sqrt {c \sec (2 a+2 b x)-c}}dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4263

\(\displaystyle \int \frac {\sec (2 a+2 b x)}{\sqrt {c \sec (2 a+2 b x)-c}}dx-\frac {\int \sqrt {c \sec (2 a+2 b x)-c}dx}{c}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\csc \left (2 a+2 b x+\frac {\pi }{2}\right )}{\sqrt {c \csc \left (2 a+2 b x+\frac {\pi }{2}\right )-c}}dx-\frac {\int \sqrt {c \csc \left (2 a+2 b x+\frac {\pi }{2}\right )-c}dx}{c}\)

\(\Big \downarrow \) 4261

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

\(\Big \downarrow \) 220

\(\displaystyle \int \frac {\csc \left (2 a+2 b x+\frac {\pi }{2}\right )}{\sqrt {c \csc \left (2 a+2 b x+\frac {\pi }{2}\right )-c}}dx+\frac {\text {arctanh}\left (\frac {\sqrt {c} \tan (2 a+2 b x)}{\sqrt {c \sec (2 a+2 b x)-c}}\right )}{b \sqrt {c}}\)

\(\Big \downarrow \) 4282

\(\displaystyle \frac {\text {arctanh}\left (\frac {\sqrt {c} \tan (2 a+2 b x)}{\sqrt {c \sec (2 a+2 b x)-c}}\right )}{b \sqrt {c}}-\frac {\int \frac {1}{\frac {c^2 \tan ^2(2 a+2 b x)}{c \sec (2 a+2 b x)-c}-2 c}d\left (-\frac {c \tan (2 a+2 b x)}{\sqrt {c \sec (2 a+2 b x)-c}}\right )}{b}\)

\(\Big \downarrow \) 220

\(\displaystyle \frac {\text {arctanh}\left (\frac {\sqrt {c} \tan (2 a+2 b x)}{\sqrt {c \sec (2 a+2 b x)-c}}\right )}{b \sqrt {c}}-\frac {\text {arctanh}\left (\frac {\sqrt {c} \tan (2 a+2 b x)}{\sqrt {2} \sqrt {c \sec (2 a+2 b x)-c}}\right )}{\sqrt {2} b \sqrt {c}}\)

Input:

Int[1/Sqrt[c*Tan[a + b*x]*Tan[2*(a + b*x)]],x]
 

Output:

ArcTanh[(Sqrt[c]*Tan[2*a + 2*b*x])/Sqrt[-c + c*Sec[2*a + 2*b*x]]]/(b*Sqrt[ 
c]) - ArcTanh[(Sqrt[c]*Tan[2*a + 2*b*x])/(Sqrt[2]*Sqrt[-c + c*Sec[2*a + 2* 
b*x]])]/(Sqrt[2]*b*Sqrt[c])
 

Defintions of rubi rules used

rule 220
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(- 
1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && 
 (LtQ[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 4263
Int[1/Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[1/a   I 
nt[Sqrt[a + b*Csc[c + d*x]], x], x] - Simp[b/a   Int[Csc[c + d*x]/Sqrt[a + 
b*Csc[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
 

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 4897
Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(258\) vs. \(2(85)=170\).

Time = 1.07 (sec) , antiderivative size = 259, normalized size of antiderivative = 2.59

method result size
default \(-\frac {\sqrt {2}\, \sqrt {4}\, \left (2 \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \cos \left (b x +a \right )}{\left (\cos \left (b x +a \right )+1\right ) \sqrt {\frac {2 \cos \left (b x +a \right )^{2}-1}{\left (\cos \left (b x +a \right )+1\right )^{2}}}}\right )+\ln \left (\frac {2 \sqrt {\frac {2 \cos \left (b x +a \right )^{2}-1}{\left (\cos \left (b x +a \right )+1\right )^{2}}}\, \cos \left (b x +a \right )+2 \sqrt {\frac {2 \cos \left (b x +a \right )^{2}-1}{\left (\cos \left (b x +a \right )+1\right )^{2}}}-4 \cos \left (b x +a \right )-2}{\cos \left (b x +a \right )+1}\right )-\operatorname {arctanh}\left (\frac {2 \cos \left (b x +a \right )-1}{\left (\cos \left (b x +a \right )+1\right ) \sqrt {\frac {2 \cos \left (b x +a \right )^{2}-1}{\left (\cos \left (b x +a \right )+1\right )^{2}}}}\right )\right ) \left (\cot \left (b x +a \right )-\csc \left (b x +a \right )\right )}{8 b \sqrt {\frac {c \sin \left (b x +a \right )^{2}}{2 \cos \left (b x +a \right )^{2}-1}}\, \sqrt {\frac {2 \cos \left (b x +a \right )^{2}-1}{\left (\cos \left (b x +a \right )+1\right )^{2}}}}\) \(259\)

Input:

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

Output:

-1/8*2^(1/2)/b*4^(1/2)*(2*2^(1/2)*arctanh(2^(1/2)*cos(b*x+a)/(cos(b*x+a)+1 
)/((2*cos(b*x+a)^2-1)/(cos(b*x+a)+1)^2)^(1/2))+ln(2*(((2*cos(b*x+a)^2-1)/( 
cos(b*x+a)+1)^2)^(1/2)*cos(b*x+a)+((2*cos(b*x+a)^2-1)/(cos(b*x+a)+1)^2)^(1 
/2)-2*cos(b*x+a)-1)/(cos(b*x+a)+1))-arctanh((2*cos(b*x+a)-1)/(cos(b*x+a)+1 
)/((2*cos(b*x+a)^2-1)/(cos(b*x+a)+1)^2)^(1/2)))/(c*sin(b*x+a)^2/(2*cos(b*x 
+a)^2-1))^(1/2)/((2*cos(b*x+a)^2-1)/(cos(b*x+a)+1)^2)^(1/2)*(cot(b*x+a)-cs 
c(b*x+a))
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 309, normalized size of antiderivative = 3.09 \[ \int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \, dx=\left [\frac {\sqrt {2} \sqrt {c} \log \left (\frac {c \tan \left (b x + a\right )^{3} - 2 \, \sqrt {-\frac {c \tan \left (b x + a\right )^{2}}{\tan \left (b x + a\right )^{2} - 1}} {\left (\tan \left (b x + a\right )^{2} - 1\right )} \sqrt {c} - 2 \, c \tan \left (b x + a\right )}{\tan \left (b x + a\right )^{3}}\right ) + 2 \, \sqrt {c} \log \left (\frac {c \tan \left (b x + a\right )^{3} + 2 \, \sqrt {2} \sqrt {-\frac {c \tan \left (b x + a\right )^{2}}{\tan \left (b x + a\right )^{2} - 1}} {\left (\tan \left (b x + a\right )^{2} - 1\right )} \sqrt {c} - 3 \, c \tan \left (b x + a\right )}{\tan \left (b x + a\right )^{3} + \tan \left (b x + a\right )}\right )}{4 \, b c}, -\frac {\sqrt {2} \sqrt {-c} \arctan \left (\frac {\sqrt {-\frac {c \tan \left (b x + a\right )^{2}}{\tan \left (b x + a\right )^{2} - 1}} {\left (\tan \left (b x + a\right )^{2} - 1\right )} \sqrt {-c}}{c \tan \left (b x + a\right )}\right ) - 2 \, \sqrt {-c} \arctan \left (\frac {\sqrt {2} \sqrt {-\frac {c \tan \left (b x + a\right )^{2}}{\tan \left (b x + a\right )^{2} - 1}} {\left (\tan \left (b x + a\right )^{2} - 1\right )} \sqrt {-c}}{2 \, c \tan \left (b x + a\right )}\right )}{2 \, b c}\right ] \] Input:

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

Output:

[1/4*(sqrt(2)*sqrt(c)*log((c*tan(b*x + a)^3 - 2*sqrt(-c*tan(b*x + a)^2/(ta 
n(b*x + a)^2 - 1))*(tan(b*x + a)^2 - 1)*sqrt(c) - 2*c*tan(b*x + a))/tan(b* 
x + a)^3) + 2*sqrt(c)*log((c*tan(b*x + a)^3 + 2*sqrt(2)*sqrt(-c*tan(b*x + 
a)^2/(tan(b*x + a)^2 - 1))*(tan(b*x + a)^2 - 1)*sqrt(c) - 3*c*tan(b*x + a) 
)/(tan(b*x + a)^3 + tan(b*x + a))))/(b*c), -1/2*(sqrt(2)*sqrt(-c)*arctan(s 
qrt(-c*tan(b*x + a)^2/(tan(b*x + a)^2 - 1))*(tan(b*x + a)^2 - 1)*sqrt(-c)/ 
(c*tan(b*x + a))) - 2*sqrt(-c)*arctan(1/2*sqrt(2)*sqrt(-c*tan(b*x + a)^2/( 
tan(b*x + a)^2 - 1))*(tan(b*x + a)^2 - 1)*sqrt(-c)/(c*tan(b*x + a))))/(b*c 
)]
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.41 (sec) , antiderivative size = 1685, normalized size of antiderivative = 16.85 \[ \int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \, dx=\text {Too large to display} \] Input:

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

Output:

-1/8*sqrt(2)*(sqrt(2)*log(4*sqrt(cos(4*b*x + 4*a)^2 + sin(4*b*x + 4*a)^2 + 
 2*cos(4*b*x + 4*a) + 1)*cos(1/2*arctan2(sin(4*b*x + 4*a), cos(4*b*x + 4*a 
) + 1))^2 + 4*sqrt(cos(4*b*x + 4*a)^2 + sin(4*b*x + 4*a)^2 + 2*cos(4*b*x + 
 4*a) + 1)*sin(1/2*arctan2(sin(4*b*x + 4*a), cos(4*b*x + 4*a) + 1))^2 + 8* 
(cos(4*b*x + 4*a)^2 + sin(4*b*x + 4*a)^2 + 2*cos(4*b*x + 4*a) + 1)^(1/4)*c 
os(1/2*arctan2(sin(4*b*x + 4*a), cos(4*b*x + 4*a) + 1)) + 4) - sqrt(2)*log 
(cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a)^2 + sqrt(cos(4*b*x + 4*a)^2 + sin(4 
*b*x + 4*a)^2 + 2*cos(4*b*x + 4*a) + 1)*(cos(1/2*arctan2(sin(4*b*x + 4*a), 
 cos(4*b*x + 4*a) + 1))^2 + sin(1/2*arctan2(sin(4*b*x + 4*a), cos(4*b*x + 
4*a) + 1))^2) + 2*(cos(4*b*x + 4*a)^2 + sin(4*b*x + 4*a)^2 + 2*cos(4*b*x + 
 4*a) + 1)^(1/4)*(cos(2*b*x + 2*a)*cos(1/2*arctan2(sin(4*b*x + 4*a), cos(4 
*b*x + 4*a) + 1)) + sin(2*b*x + 2*a)*sin(1/2*arctan2(sin(4*b*x + 4*a), cos 
(4*b*x + 4*a) + 1)))) - 2*log((sqrt(abs(2*e^(2*I*b*x + 2*I*a) - 2)^4 + 16* 
cos(2*b*x + 2*a)^4 + 16*sin(2*b*x + 2*a)^4 + 8*(cos(2*b*x + 2*a)^2 - sin(2 
*b*x + 2*a)^2 + 2*cos(2*b*x + 2*a) + 1)*abs(2*e^(2*I*b*x + 2*I*a) - 2)^2 + 
 64*cos(2*b*x + 2*a)^3 + 32*(cos(2*b*x + 2*a)^2 + 2*cos(2*b*x + 2*a) + 1)* 
sin(2*b*x + 2*a)^2 + 96*cos(2*b*x + 2*a)^2 + 64*cos(2*b*x + 2*a) + 16)*cos 
(1/2*arctan2(8*(cos(2*b*x + 2*a) + 1)*sin(2*b*x + 2*a)/abs(2*e^(2*I*b*x + 
2*I*a) - 2)^2, (abs(2*e^(2*I*b*x + 2*I*a) - 2)^2 + 4*cos(2*b*x + 2*a)^2 - 
4*sin(2*b*x + 2*a)^2 + 8*cos(2*b*x + 2*a) + 4)/abs(2*e^(2*I*b*x + 2*I*a...
 

Giac [F(-2)]

Exception generated. \[ \int \frac {1}{\sqrt {c \tan (a+b x) \tan (2 (a+b x))}} \, dx=\text {Exception raised: TypeError} \] Input:

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const 
index_m & i,const vecteur & l) Error: Bad Argument Value
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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