\(\int (a+b \sin (e+f x))^3 (g \tan (e+f x))^p \, dx\) [203]

Optimal result
Mathematica [C] (warning: unable to verify)
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 = 271 \[ \int (a+b \sin (e+f x))^3 (g \tan (e+f x))^p \, dx=\frac {a^3 \operatorname {Hypergeometric2F1}\left (1,\frac {1+p}{2},\frac {3+p}{2},-\tan ^2(e+f x)\right ) (g \tan (e+f x))^{1+p}}{f g (1+p)}+\frac {3 a^2 b \cos ^2(e+f x)^{\frac {1+p}{2}} \operatorname {Hypergeometric2F1}\left (\frac {1+p}{2},\frac {2+p}{2},\frac {4+p}{2},\sin ^2(e+f x)\right ) \sin (e+f x) (g \tan (e+f x))^{1+p}}{f g (2+p)}+\frac {b^3 \cos ^2(e+f x)^{\frac {1+p}{2}} \operatorname {Hypergeometric2F1}\left (\frac {1+p}{2},\frac {4+p}{2},\frac {6+p}{2},\sin ^2(e+f x)\right ) \sin ^3(e+f x) (g \tan (e+f x))^{1+p}}{f g (4+p)}+\frac {3 a b^2 \operatorname {Hypergeometric2F1}\left (2,\frac {3+p}{2},\frac {5+p}{2},-\tan ^2(e+f x)\right ) (g \tan (e+f x))^{3+p}}{f g^3 (3+p)} \] Output:

a^3*hypergeom([1, 1/2*p+1/2],[3/2+1/2*p],-tan(f*x+e)^2)*(g*tan(f*x+e))^(p+ 
1)/f/g/(p+1)+3*a^2*b*(cos(f*x+e)^2)^(1/2*p+1/2)*hypergeom([1+1/2*p, 1/2*p+ 
1/2],[2+1/2*p],sin(f*x+e)^2)*sin(f*x+e)*(g*tan(f*x+e))^(p+1)/f/g/(2+p)+b^3 
*(cos(f*x+e)^2)^(1/2*p+1/2)*hypergeom([2+1/2*p, 1/2*p+1/2],[3+1/2*p],sin(f 
*x+e)^2)*sin(f*x+e)^3*(g*tan(f*x+e))^(p+1)/f/g/(4+p)+3*a*b^2*hypergeom([2, 
 3/2+1/2*p],[5/2+1/2*p],-tan(f*x+e)^2)*(g*tan(f*x+e))^(3+p)/f/g^3/(3+p)
 

Mathematica [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.

Time = 16.35 (sec) , antiderivative size = 4791, normalized size of antiderivative = 17.68 \[ \int (a+b \sin (e+f x))^3 (g \tan (e+f x))^p \, dx=\text {Result too large to show} \] Input:

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

Output:

(2*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^p*Tan[(e + f*x)/2]*(a^3*(2 + p)*Appel 
lF1[(1 + p)/2, p, 1, (3 + p)/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 
 2*b*(6*a*b*(2 + p)*AppellF1[(1 + p)/2, p, 2, (3 + p)/2, Tan[(e + f*x)/2]^ 
2, -Tan[(e + f*x)/2]^2] - 6*a*b*(2 + p)*AppellF1[(1 + p)/2, p, 3, (3 + p)/ 
2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (1 + p)*(3*a^2*AppellF1[1 + 
p/2, p, 2, 2 + p/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 4*b^2*(Appe 
llF1[1 + p/2, p, 3, 2 + p/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] - Ap 
pellF1[1 + p/2, p, 4, 2 + p/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]))* 
Tan[(e + f*x)/2]))*(g*Tan[e + f*x])^p*(-1/8*(b^3*Sin[3*(e + f*x)]*Tan[e + 
f*x]^p) - a^3*Sin[e + f*x]^3*Sin[3*(e + f*x)]*Tan[e + f*x]^p + ((3*I)/8)*b 
^3*Sin[2*(e + f*x)]*Sin[3*(e + f*x)]*Tan[e + f*x]^p + (3*b^3*Sin[2*(e + f* 
x)]^2*Sin[3*(e + f*x)]*Tan[e + f*x]^p)/8 - (I/8)*b^3*Sin[2*(e + f*x)]^3*Si 
n[3*(e + f*x)]*Tan[e + f*x]^p + Cos[e + f*x]^3*(a^3*Cos[3*(e + f*x)]*Tan[e 
 + f*x]^p - I*a^3*Sin[3*(e + f*x)]*Tan[e + f*x]^p) + Cos[2*(e + f*x)]^3*(( 
I/8)*b^3*Cos[3*(e + f*x)]*Tan[e + f*x]^p + (b^3*Sin[3*(e + f*x)]*Tan[e + f 
*x]^p)/8) + Sin[e + f*x]^2*((-3*a^2*b*Sin[3*(e + f*x)]*Tan[e + f*x]^p)/2 + 
 ((3*I)/2)*a^2*b*Sin[2*(e + f*x)]*Sin[3*(e + f*x)]*Tan[e + f*x]^p) + Sin[e 
 + f*x]*((-3*a*b^2*Sin[3*(e + f*x)]*Tan[e + f*x]^p)/4 + ((3*I)/2)*a*b^2*Si 
n[2*(e + f*x)]*Sin[3*(e + f*x)]*Tan[e + f*x]^p + (3*a*b^2*Sin[2*(e + f*x)] 
^2*Sin[3*(e + f*x)]*Tan[e + f*x]^p)/4) + Cos[2*(e + f*x)]^2*((-3*b^3*Si...
 

Rubi [A] (verified)

Time = 0.64 (sec) , antiderivative size = 271, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3042, 3201, 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 (a+b \sin (e+f x))^3 (g \tan (e+f x))^p \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \sin (e+f x))^3 (g \tan (e+f x))^pdx\)

\(\Big \downarrow \) 3201

\(\displaystyle \int \left (a^3 (g \tan (e+f x))^p+3 a^2 b \sin (e+f x) (g \tan (e+f x))^p+3 a b^2 \sin ^2(e+f x) (g \tan (e+f x))^p+b^3 \sin ^3(e+f x) (g \tan (e+f x))^p\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a^3 (g \tan (e+f x))^{p+1} \operatorname {Hypergeometric2F1}\left (1,\frac {p+1}{2},\frac {p+3}{2},-\tan ^2(e+f x)\right )}{f g (p+1)}+\frac {3 a^2 b \sin (e+f x) \cos ^2(e+f x)^{\frac {p+1}{2}} (g \tan (e+f x))^{p+1} \operatorname {Hypergeometric2F1}\left (\frac {p+1}{2},\frac {p+2}{2},\frac {p+4}{2},\sin ^2(e+f x)\right )}{f g (p+2)}+\frac {3 a b^2 (g \tan (e+f x))^{p+3} \operatorname {Hypergeometric2F1}\left (2,\frac {p+3}{2},\frac {p+5}{2},-\tan ^2(e+f x)\right )}{f g^3 (p+3)}+\frac {b^3 \sin ^3(e+f x) \cos ^2(e+f x)^{\frac {p+1}{2}} (g \tan (e+f x))^{p+1} \operatorname {Hypergeometric2F1}\left (\frac {p+1}{2},\frac {p+4}{2},\frac {p+6}{2},\sin ^2(e+f x)\right )}{f g (p+4)}\)

Input:

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

Output:

(a^3*Hypergeometric2F1[1, (1 + p)/2, (3 + p)/2, -Tan[e + f*x]^2]*(g*Tan[e 
+ f*x])^(1 + p))/(f*g*(1 + p)) + (3*a^2*b*(Cos[e + f*x]^2)^((1 + p)/2)*Hyp 
ergeometric2F1[(1 + p)/2, (2 + p)/2, (4 + p)/2, Sin[e + f*x]^2]*Sin[e + f* 
x]*(g*Tan[e + f*x])^(1 + p))/(f*g*(2 + p)) + (b^3*(Cos[e + f*x]^2)^((1 + p 
)/2)*Hypergeometric2F1[(1 + p)/2, (4 + p)/2, (6 + p)/2, Sin[e + f*x]^2]*Si 
n[e + f*x]^3*(g*Tan[e + f*x])^(1 + p))/(f*g*(4 + p)) + (3*a*b^2*Hypergeome 
tric2F1[2, (3 + p)/2, (5 + p)/2, -Tan[e + f*x]^2]*(g*Tan[e + f*x])^(3 + p) 
)/(f*g^3*(3 + p))
 

Defintions of rubi rules used

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 3201
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*( 
x_)])^(p_.), x_Symbol] :> Int[ExpandIntegrand[(g*Tan[e + f*x])^p, (a + b*Si 
n[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2, 0] 
&& IGtQ[m, 0]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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