\(\int \frac {(g \tan (e+f x))^p}{a+a \sin (e+f x)} \, dx\) [126]

Optimal result
Mathematica [B] (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 = 108 \[ \int \frac {(g \tan (e+f x))^p}{a+a \sin (e+f x)} \, dx=\frac {(g \tan (e+f x))^{1+p}}{a f g (1+p)}-\frac {\cos ^2(e+f x)^{\frac {3+p}{2}} \operatorname {Hypergeometric2F1}\left (\frac {2+p}{2},\frac {3+p}{2},\frac {4+p}{2},\sin ^2(e+f x)\right ) \sec (e+f x) (g \tan (e+f x))^{2+p}}{a f g^2 (2+p)} \] Output:

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

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(232\) vs. \(2(108)=216\).

Time = 2.57 (sec) , antiderivative size = 232, normalized size of antiderivative = 2.15 \[ \int \frac {(g \tan (e+f x))^p}{a+a \sin (e+f x)} \, dx=\frac {2 \left (\cos (e+f x) \sec ^2\left (\frac {1}{2} (e+f x)\right )\right )^p \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2 \tan \left (\frac {1}{2} (e+f x)\right ) \left (\left (6+5 p+p^2\right ) \operatorname {Hypergeometric2F1}\left (\frac {1+p}{2},2+p,\frac {3+p}{2},\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )-(1+p) \tan \left (\frac {1}{2} (e+f x)\right ) \left (2 (3+p) \operatorname {Hypergeometric2F1}\left (\frac {2+p}{2},2+p,\frac {4+p}{2},\tan ^2\left (\frac {1}{2} (e+f x)\right )\right )-(2+p) \operatorname {Hypergeometric2F1}\left (2+p,\frac {3+p}{2},\frac {5+p}{2},\tan ^2\left (\frac {1}{2} (e+f x)\right )\right ) \tan \left (\frac {1}{2} (e+f x)\right )\right )\right ) (g \tan (e+f x))^p}{f (1+p) (2+p) (3+p) (a+a \sin (e+f x))} \] Input:

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

Output:

(2*(Cos[e + f*x]*Sec[(e + f*x)/2]^2)^p*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2 
])^2*Tan[(e + f*x)/2]*((6 + 5*p + p^2)*Hypergeometric2F1[(1 + p)/2, 2 + p, 
 (3 + p)/2, Tan[(e + f*x)/2]^2] - (1 + p)*Tan[(e + f*x)/2]*(2*(3 + p)*Hype 
rgeometric2F1[(2 + p)/2, 2 + p, (4 + p)/2, Tan[(e + f*x)/2]^2] - (2 + p)*H 
ypergeometric2F1[2 + p, (3 + p)/2, (5 + p)/2, Tan[(e + f*x)/2]^2]*Tan[(e + 
 f*x)/2]))*(g*Tan[e + f*x])^p)/(f*(1 + p)*(2 + p)*(3 + p)*(a + a*Sin[e + f 
*x]))
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 3185, 3042, 3087, 17, 3097}

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 {(g \tan (e+f x))^p}{a \sin (e+f x)+a} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(g \tan (e+f x))^p}{a \sin (e+f x)+a}dx\)

\(\Big \downarrow \) 3185

\(\displaystyle \frac {\int \sec ^2(e+f x) (g \tan (e+f x))^pdx}{a}-\frac {\int \sec (e+f x) (g \tan (e+f x))^{p+1}dx}{a g}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \sec (e+f x)^2 (g \tan (e+f x))^pdx}{a}-\frac {\int \sec (e+f x) (g \tan (e+f x))^{p+1}dx}{a g}\)

\(\Big \downarrow \) 3087

\(\displaystyle \frac {\int (g \tan (e+f x))^pd\tan (e+f x)}{a f}-\frac {\int \sec (e+f x) (g \tan (e+f x))^{p+1}dx}{a g}\)

\(\Big \downarrow \) 17

\(\displaystyle \frac {(g \tan (e+f x))^{p+1}}{a f g (p+1)}-\frac {\int \sec (e+f x) (g \tan (e+f x))^{p+1}dx}{a g}\)

\(\Big \downarrow \) 3097

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

Input:

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

Output:

(g*Tan[e + f*x])^(1 + p)/(a*f*g*(1 + p)) - ((Cos[e + f*x]^2)^((3 + p)/2)*H 
ypergeometric2F1[(2 + p)/2, (3 + p)/2, (4 + p)/2, Sin[e + f*x]^2]*Sec[e + 
f*x]*(g*Tan[e + f*x])^(2 + p))/(a*f*g^2*(2 + p))
 

Defintions of rubi rules used

rule 17
Int[(c_.)*((a_.) + (b_.)*(x_))^(m_.), x_Symbol] :> Simp[c*((a + b*x)^(m + 1 
)/(b*(m + 1))), x] /; FreeQ[{a, b, c, m}, x] && NeQ[m, -1]
 

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

rule 3087
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> Simp[1/f   Subst[Int[(b*x)^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + 
f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n - 1) 
/2] && LtQ[0, n, m - 1])
 

rule 3097
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_), x_Symbol] :> Simp[(a*Sec[e + f*x])^m*(b*Tan[e + f*x])^(n + 1)*((Cos[e 
+ f*x]^2)^((m + n + 1)/2)/(b*f*(n + 1)))*Hypergeometric2F1[(n + 1)/2, (m + 
n + 1)/2, (n + 3)/2, Sin[e + f*x]^2], x] /; FreeQ[{a, b, e, f, m, n}, x] && 
  !IntegerQ[(n - 1)/2] &&  !IntegerQ[m/2]
 

rule 3185
Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[1/a   Int[Sec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x 
] - Simp[1/(b*g)   Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /; Fre 
eQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral((g*tan(f*x + e))^p/(a*sin(f*x + e) + a), x)
 

Sympy [F]

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

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

Output:

Integral((g*tan(e + f*x))**p/(sin(e + f*x) + 1), x)/a
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(g**p*int(tan(e + f*x)**p/(sin(e + f*x) + 1),x))/a