Integrand size = 34, antiderivative size = 226 \[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=-\frac {c g (3-4 p) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-p}{2},\frac {3-p}{2},\cos ^2(e+f x)\right ) (g \sec (e+f x))^{-1+p} \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}+\frac {c (5-4 p) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {p}{2},\frac {2-p}{2},\cos ^2(e+f x)\right ) (g \sec (e+f x))^p \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {c (5-4 p) (g \sec (e+f x))^p \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2} \] Output:
-1/3*c*g*(3-4*p)*hypergeom([1/2, 1/2-1/2*p],[3/2-1/2*p],cos(f*x+e)^2)*(g*s ec(f*x+e))^(-1+p)*sin(f*x+e)/a^2/f/(sin(f*x+e)^2)^(1/2)+1/3*c*(5-4*p)*hype rgeom([1/2, -1/2*p],[1-1/2*p],cos(f*x+e)^2)*(g*sec(f*x+e))^p*sin(f*x+e)/a^ 2/f/(sin(f*x+e)^2)^(1/2)-1/3*c*(5-4*p)*(g*sec(f*x+e))^p*tan(f*x+e)/a^2/f/( 1+sec(f*x+e))-2/3*c*(g*sec(f*x+e))^p*tan(f*x+e)/f/(a+a*sec(f*x+e))^2
Time = 1.74 (sec) , antiderivative size = 187, normalized size of antiderivative = 0.83 \[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=-\frac {c (g \sec (e+f x))^p \left (2 p (1+p) \tan (e+f x)+(1+\sec (e+f x)) \left (-p (1+p) (-5+4 p) \tan (e+f x)-\left ((-1+p) (1+p) (-3+4 p) \cot (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {p}{2},\frac {2+p}{2},\sec ^2(e+f x)\right )+(5-4 p) p^2 \csc (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+p}{2},\frac {3+p}{2},\sec ^2(e+f x)\right )\right ) (1+\sec (e+f x)) \sqrt {-\tan ^2(e+f x)}\right )\right )}{3 a^2 f p (1+p) (1+\sec (e+f x))^2} \] Input:
Integrate[((g*Sec[e + f*x])^p*(c - c*Sec[e + f*x]))/(a + a*Sec[e + f*x])^2 ,x]
Output:
-1/3*(c*(g*Sec[e + f*x])^p*(2*p*(1 + p)*Tan[e + f*x] + (1 + Sec[e + f*x])* (-(p*(1 + p)*(-5 + 4*p)*Tan[e + f*x]) - ((-1 + p)*(1 + p)*(-3 + 4*p)*Cot[e + f*x]*Hypergeometric2F1[1/2, p/2, (2 + p)/2, Sec[e + f*x]^2] + (5 - 4*p) *p^2*Csc[e + f*x]*Hypergeometric2F1[1/2, (1 + p)/2, (3 + p)/2, Sec[e + f*x ]^2])*(1 + Sec[e + f*x])*Sqrt[-Tan[e + f*x]^2])))/(a^2*f*p*(1 + p)*(1 + Se c[e + f*x])^2)
Time = 1.06 (sec) , antiderivative size = 229, normalized size of antiderivative = 1.01, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {3042, 4508, 3042, 4508, 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 {(c-c \sec (e+f x)) (g \sec (e+f x))^p}{(a \sec (e+f x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right ) \left (g \csc \left (e+f x+\frac {\pi }{2}\right )\right )^p}{\left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^2}dx\) |
\(\Big \downarrow \) 4508 |
\(\displaystyle \frac {\int \frac {(g \sec (e+f x))^p (a c (3-2 p)-2 a c (1-p) \sec (e+f x))}{\sec (e+f x) a+a}dx}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {\left (g \csc \left (e+f x+\frac {\pi }{2}\right )\right )^p \left (a c (3-2 p)-2 a c (1-p) \csc \left (e+f x+\frac {\pi }{2}\right )\right )}{\csc \left (e+f x+\frac {\pi }{2}\right ) a+a}dx}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 4508 |
\(\displaystyle \frac {\frac {\int (g \sec (e+f x))^p \left (c (3-4 p) (1-p) a^2+c (5-4 p) p \sec (e+f x) a^2\right )dx}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int \left (g \csc \left (e+f x+\frac {\pi }{2}\right )\right )^p \left (c (3-4 p) (1-p) a^2+c (5-4 p) p \csc \left (e+f x+\frac {\pi }{2}\right ) a^2\right )dx}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {\frac {a^2 c (3-4 p) (1-p) \int (g \sec (e+f x))^pdx+\frac {a^2 c (5-4 p) p \int (g \sec (e+f x))^{p+1}dx}{g}}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a^2 c (3-4 p) (1-p) \int \left (g \csc \left (e+f x+\frac {\pi }{2}\right )\right )^pdx+\frac {a^2 c (5-4 p) p \int \left (g \csc \left (e+f x+\frac {\pi }{2}\right )\right )^{p+1}dx}{g}}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 4259 |
\(\displaystyle \frac {\frac {\frac {a^2 c (5-4 p) p \left (\frac {\cos (e+f x)}{g}\right )^p (g \sec (e+f x))^p \int \left (\frac {\cos (e+f x)}{g}\right )^{-p-1}dx}{g}+a^2 c (3-4 p) (1-p) \left (\frac {\cos (e+f x)}{g}\right )^p (g \sec (e+f x))^p \int \left (\frac {\cos (e+f x)}{g}\right )^{-p}dx}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\frac {a^2 c (5-4 p) p \left (\frac {\cos (e+f x)}{g}\right )^p (g \sec (e+f x))^p \int \left (\frac {\sin \left (e+f x+\frac {\pi }{2}\right )}{g}\right )^{-p-1}dx}{g}+a^2 c (3-4 p) (1-p) \left (\frac {\cos (e+f x)}{g}\right )^p (g \sec (e+f x))^p \int \left (\frac {\sin \left (e+f x+\frac {\pi }{2}\right )}{g}\right )^{-p}dx}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle \frac {\frac {\frac {a^2 c (5-4 p) \sin (e+f x) (g \sec (e+f x))^p \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {p}{2},\frac {2-p}{2},\cos ^2(e+f x)\right )}{f \sqrt {\sin ^2(e+f x)}}-\frac {a^2 c g (3-4 p) \sin (e+f x) (g \sec (e+f x))^{p-1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-p}{2},\frac {3-p}{2},\cos ^2(e+f x)\right )}{f \sqrt {\sin ^2(e+f x)}}}{a^2}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{f (\sec (e+f x)+1)}}{3 a^2}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2}\) |
Input:
Int[((g*Sec[e + f*x])^p*(c - c*Sec[e + f*x]))/(a + a*Sec[e + f*x])^2,x]
Output:
(-2*c*(g*Sec[e + f*x])^p*Tan[e + f*x])/(3*f*(a + a*Sec[e + f*x])^2) + ((-( (a^2*c*g*(3 - 4*p)*Hypergeometric2F1[1/2, (1 - p)/2, (3 - p)/2, Cos[e + f* x]^2]*(g*Sec[e + f*x])^(-1 + p)*Sin[e + f*x])/(f*Sqrt[Sin[e + f*x]^2])) + (a^2*c*(5 - 4*p)*Hypergeometric2F1[1/2, -1/2*p, (2 - p)/2, Cos[e + f*x]^2] *(g*Sec[e + f*x])^p*Sin[e + f*x])/(f*Sqrt[Sin[e + f*x]^2]))/a^2 - (c*(5 - 4*p)*(g*Sec[e + f*x])^p*Tan[e + f*x])/(f*(1 + Sec[e + f*x])))/(3*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_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-(A*b - a*B))*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(b*f*(2*m + 1))), x] - Simp[1/(a^2*(2*m + 1)) Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Cs c[e + f*x])^n*Simp[b*B*n - a*A*(2*m + n + 1) + (A*b - a*B)*(m + n + 1)*Csc[ e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B , 0] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)] && !GtQ[n, 0]
\[\int \frac {\left (g \sec \left (f x +e \right )\right )^{p} \left (c -c \sec \left (f x +e \right )\right )}{\left (a +a \sec \left (f x +e \right )\right )^{2}}d x\]
Input:
int((g*sec(f*x+e))^p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x)
Output:
int((g*sec(f*x+e))^p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x)
\[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=\int { -\frac {{\left (c \sec \left (f x + e\right ) - c\right )} \left (g \sec \left (f x + e\right )\right )^{p}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}} \,d x } \] Input:
integrate((g*sec(f*x+e))^p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x, algorith m="fricas")
Output:
integral(-(c*sec(f*x + e) - c)*(g*sec(f*x + e))^p/(a^2*sec(f*x + e)^2 + 2* a^2*sec(f*x + e) + a^2), x)
\[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=- \frac {c \left (\int \left (- \frac {\left (g \sec {\left (e + f x \right )}\right )^{p}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\left (g \sec {\left (e + f x \right )}\right )^{p} \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{a^{2}} \] Input:
integrate((g*sec(f*x+e))**p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))**2,x)
Output:
-c*(Integral(-(g*sec(e + f*x))**p/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral((g*sec(e + f*x))**p*sec(e + f*x)/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x))/a**2
\[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=\int { -\frac {{\left (c \sec \left (f x + e\right ) - c\right )} \left (g \sec \left (f x + e\right )\right )^{p}}{{\left (a \sec \left (f x + e\right ) + a\right )}^{2}} \,d x } \] Input:
integrate((g*sec(f*x+e))^p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x, algorith m="maxima")
Output:
-integrate((c*sec(f*x + e) - c)*(g*sec(f*x + e))^p/(a*sec(f*x + e) + a)^2, x)
Exception generated. \[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=\text {Exception raised: TypeError} \] Input:
integrate((g*sec(f*x+e))^p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x, algorith m="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,4,0]%%%}+%%%{1,[0,1,0,0]%%%} / %%%{4,[0,0,0,2]%%%} Error: B
Timed out. \[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=\int \frac {\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )\,{\left (\frac {g}{\cos \left (e+f\,x\right )}\right )}^p}{{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^2} \,d x \] Input:
int(((c - c/cos(e + f*x))*(g/cos(e + f*x))^p)/(a + a/cos(e + f*x))^2,x)
Output:
int(((c - c/cos(e + f*x))*(g/cos(e + f*x))^p)/(a + a/cos(e + f*x))^2, x)
\[ \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx=\frac {g^{p} c \left (\int \frac {\sec \left (f x +e \right )^{p}}{\sec \left (f x +e \right )^{2}+2 \sec \left (f x +e \right )+1}d x -\left (\int \frac {\sec \left (f x +e \right )^{p} \sec \left (f x +e \right )}{\sec \left (f x +e \right )^{2}+2 \sec \left (f x +e \right )+1}d x \right )\right )}{a^{2}} \] Input:
int((g*sec(f*x+e))^p*(c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x)
Output:
(g**p*c*(int(sec(e + f*x)**p/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1),x) - i nt((sec(e + f*x)**p*sec(e + f*x))/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1),x )))/a**2