Integrand size = 21, antiderivative size = 174 \[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\frac {\sec ^n(e+f x) \sin (e+f x)}{f (a+a \sec (e+f x))}+\frac {(1-n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(e+f x)\right ) \sec ^{-2+n}(e+f x) \sin (e+f x)}{a f (2-n) \sqrt {\sin ^2(e+f x)}}-\frac {\operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(e+f x)\right ) \sec ^{-1+n}(e+f x) \sin (e+f x)}{a f \sqrt {\sin ^2(e+f x)}} \] Output:
sec(f*x+e)^n*sin(f*x+e)/f/(a+a*sec(f*x+e))+(1-n)*hypergeom([1/2, 1-1/2*n], [2-1/2*n],cos(f*x+e)^2)*sec(f*x+e)^(-2+n)*sin(f*x+e)/a/f/(2-n)/(sin(f*x+e) ^2)^(1/2)-hypergeom([1/2, 1/2-1/2*n],[3/2-1/2*n],cos(f*x+e)^2)*sec(f*x+e)^ (-1+n)*sin(f*x+e)/a/f/(sin(f*x+e)^2)^(1/2)
Time = 0.51 (sec) , antiderivative size = 140, normalized size of antiderivative = 0.80 \[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\frac {\cot \left (\frac {1}{2} (e+f x)\right ) \sec ^n(e+f x) \left (n-n \cos (e+f x)+n \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1+n),\frac {1+n}{2},\sec ^2(e+f x)\right ) \sqrt {-\tan ^2(e+f x)}-(-1+n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n}{2},\frac {2+n}{2},\sec ^2(e+f x)\right ) \sqrt {-\tan ^2(e+f x)}\right )}{a f n (1+\sec (e+f x))} \] Input:
Integrate[Sec[e + f*x]^n/(a + a*Sec[e + f*x]),x]
Output:
(Cot[(e + f*x)/2]*Sec[e + f*x]^n*(n - n*Cos[e + f*x] + n*Cos[e + f*x]*Hype rgeometric2F1[1/2, (-1 + n)/2, (1 + n)/2, Sec[e + f*x]^2]*Sqrt[-Tan[e + f* x]^2] - (-1 + n)*Hypergeometric2F1[1/2, n/2, (2 + n)/2, Sec[e + f*x]^2]*Sq rt[-Tan[e + f*x]^2]))/(a*f*n*(1 + Sec[e + f*x]))
Time = 0.64 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 4307, 3042, 4274, 3042, 4259, 3042, 3122}
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 {\sec ^n(e+f x)}{a \sec (e+f x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )^n}{a \csc \left (e+f x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 4307 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \int \sec ^{n-1}(e+f x) (a-a \sec (e+f x))dx}{a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \int \csc \left (e+f x+\frac {\pi }{2}\right )^{n-1} \left (a-a \csc \left (e+f x+\frac {\pi }{2}\right )\right )dx}{a^2}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \left (a \int \sec ^{n-1}(e+f x)dx-a \int \sec ^n(e+f x)dx\right )}{a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \left (a \int \csc \left (e+f x+\frac {\pi }{2}\right )^{n-1}dx-a \int \csc \left (e+f x+\frac {\pi }{2}\right )^ndx\right )}{a^2}\) |
\(\Big \downarrow \) 4259 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \left (a \cos ^n(e+f x) \sec ^n(e+f x) \int \cos ^{1-n}(e+f x)dx-a \cos ^n(e+f x) \sec ^n(e+f x) \int \cos ^{-n}(e+f x)dx\right )}{a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \left (a \cos ^n(e+f x) \sec ^n(e+f x) \int \sin \left (e+f x+\frac {\pi }{2}\right )^{1-n}dx-a \cos ^n(e+f x) \sec ^n(e+f x) \int \sin \left (e+f x+\frac {\pi }{2}\right )^{-n}dx\right )}{a^2}\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle \frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)}-\frac {(1-n) \left (\frac {a \sin (e+f x) \sec ^{n-1}(e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(e+f x)\right )}{f (1-n) \sqrt {\sin ^2(e+f x)}}-\frac {a \sin (e+f x) \sec ^{n-2}(e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(e+f x)\right )}{f (2-n) \sqrt {\sin ^2(e+f x)}}\right )}{a^2}\) |
Input:
Int[Sec[e + f*x]^n/(a + a*Sec[e + f*x]),x]
Output:
(Sec[e + f*x]^n*Sin[e + f*x])/(f*(a + a*Sec[e + f*x])) - ((1 - n)*(-((a*Hy pergeometric2F1[1/2, (2 - n)/2, (4 - n)/2, Cos[e + f*x]^2]*Sec[e + f*x]^(- 2 + n)*Sin[e + f*x])/(f*(2 - n)*Sqrt[Sin[e + f*x]^2])) + (a*Hypergeometric 2F1[1/2, (1 - n)/2, (3 - n)/2, Cos[e + f*x]^2]*Sec[e + f*x]^(-1 + n)*Sin[e + f*x])/(f*(1 - n)*Sqrt[Sin[e + f*x]^2])))/a^2
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[2*n]
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x] )^(n - 1)*((Sin[c + d*x]/b)^(n - 1) Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_)), x_Symbol] :> Simp[(-b)*d*Cot[e + f*x]*((d*Csc[e + f*x])^(n - 1)/(a*f* (a + b*Csc[e + f*x]))), x] + Simp[d*((n - 1)/(a*b)) Int[(d*Csc[e + f*x])^ (n - 1)*(a - b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && EqQ [a^2 - b^2, 0]
\[\int \frac {\sec \left (f x +e \right )^{n}}{a +a \sec \left (f x +e \right )}d x\]
Input:
int(sec(f*x+e)^n/(a+a*sec(f*x+e)),x)
Output:
int(sec(f*x+e)^n/(a+a*sec(f*x+e)),x)
\[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\int { \frac {\sec \left (f x + e\right )^{n}}{a \sec \left (f x + e\right ) + a} \,d x } \] Input:
integrate(sec(f*x+e)^n/(a+a*sec(f*x+e)),x, algorithm="fricas")
Output:
integral(sec(f*x + e)^n/(a*sec(f*x + e) + a), x)
\[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\frac {\int \frac {\sec ^{n}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx}{a} \] Input:
integrate(sec(f*x+e)**n/(a+a*sec(f*x+e)),x)
Output:
Integral(sec(e + f*x)**n/(sec(e + f*x) + 1), x)/a
\[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\int { \frac {\sec \left (f x + e\right )^{n}}{a \sec \left (f x + e\right ) + a} \,d x } \] Input:
integrate(sec(f*x+e)^n/(a+a*sec(f*x+e)),x, algorithm="maxima")
Output:
integrate(sec(f*x + e)^n/(a*sec(f*x + e) + a), x)
Exception generated. \[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\text {Exception raised: TypeError} \] Input:
integrate(sec(f*x+e)^n/(a+a*sec(f*x+e)),x, algorithm="giac")
Output:
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Unable to divide, perhaps due to ro unding error%%%{-1,[0,1,0]%%%} / %%%{2,[0,0,1]%%%} Error: Bad Argument Val ue
Timed out. \[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\int \frac {{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^n}{a+\frac {a}{\cos \left (e+f\,x\right )}} \,d x \] Input:
int((1/cos(e + f*x))^n/(a + a/cos(e + f*x)),x)
Output:
int((1/cos(e + f*x))^n/(a + a/cos(e + f*x)), x)
\[ \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx=\frac {\int \frac {\sec \left (f x +e \right )^{n}}{\sec \left (f x +e \right )+1}d x}{a} \] Input:
int(sec(f*x+e)^n/(a+a*sec(f*x+e)),x)
Output:
int(sec(e + f*x)**n/(sec(e + f*x) + 1),x)/a