\(\int \tan (e+f x) (a+b \tan ^2(e+f x))^{3/2} \, dx\) [308]

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

Optimal result

Integrand size = 23, antiderivative size = 90 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=-\frac {(a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )}{f}+\frac {(a-b) \sqrt {a+b \tan ^2(e+f x)}}{f}+\frac {\left (a+b \tan ^2(e+f x)\right )^{3/2}}{3 f} \] Output:

-(a-b)^(3/2)*arctanh((a+b*tan(f*x+e)^2)^(1/2)/(a-b)^(1/2))/f+(a-b)*(a+b*ta 
n(f*x+e)^2)^(1/2)/f+1/3*(a+b*tan(f*x+e)^2)^(3/2)/f
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.89 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=\frac {-3 (a-b)^{3/2} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )+\sqrt {a+b \tan ^2(e+f x)} \left (4 a-3 b+b \tan ^2(e+f x)\right )}{3 f} \] Input:

Integrate[Tan[e + f*x]*(a + b*Tan[e + f*x]^2)^(3/2),x]
 

Output:

(-3*(a - b)^(3/2)*ArcTanh[Sqrt[a + b*Tan[e + f*x]^2]/Sqrt[a - b]] + Sqrt[a 
 + b*Tan[e + f*x]^2]*(4*a - 3*b + b*Tan[e + f*x]^2))/(3*f)
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.01, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 4153, 353, 60, 60, 73, 221}

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 \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \tan (e+f x) \left (a+b \tan (e+f x)^2\right )^{3/2}dx\)

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 353

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

\(\Big \downarrow \) 60

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

\(\Big \downarrow \) 60

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 221

\(\displaystyle \frac {(a-b) \left (2 \sqrt {a+b \tan ^2(e+f x)}-2 \sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a+b \tan ^2(e+f x)}}{\sqrt {a-b}}\right )\right )+\frac {2}{3} \left (a+b \tan ^2(e+f x)\right )^{3/2}}{2 f}\)

Input:

Int[Tan[e + f*x]*(a + b*Tan[e + f*x]^2)^(3/2),x]
 

Output:

((2*(a + b*Tan[e + f*x]^2)^(3/2))/3 + (a - b)*(-2*Sqrt[a - b]*ArcTanh[Sqrt 
[a + b*Tan[e + f*x]^2]/Sqrt[a - b]] + 2*Sqrt[a + b*Tan[e + f*x]^2]))/(2*f)
 

Defintions of rubi rules used

rule 60
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[ 
(a + b*x)^(m + 1)*((c + d*x)^n/(b*(m + n + 1))), x] + Simp[n*((b*c - a*d)/( 
b*(m + n + 1)))   Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, 
 c, d}, x] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !Integer 
Q[n] || (GtQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinear 
Q[a, b, c, d, m, n, x]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

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 353
Int[(x_)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_Symbol] 
 :> Simp[1/2   Subst[Int[(a + b*x)^p*(c + d*x)^q, x], x, x^2], x] /; FreeQ[ 
{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0]
 

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

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(180\) vs. \(2(78)=156\).

Time = 0.61 (sec) , antiderivative size = 181, normalized size of antiderivative = 2.01

method result size
derivativedivides \(\frac {b \tan \left (f x +e \right )^{2} \sqrt {a +b \tan \left (f x +e \right )^{2}}}{3 f}+\frac {4 a \sqrt {a +b \tan \left (f x +e \right )^{2}}}{3 f}+\frac {b^{2} \arctan \left (\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}}{\sqrt {-a +b}}\right )}{f \sqrt {-a +b}}-\frac {b \sqrt {a +b \tan \left (f x +e \right )^{2}}}{f}-\frac {2 a b \arctan \left (\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}}{\sqrt {-a +b}}\right )}{f \sqrt {-a +b}}+\frac {a^{2} \arctan \left (\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}}{\sqrt {-a +b}}\right )}{f \sqrt {-a +b}}\) \(181\)
default \(\frac {b \tan \left (f x +e \right )^{2} \sqrt {a +b \tan \left (f x +e \right )^{2}}}{3 f}+\frac {4 a \sqrt {a +b \tan \left (f x +e \right )^{2}}}{3 f}+\frac {b^{2} \arctan \left (\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}}{\sqrt {-a +b}}\right )}{f \sqrt {-a +b}}-\frac {b \sqrt {a +b \tan \left (f x +e \right )^{2}}}{f}-\frac {2 a b \arctan \left (\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}}{\sqrt {-a +b}}\right )}{f \sqrt {-a +b}}+\frac {a^{2} \arctan \left (\frac {\sqrt {a +b \tan \left (f x +e \right )^{2}}}{\sqrt {-a +b}}\right )}{f \sqrt {-a +b}}\) \(181\)

Input:

int(tan(f*x+e)*(a+b*tan(f*x+e)^2)^(3/2),x,method=_RETURNVERBOSE)
 

Output:

1/3/f*b*tan(f*x+e)^2*(a+b*tan(f*x+e)^2)^(1/2)+4/3/f*a*(a+b*tan(f*x+e)^2)^( 
1/2)+1/f*b^2/(-a+b)^(1/2)*arctan((a+b*tan(f*x+e)^2)^(1/2)/(-a+b)^(1/2))-b* 
(a+b*tan(f*x+e)^2)^(1/2)/f-2/f*a*b/(-a+b)^(1/2)*arctan((a+b*tan(f*x+e)^2)^ 
(1/2)/(-a+b)^(1/2))+1/f*a^2/(-a+b)^(1/2)*arctan((a+b*tan(f*x+e)^2)^(1/2)/( 
-a+b)^(1/2))
 

Fricas [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 281, normalized size of antiderivative = 3.12 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=\left [-\frac {3 \, {\left (a - b\right )}^{\frac {3}{2}} \log \left (-\frac {b^{2} \tan \left (f x + e\right )^{4} + 2 \, {\left (4 \, a b - 3 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + 4 \, {\left (b \tan \left (f x + e\right )^{2} + 2 \, a - b\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {a - b} + 8 \, a^{2} - 8 \, a b + b^{2}}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}\right ) - 4 \, {\left (b \tan \left (f x + e\right )^{2} + 4 \, a - 3 \, b\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a}}{12 \, f}, -\frac {3 \, {\left (a - b\right )} \sqrt {-a + b} \arctan \left (-\frac {{\left (b \tan \left (f x + e\right )^{2} + 2 \, a - b\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b}}{2 \, {\left ({\left (a b - b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} - a b\right )}}\right ) - 2 \, {\left (b \tan \left (f x + e\right )^{2} + 4 \, a - 3 \, b\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a}}{6 \, f}\right ] \] Input:

integrate(tan(f*x+e)*(a+b*tan(f*x+e)^2)^(3/2),x, algorithm="fricas")
 

Output:

[-1/12*(3*(a - b)^(3/2)*log(-(b^2*tan(f*x + e)^4 + 2*(4*a*b - 3*b^2)*tan(f 
*x + e)^2 + 4*(b*tan(f*x + e)^2 + 2*a - b)*sqrt(b*tan(f*x + e)^2 + a)*sqrt 
(a - b) + 8*a^2 - 8*a*b + b^2)/(tan(f*x + e)^4 + 2*tan(f*x + e)^2 + 1)) - 
4*(b*tan(f*x + e)^2 + 4*a - 3*b)*sqrt(b*tan(f*x + e)^2 + a))/f, -1/6*(3*(a 
 - b)*sqrt(-a + b)*arctan(-1/2*(b*tan(f*x + e)^2 + 2*a - b)*sqrt(b*tan(f*x 
 + e)^2 + a)*sqrt(-a + b)/((a*b - b^2)*tan(f*x + e)^2 + a^2 - a*b)) - 2*(b 
*tan(f*x + e)^2 + 4*a - 3*b)*sqrt(b*tan(f*x + e)^2 + a))/f]
 

Sympy [F]

\[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{\frac {3}{2}} \tan {\left (e + f x \right )}\, dx \] Input:

integrate(tan(f*x+e)*(a+b*tan(f*x+e)**2)**(3/2),x)
 

Output:

Integral((a + b*tan(e + f*x)**2)**(3/2)*tan(e + f*x), x)
 

Maxima [F]

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

integrate(tan(f*x+e)*(a+b*tan(f*x+e)^2)^(3/2),x, algorithm="maxima")
 

Output:

integrate((b*tan(f*x + e)^2 + a)^(3/2)*tan(f*x + e), x)
 

Giac [F(-2)]

Exception generated. \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=\text {Exception raised: TypeError} \] Input:

integrate(tan(f*x+e)*(a+b*tan(f*x+e)^2)^(3/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 [B] (verification not implemented)

Time = 11.08 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.01 \[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=\frac {{\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}^{3/2}}{3\,f}+\frac {\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a}\,\left (a-b\right )}{f}-\frac {\mathrm {atanh}\left (\frac {\sqrt {b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a}\,{\left (a-b\right )}^{3/2}}{a^2-2\,a\,b+b^2}\right )\,{\left (a-b\right )}^{3/2}}{f} \] Input:

int(tan(e + f*x)*(a + b*tan(e + f*x)^2)^(3/2),x)
 

Output:

(a + b*tan(e + f*x)^2)^(3/2)/(3*f) + ((a + b*tan(e + f*x)^2)^(1/2)*(a - b) 
)/f - (atanh(((a + b*tan(e + f*x)^2)^(1/2)*(a - b)^(3/2))/(a^2 - 2*a*b + b 
^2))*(a - b)^(3/2))/f
 

Reduce [F]

\[ \int \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{3/2} \, dx=\frac {\sqrt {\tan \left (f x +e \right )^{2} b +a}\, \tan \left (f x +e \right )^{2} b^{2}+3 \sqrt {\tan \left (f x +e \right )^{2} b +a}\, a^{2}-2 \sqrt {\tan \left (f x +e \right )^{2} b +a}\, a b -3 \left (\int \frac {\sqrt {\tan \left (f x +e \right )^{2} b +a}\, \tan \left (f x +e \right )^{3}}{\tan \left (f x +e \right )^{2} b +a}d x \right ) a^{2} b f +6 \left (\int \frac {\sqrt {\tan \left (f x +e \right )^{2} b +a}\, \tan \left (f x +e \right )^{3}}{\tan \left (f x +e \right )^{2} b +a}d x \right ) a \,b^{2} f -3 \left (\int \frac {\sqrt {\tan \left (f x +e \right )^{2} b +a}\, \tan \left (f x +e \right )^{3}}{\tan \left (f x +e \right )^{2} b +a}d x \right ) b^{3} f}{3 b f} \] Input:

int(tan(f*x+e)*(a+b*tan(f*x+e)^2)^(3/2),x)
 

Output:

(sqrt(tan(e + f*x)**2*b + a)*tan(e + f*x)**2*b**2 + 3*sqrt(tan(e + f*x)**2 
*b + a)*a**2 - 2*sqrt(tan(e + f*x)**2*b + a)*a*b - 3*int((sqrt(tan(e + f*x 
)**2*b + a)*tan(e + f*x)**3)/(tan(e + f*x)**2*b + a),x)*a**2*b*f + 6*int(( 
sqrt(tan(e + f*x)**2*b + a)*tan(e + f*x)**3)/(tan(e + f*x)**2*b + a),x)*a* 
b**2*f - 3*int((sqrt(tan(e + f*x)**2*b + a)*tan(e + f*x)**3)/(tan(e + f*x) 
**2*b + a),x)*b**3*f)/(3*b*f)