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

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

Optimal result

Integrand size = 29, antiderivative size = 218 \[ \int \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)} \, dx=-\frac {i \sqrt {a-i b} \sqrt {c-i d} \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 )}{f}+\frac {i \sqrt {a+i b} \sqrt {c+i d} \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 )}{f}+\frac {2 \sqrt {b} \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d} \sqrt {a+b \tan (e+f x)}}{\sqrt {b} \sqrt {c+d \tan (e+f x)}}\right )}{f} \] Output:

-I*(a-I*b)^(1/2)*(c-I*d)^(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))/f+I*(a+I*b)^(1/2)*(c+I*d)^(1/2)*ar 
ctanh((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))/f+2*b^(1/2)*d^(1/2)*arctanh(d^(1/2)*(a+b*tan(f*x+e))^(1/2)/b^(1/2)/ 
(c+d*tan(f*x+e))^(1/2))/f
 

Mathematica [A] (verified)

Time = 1.48 (sec) , antiderivative size = 261, normalized size of antiderivative = 1.20 \[ \int \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)} \, dx=\frac {i \sqrt {-a+i b} \sqrt {-c+i d} \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 )+i \sqrt {a+i b} \sqrt {c+i d} \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 )+\frac {2 \sqrt {d} \sqrt {b c-a d} \text {arcsinh}\left (\frac {\sqrt {d} \sqrt {a+b \tan (e+f x)}}{\sqrt {b c-a d}}\right ) \sqrt {\frac {b (c+d \tan (e+f x))}{b c-a d}}}{\sqrt {c+d \tan (e+f x)}}}{f} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.70 (sec) , antiderivative size = 213, normalized size of antiderivative = 0.98, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3042, 4058, 659, 66, 221, 2348, 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 \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \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)}}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 659

\(\displaystyle \frac {\int \frac {a c-b d+(b c+a d) \tan (e+f x)}{\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)+b d \int \frac {1}{\sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)}}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 66

\(\displaystyle \frac {\int \frac {a c-b d+(b c+a d) \tan (e+f x)}{\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)+2 b d \int \frac {1}{b-\frac {d (a+b \tan (e+f x))}{c+d \tan (e+f x)}}d\frac {\sqrt {a+b \tan (e+f x)}}{\sqrt {c+d \tan (e+f x)}}}{f}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {\int \frac {a c-b d+(b c+a d) \tan (e+f x)}{\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)+2 \sqrt {b} \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d} \sqrt {a+b \tan (e+f x)}}{\sqrt {b} \sqrt {c+d \tan (e+f x)}}\right )}{f}\)

\(\Big \downarrow \) 2348

\(\displaystyle \frac {2 \sqrt {b} \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d} \sqrt {a+b \tan (e+f x)}}{\sqrt {b} \sqrt {c+d \tan (e+f x)}}\right )+\int \left (\frac {-b c-a d+i (a c-b d)}{2 (i-\tan (e+f x)) \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)}}+\frac {b c+a d+i (a c-b d)}{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 {-i \sqrt {a-i b} \sqrt {c-i d} \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 )+i \sqrt {a+i b} \sqrt {c+i d} \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 )+2 \sqrt {b} \sqrt {d} \text {arctanh}\left (\frac {\sqrt {d} \sqrt {a+b \tan (e+f x)}}{\sqrt {b} \sqrt {c+d \tan (e+f x)}}\right )}{f}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 66
Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[ 
2   Subst[Int[1/(b - d*x^2), x], x, Sqrt[a + b*x]/Sqrt[c + d*x]], x] /; Fre 
eQ[{a, b, c, d}, x] &&  !GtQ[c - a*(d/b), 0]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 659
Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_))/((a_) + (c_.)*(x_ 
)^2), x_Symbol] :> Simp[e*(g/c)   Int[(d + e*x)^(m - 1)*(f + g*x)^(n - 1), 
x], x] + Simp[1/c   Int[Simp[c*d*f - a*e*g + (c*e*f + c*d*g)*x, x]*(d + e*x 
)^(m - 1)*((f + g*x)^(n - 1)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, 
g}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[m, 0] && GtQ[n, 0]
 

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

rule 2348
Int[(Px_)*((c_) + (d_.)*(x_))^(m_.)*((e_) + (f_.)*(x_))^(n_.)*((a_.) + (b_. 
)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Px*(c + d*x)^m*(e + f*x)^ 
n*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && PolyQ[P 
x, x] && (IntegerQ[p] || (IntegerQ[2*p] && IntegerQ[m] && ILtQ[n, 0])) && 
!(IGtQ[m, 0] && IGtQ[n, 0])
 

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.

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

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. 5367 vs. \(2 (162) = 324\).

Time = 3.60 (sec) , antiderivative size = 10750, normalized size of antiderivative = 49.31 \[ \int \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 \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)} \, dx=\int \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]

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

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

Output:

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

Giac [F(-1)]

Timed out. \[ \int \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 \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 \sqrt {a+b \tan (e+f x)} \sqrt {c+d \tan (e+f x)} \, dx=\int \sqrt {d \tan \left (f x +e \right )+c}\, \sqrt {\tan \left (f x +e \right ) b +a}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),x)