\(\int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}} \, dx\) [1301]

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

Optimal result

Integrand size = 29, antiderivative size = 163 \[ \int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}} \, dx=-\frac {i \sqrt {a-i b} \text {arctanh}\left (\frac {\sqrt {c-i d} \sqrt {a+b \tan (e+f x)}}{\sqrt {a-i b} \sqrt {c+d \tan (e+f x)}}\right )}{\sqrt {c-i d} f}+\frac {i \sqrt {a+i b} \text {arctanh}\left (\frac {\sqrt {c+i d} \sqrt {a+b \tan (e+f x)}}{\sqrt {a+i b} \sqrt {c+d \tan (e+f x)}}\right )}{\sqrt {c+i d} f} \] Output:

-I*(a-I*b)^(1/2)*arctanh((c-I*d)^(1/2)*(a+b*tan(f*x+e))^(1/2)/(a-I*b)^(1/2 
)/(c+d*tan(f*x+e))^(1/2))/(c-I*d)^(1/2)/f+I*(a+I*b)^(1/2)*arctanh((c+I*d)^ 
(1/2)*(a+b*tan(f*x+e))^(1/2)/(a+I*b)^(1/2)/(c+d*tan(f*x+e))^(1/2))/(c+I*d) 
^(1/2)/f
 

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.02 \[ \int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}} \, dx=-\frac {i \left (\frac {\sqrt {-a+i b} \text {arctanh}\left (\frac {\sqrt {-c+i d} \sqrt {a+b \tan (e+f x)}}{\sqrt {-a+i b} \sqrt {c+d \tan (e+f x)}}\right )}{\sqrt {-c+i d}}-\frac {\sqrt {a+i b} \text {arctanh}\left (\frac {\sqrt {c+i d} \sqrt {a+b \tan (e+f x)}}{\sqrt {a+i b} \sqrt {c+d \tan (e+f x)}}\right )}{\sqrt {c+i d}}\right )}{f} \] Input:

Integrate[Sqrt[a + b*Tan[e + f*x]]/Sqrt[c + d*Tan[e + f*x]],x]
 

Output:

((-I)*((Sqrt[-a + I*b]*ArcTanh[(Sqrt[-c + I*d]*Sqrt[a + b*Tan[e + f*x]])/( 
Sqrt[-a + I*b]*Sqrt[c + d*Tan[e + f*x]])])/Sqrt[-c + I*d] - (Sqrt[a + I*b] 
*ArcTanh[(Sqrt[c + I*d]*Sqrt[a + b*Tan[e + f*x]])/(Sqrt[a + I*b]*Sqrt[c + 
d*Tan[e + f*x]])])/Sqrt[c + I*d]))/f
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 161, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3042, 4058, 661, 2009}

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+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}}dx\)

\(\Big \downarrow \) 4058

\(\displaystyle \frac {\int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)} \left (\tan ^2(e+f x)+1\right )}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 661

\(\displaystyle \frac {\int \left (\frac {i a-b}{2 (i-\tan (e+f x)) \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)}}+\frac {i a+b}{2 (\tan (e+f x)+i) \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)}}\right )d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {i \sqrt {a+i b} \text {arctanh}\left (\frac {\sqrt {c+i d} \sqrt {a+b \tan (e+f x)}}{\sqrt {a+i b} \sqrt {c+d \tan (e+f x)}}\right )}{\sqrt {c+i d}}-\frac {i \sqrt {a-i b} \text {arctanh}\left (\frac {\sqrt {c-i d} \sqrt {a+b \tan (e+f x)}}{\sqrt {a-i b} \sqrt {c+d \tan (e+f x)}}\right )}{\sqrt {c-i d}}}{f}\)

Input:

Int[Sqrt[a + b*Tan[e + f*x]]/Sqrt[c + d*Tan[e + f*x]],x]
 

Output:

(((-I)*Sqrt[a - I*b]*ArcTanh[(Sqrt[c - I*d]*Sqrt[a + b*Tan[e + f*x]])/(Sqr 
t[a - I*b]*Sqrt[c + d*Tan[e + f*x]])])/Sqrt[c - I*d] + (I*Sqrt[a + I*b]*Ar 
cTanh[(Sqrt[c + I*d]*Sqrt[a + b*Tan[e + f*x]])/(Sqrt[a + I*b]*Sqrt[c + d*T 
an[e + f*x]])])/Sqrt[c + I*d])/f
 

Defintions of rubi rules used

rule 661
Int[((d_.) + (e_.)*(x_))^(m_)/(Sqrt[(f_.) + (g_.)*(x_)]*((a_.) + (c_.)*(x_) 
^2)), x_Symbol] :> Int[ExpandIntegrand[1/(Sqrt[d + e*x]*Sqrt[f + g*x]), (d 
+ e*x)^(m + 1/2)/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && IGt 
Q[m + 1/2, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4058
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, S 
imp[ff/f   Subst[Int[(a + b*ff*x)^m*((c + d*ff*x)^n/(1 + ff^2*x^2)), x], x, 
 Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && NeQ[b*c - a 
*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
 
Maple [F(-1)]

Timed out.

hanged

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 6715 vs. \(2 (119) = 238\).

Time = 5.59 (sec) , antiderivative size = 6715, normalized size of antiderivative = 41.20 \[ \int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}} \, dx=\text {Too large to display} \] Input:

integrate((a+b*tan(f*x+e))^(1/2)/(c+d*tan(f*x+e))^(1/2),x, algorithm="fric 
as")
 

Output:

Too large to include
 

Sympy [F]

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

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

Output:

Integral(sqrt(a + b*tan(e + f*x))/sqrt(c + d*tan(e + f*x)), x)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}} \, dx=\text {Exception raised: ValueError} \] Input:

integrate((a+b*tan(f*x+e))^(1/2)/(c+d*tan(f*x+e))^(1/2),x, algorithm="maxi 
ma")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(((2*b*d+2*a*c)^2>0)', see `assum 
e?` for mo
 

Giac [F(-1)]

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

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

Output:

Timed out
 

Mupad [F(-1)]

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

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

Output:

\text{Hanged}
 

Reduce [F]

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

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

Output:

int((sqrt(tan(e + f*x)*d + c)*sqrt(tan(e + f*x)*b + a))/(tan(e + f*x)*d + 
c),x)