\(\int \tan ^3(e+f x) (a+b \tan ^2(e+f x))^p \, dx\) [362]

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

Optimal result

Integrand size = 23, antiderivative size = 95 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^p \, dx=\frac {\left (a+b \tan ^2(e+f x)\right )^{1+p}}{2 b f (1+p)}+\frac {\operatorname {Hypergeometric2F1}\left (1,1+p,2+p,\frac {a+b \tan ^2(e+f x)}{a-b}\right ) \left (a+b \tan ^2(e+f x)\right )^{1+p}}{2 (a-b) f (1+p)} \] Output:

1/2*(a+b*tan(f*x+e)^2)^(p+1)/b/f/(p+1)+1/2*hypergeom([1, p+1],[2+p],(a+b*t 
an(f*x+e)^2)/(a-b))*(a+b*tan(f*x+e)^2)^(p+1)/(a-b)/f/(p+1)
 

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.77 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^p \, dx=-\frac {\left (a-b+b \operatorname {Hypergeometric2F1}\left (1,1+p,2+p,\frac {a+b \tan ^2(e+f x)}{a-b}\right )\right ) \left (a+b \tan ^2(e+f x)\right )^{1+p}}{2 b (-a+b) f (1+p)} \] Input:

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

Output:

-1/2*((a - b + b*Hypergeometric2F1[1, 1 + p, 2 + p, (a + b*Tan[e + f*x]^2) 
/(a - b)])*(a + b*Tan[e + f*x]^2)^(1 + p))/(b*(-a + b)*f*(1 + p))
 

Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.95, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4153, 354, 90, 78}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \tan (e+f x)^3 \left (a+b \tan (e+f x)^2\right )^pdx\)

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 354

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

\(\Big \downarrow \) 90

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

\(\Big \downarrow \) 78

\(\displaystyle \frac {\frac {\left (a+b \tan ^2(e+f x)\right )^{p+1} \operatorname {Hypergeometric2F1}\left (1,p+1,p+2,\frac {b \tan ^2(e+f x)+a}{a-b}\right )}{(p+1) (a-b)}+\frac {\left (a+b \tan ^2(e+f x)\right )^{p+1}}{b (p+1)}}{2 f}\)

Input:

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

Output:

((a + b*Tan[e + f*x]^2)^(1 + p)/(b*(1 + p)) + (Hypergeometric2F1[1, 1 + p, 
 2 + p, (a + b*Tan[e + f*x]^2)/(a - b)]*(a + b*Tan[e + f*x]^2)^(1 + p))/(( 
a - b)*(1 + p)))/(2*f)
 

Defintions of rubi rules used

rule 78
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b 
*c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m 
 + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] 
 &&  !IntegerQ[m] && IntegerQ[n]
 

rule 90
Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p 
_.), x_] :> Simp[b*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), 
 x] + Simp[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(d*f*(n + p 
+ 2))   Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, 
p}, x] && NeQ[n + p + 2, 0]
 

rule 354
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S 
ymbol] :> Simp[1/2   Subst[Int[x^((m - 1)/2)*(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] && IntegerQ 
[(m - 1)/2]
 

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 [F]

\[\int \tan \left (f x +e \right )^{3} \left (a +b \tan \left (f x +e \right )^{2}\right )^{p}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral((b*tan(f*x + e)^2 + a)^p*tan(f*x + e)^3, x)
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^p \, dx=\int {\mathrm {tan}\left (e+f\,x\right )}^3\,{\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}^p \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

((tan(e + f*x)**2*b + a)**p*tan(e + f*x)**2*b*p - (tan(e + f*x)**2*b + a)* 
*p*a + 2*int(((tan(e + f*x)**2*b + a)**p*tan(e + f*x)**3)/(tan(e + f*x)**2 
*b + a),x)*a*b*f*p**2 + 2*int(((tan(e + f*x)**2*b + a)**p*tan(e + f*x)**3) 
/(tan(e + f*x)**2*b + a),x)*a*b*f*p - 2*int(((tan(e + f*x)**2*b + a)**p*ta 
n(e + f*x)**3)/(tan(e + f*x)**2*b + a),x)*b**2*f*p**2 - 2*int(((tan(e + f* 
x)**2*b + a)**p*tan(e + f*x)**3)/(tan(e + f*x)**2*b + a),x)*b**2*f*p)/(2*b 
*f*p*(p + 1))