\(\int \frac {(d \cos (e+f x))^m}{a+b \tan (e+f x)} \, dx\) [707]

Optimal result
Mathematica [C] (warning: unable to verify)
Rubi [A] (warning: unable to verify)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 23, antiderivative size = 140 \[ \int \frac {(d \cos (e+f x))^m}{a+b \tan (e+f x)} \, dx=\frac {b (d \cos (e+f x))^m \operatorname {Hypergeometric2F1}\left (1,-\frac {m}{2},1-\frac {m}{2},\frac {b^2 \sec ^2(e+f x)}{a^2+b^2}\right )}{\left (a^2+b^2\right ) f m}+\frac {\operatorname {AppellF1}\left (\frac {1}{2},1,\frac {2+m}{2},\frac {3}{2},\frac {b^2 \tan ^2(e+f x)}{a^2},-\tan ^2(e+f x)\right ) (d \cos (e+f x))^m \sec ^2(e+f x)^{m/2} \tan (e+f x)}{a f} \] Output:

b*(d*cos(f*x+e))^m*hypergeom([1, -1/2*m],[1-1/2*m],b^2*sec(f*x+e)^2/(a^2+b 
^2))/(a^2+b^2)/f/m+AppellF1(1/2,1,1+1/2*m,3/2,b^2*tan(f*x+e)^2/a^2,-tan(f* 
x+e)^2)*(d*cos(f*x+e))^m*(sec(f*x+e)^2)^(1/2*m)*tan(f*x+e)/a/f
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 8.40 (sec) , antiderivative size = 869, normalized size of antiderivative = 6.21 \[ \int \frac {(d \cos (e+f x))^m}{a+b \tan (e+f x)} \, dx=\frac {2 (1+m) \cos (e+f x) (d \cos (e+f x))^m (a \cos (e+f x)+b \sin (e+f x)) \left (b-b \sec ^2(e+f x)^{m/2}+a m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},1+\frac {m}{2},\frac {3}{2},-\tan ^2(e+f x)\right ) \sec ^2(e+f x)^{m/2} \tan (e+f x)-b \operatorname {AppellF1}\left (m,\frac {m}{2},\frac {m}{2},1+m,\frac {a-i b}{a+b \tan (e+f x)},\frac {a+i b}{a+b \tan (e+f x)}\right ) \left (\frac {b (-i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2} \left (\frac {b (i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2}\right )}{f m \left (2 a^3 \cos ^2(e+f x)+2 a^3 m \cos ^2(e+f x)-2 a b^2 \sin ^2(e+f x)-2 a b^2 m \sin ^2(e+f x)+a^2 b \sin (2 (e+f x))+a^2 b m \sin (2 (e+f x))-2 b^3 \sin ^2(e+f x) \tan (e+f x)-2 b^3 m \sin ^2(e+f x) \tan (e+f x)+(a-i b) b^2 m \operatorname {AppellF1}\left (1+m,1+\frac {m}{2},\frac {m}{2},2+m,\frac {a-i b}{a+b \tan (e+f x)},\frac {a+i b}{a+b \tan (e+f x)}\right ) \left (\frac {b (-i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2} \left (\frac {b (i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2}+a b^2 m \operatorname {AppellF1}\left (1+m,\frac {m}{2},1+\frac {m}{2},2+m,\frac {a-i b}{a+b \tan (e+f x)},\frac {a+i b}{a+b \tan (e+f x)}\right ) \left (\frac {b (-i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2} \left (\frac {b (i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2}+i b^3 m \operatorname {AppellF1}\left (1+m,\frac {m}{2},1+\frac {m}{2},2+m,\frac {a-i b}{a+b \tan (e+f x)},\frac {a+i b}{a+b \tan (e+f x)}\right ) \left (\frac {b (-i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2} \left (\frac {b (i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2}+2 b^2 (1+m) \operatorname {AppellF1}\left (m,\frac {m}{2},\frac {m}{2},1+m,\frac {a-i b}{a+b \tan (e+f x)},\frac {a+i b}{a+b \tan (e+f x)}\right ) \left (\frac {b (-i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2} \left (\frac {b (i+\tan (e+f x))}{a+b \tan (e+f x)}\right )^{m/2} (a+b \tan (e+f x))\right )} \] Input:

Integrate[(d*Cos[e + f*x])^m/(a + b*Tan[e + f*x]),x]
 

Output:

(2*(1 + m)*Cos[e + f*x]*(d*Cos[e + f*x])^m*(a*Cos[e + f*x] + b*Sin[e + f*x 
])*(b - b*(Sec[e + f*x]^2)^(m/2) + a*m*Hypergeometric2F1[1/2, 1 + m/2, 3/2 
, -Tan[e + f*x]^2]*(Sec[e + f*x]^2)^(m/2)*Tan[e + f*x] - b*AppellF1[m, m/2 
, m/2, 1 + m, (a - I*b)/(a + b*Tan[e + f*x]), (a + I*b)/(a + b*Tan[e + f*x 
])]*((b*(-I + Tan[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2)*((b*(I + Tan[e + 
f*x]))/(a + b*Tan[e + f*x]))^(m/2)))/(f*m*(2*a^3*Cos[e + f*x]^2 + 2*a^3*m* 
Cos[e + f*x]^2 - 2*a*b^2*Sin[e + f*x]^2 - 2*a*b^2*m*Sin[e + f*x]^2 + a^2*b 
*Sin[2*(e + f*x)] + a^2*b*m*Sin[2*(e + f*x)] - 2*b^3*Sin[e + f*x]^2*Tan[e 
+ f*x] - 2*b^3*m*Sin[e + f*x]^2*Tan[e + f*x] + (a - I*b)*b^2*m*AppellF1[1 
+ m, 1 + m/2, m/2, 2 + m, (a - I*b)/(a + b*Tan[e + f*x]), (a + I*b)/(a + b 
*Tan[e + f*x])]*((b*(-I + Tan[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2)*((b*( 
I + Tan[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2) + a*b^2*m*AppellF1[1 + m, m 
/2, 1 + m/2, 2 + m, (a - I*b)/(a + b*Tan[e + f*x]), (a + I*b)/(a + b*Tan[e 
 + f*x])]*((b*(-I + Tan[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2)*((b*(I + Ta 
n[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2) + I*b^3*m*AppellF1[1 + m, m/2, 1 
+ m/2, 2 + m, (a - I*b)/(a + b*Tan[e + f*x]), (a + I*b)/(a + b*Tan[e + f*x 
])]*((b*(-I + Tan[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2)*((b*(I + Tan[e + 
f*x]))/(a + b*Tan[e + f*x]))^(m/2) + 2*b^2*(1 + m)*AppellF1[m, m/2, m/2, 1 
 + m, (a - I*b)/(a + b*Tan[e + f*x]), (a + I*b)/(a + b*Tan[e + f*x])]*((b* 
(-I + Tan[e + f*x]))/(a + b*Tan[e + f*x]))^(m/2)*((b*(I + Tan[e + f*x])...
 

Rubi [A] (warning: unable to verify)

Time = 0.48 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.12, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 3998, 3042, 3994, 504, 333, 353, 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 \frac {(d \cos (e+f x))^m}{a+b \tan (e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(d \cos (e+f x))^m}{a+b \tan (e+f x)}dx\)

\(\Big \downarrow \) 3998

\(\displaystyle (d \cos (e+f x))^m (d \sec (e+f x))^m \int \frac {(d \sec (e+f x))^{-m}}{a+b \tan (e+f x)}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle (d \cos (e+f x))^m (d \sec (e+f x))^m \int \frac {(d \sec (e+f x))^{-m}}{a+b \tan (e+f x)}dx\)

\(\Big \downarrow \) 3994

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

\(\Big \downarrow \) 504

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

\(\Big \downarrow \) 333

\(\displaystyle \frac {\sec ^2(e+f x)^{m/2} (d \cos (e+f x))^m \left (\frac {b \tan (e+f x) \operatorname {AppellF1}\left (\frac {1}{2},1,\frac {m+2}{2},\frac {3}{2},\frac {b^2 \tan ^2(e+f x)}{a^2},-\tan ^2(e+f x)\right )}{a}-\int \frac {b \tan (e+f x) \left (\tan ^2(e+f x)+1\right )^{-\frac {m}{2}-1}}{a^2-b^2 \tan ^2(e+f x)}d(b \tan (e+f x))\right )}{b f}\)

\(\Big \downarrow \) 353

\(\displaystyle \frac {\sec ^2(e+f x)^{m/2} (d \cos (e+f x))^m \left (\frac {b \tan (e+f x) \operatorname {AppellF1}\left (\frac {1}{2},1,\frac {m+2}{2},\frac {3}{2},\frac {b^2 \tan ^2(e+f x)}{a^2},-\tan ^2(e+f x)\right )}{a}-\frac {1}{2} \int \frac {\left (\frac {\tan (e+f x)}{b}+1\right )^{-\frac {m}{2}-1}}{a^2-b^2 \tan ^2(e+f x)}d\left (b^2 \tan ^2(e+f x)\right )\right )}{b f}\)

\(\Big \downarrow \) 78

\(\displaystyle \frac {\sec ^2(e+f x)^{m/2} (d \cos (e+f x))^m \left (\frac {b \tan (e+f x) \operatorname {AppellF1}\left (\frac {1}{2},1,\frac {m+2}{2},\frac {3}{2},\frac {b^2 \tan ^2(e+f x)}{a^2},-\tan ^2(e+f x)\right )}{a}+\frac {b^2 \left (\frac {\tan (e+f x)}{b}+1\right )^{-m/2} \operatorname {Hypergeometric2F1}\left (1,-\frac {m}{2},1-\frac {m}{2},\frac {\tan ^2(e+f x) b^2+b^2}{a^2+b^2}\right )}{m \left (a^2+b^2\right )}\right )}{b f}\)

Input:

Int[(d*Cos[e + f*x])^m/(a + b*Tan[e + f*x]),x]
 

Output:

((d*Cos[e + f*x])^m*(Sec[e + f*x]^2)^(m/2)*((b*AppellF1[1/2, 1, (2 + m)/2, 
 3/2, (b^2*Tan[e + f*x]^2)/a^2, -Tan[e + f*x]^2]*Tan[e + f*x])/a + (b^2*Hy 
pergeometric2F1[1, -1/2*m, 1 - m/2, (b^2 + b^2*Tan[e + f*x]^2)/(a^2 + b^2) 
])/((a^2 + b^2)*m*(1 + Tan[e + f*x]/b)^(m/2))))/(b*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 333
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[a^p*c^q*x*AppellF1[1/2, -p, -q, 3/2, (-b)*(x^2/a), (-d)*(x^2/c)], x] /; F 
reeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[p] || GtQ[a, 
0]) && (IntegerQ[q] || GtQ[c, 0])
 

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 504
Int[((a_) + (b_.)*(x_)^2)^(p_)/((c_) + (d_.)*(x_)), x_Symbol] :> Simp[c   I 
nt[(a + b*x^2)^p/(c^2 - d^2*x^2), x], x] - Simp[d   Int[x*((a + b*x^2)^p/(c 
^2 - d^2*x^2)), x], x] /; FreeQ[{a, b, c, d, p}, x]
 

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

rule 3994
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)])^(n_), x_Symbol] :> Simp[d^(2*IntPart[m/2])*((d*Sec[e + f*x])^(2*FracP 
art[m/2])/(b*f*(Sec[e + f*x]^2)^FracPart[m/2]))   Subst[Int[(a + x)^n*(1 + 
x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, 
n}, x] && NeQ[a^2 + b^2, 0] &&  !IntegerQ[m] && IntegerQ[n]
 

rule 3998
Int[(cos[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x 
_)])^(n_.), x_Symbol] :> Simp[(d*Cos[e + f*x])^m*(d*Sec[e + f*x])^m   Int[( 
a + b*Tan[e + f*x])^n/(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m 
, n}, x] &&  !IntegerQ[m]
 
Maple [F]

\[\int \frac {\left (d \cos \left (f x +e \right )\right )^{m}}{a +b \tan \left (f x +e \right )}d x\]

Input:

int((d*cos(f*x+e))^m/(a+b*tan(f*x+e)),x)
 

Output:

int((d*cos(f*x+e))^m/(a+b*tan(f*x+e)),x)
 

Fricas [F]

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

integrate((d*cos(f*x+e))^m/(a+b*tan(f*x+e)),x, algorithm="fricas")
 

Output:

integral((d*cos(f*x + e))^m/(b*tan(f*x + e) + a), x)
 

Sympy [F]

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

integrate((d*cos(f*x+e))**m/(a+b*tan(f*x+e)),x)
 

Output:

Integral((d*cos(e + f*x))**m/(a + b*tan(e + f*x)), x)
 

Maxima [F]

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

integrate((d*cos(f*x+e))^m/(a+b*tan(f*x+e)),x, algorithm="maxima")
 

Output:

integrate((d*cos(f*x + e))^m/(b*tan(f*x + e) + a), x)
 

Giac [F]

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

integrate((d*cos(f*x+e))^m/(a+b*tan(f*x+e)),x, algorithm="giac")
 

Output:

integrate((d*cos(f*x + e))^m/(b*tan(f*x + e) + a), x)
 

Mupad [F(-1)]

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

int((d*cos(e + f*x))^m/(a + b*tan(e + f*x)),x)
 

Output:

int((d*cos(e + f*x))^m/(a + b*tan(e + f*x)), x)
 

Reduce [F]

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

int((d*cos(f*x+e))^m/(a+b*tan(f*x+e)),x)
 

Output:

d**m*int(cos(e + f*x)**m/(tan(e + f*x)*b + a),x)