Integrand size = 24, antiderivative size = 21 \[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=-\frac {\sec ^{1+m}(e+f x) \sin (e+f x)}{f} \] Output:
-sec(f*x+e)^(1+m)*sin(f*x+e)/f
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.34 (sec) , antiderivative size = 107, normalized size of antiderivative = 5.10 \[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=\frac {\csc (e+f x) \sec ^{-1+m}(e+f x) \left ((2+m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m}{2},\frac {2+m}{2},\sec ^2(e+f x)\right )-(1+m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {4+m}{2},\sec ^2(e+f x)\right ) \sec ^2(e+f x)\right ) \sqrt {-\tan ^2(e+f x)}}{f (2+m)} \] Input:
Integrate[Sec[e + f*x]^m*(m - (1 + m)*Sec[e + f*x]^2),x]
Output:
(Csc[e + f*x]*Sec[e + f*x]^(-1 + m)*((2 + m)*Hypergeometric2F1[1/2, m/2, ( 2 + m)/2, Sec[e + f*x]^2] - (1 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Sec[e + f*x]^2]*Sec[e + f*x]^2)*Sqrt[-Tan[e + f*x]^2])/(f*(2 + m))
Time = 0.21 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3042, 4531}
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 \sec ^m(e+f x) \left (m-(m+1) \sec ^2(e+f x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \csc \left (e+f x+\frac {\pi }{2}\right )^m \left ((-m-1) \csc \left (e+f x+\frac {\pi }{2}\right )^2+m\right )dx\) |
\(\Big \downarrow \) 4531 |
\(\displaystyle -\frac {\sin (e+f x) \sec ^{m+1}(e+f x)}{f}\) |
Input:
Int[Sec[e + f*x]^m*(m - (1 + m)*Sec[e + f*x]^2),x]
Output:
-((Sec[e + f*x]^(1 + m)*Sin[e + f*x])/f)
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*m)), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[C*m + A*(m + 1), 0]
Time = 0.72 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.33
method | result | size |
parallelrisch | \(-\frac {\sin \left (f x +e \right ) \sec \left (f x +e \right )^{m}}{\cos \left (f x +e \right ) f}\) | \(28\) |
risch | \(\frac {i 2^{m} \left ({\mathrm e}^{i \left (f x +e \right )}\right )^{m} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{-m} \left ({\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} m}{2}} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \pi \,\operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) \operatorname {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right ) m}{2}} {\mathrm e}^{-\frac {i \pi \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{3} m}{2}} {\mathrm e}^{\frac {i \pi \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right ) m}{2}} {\mathrm e}^{2 i f x} {\mathrm e}^{2 i e}-{\mathrm e}^{-\frac {i \pi \,\operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right ) m \left (-\operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )+\operatorname {csgn}\left (i {\mathrm e}^{i \left (f x +e \right )}\right )\right ) \left (-\operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (f x +e \right )}}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )+\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (f x +e \right )}+1}\right )\right )}{2}}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) | \(378\) |
Input:
int(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x,method=_RETURNVERBOSE)
Output:
-sin(f*x+e)/cos(f*x+e)/f*sec(f*x+e)^m
Time = 0.09 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.38 \[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=-\frac {\frac {1}{\cos \left (f x + e\right )}^{m} \sin \left (f x + e\right )}{f \cos \left (f x + e\right )} \] Input:
integrate(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x, algorithm="fricas")
Output:
-(1/cos(f*x + e))^m*sin(f*x + e)/(f*cos(f*x + e))
\[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=- \int \left (- m \sec ^{m}{\left (e + f x \right )}\right )\, dx - \int \sec ^{2}{\left (e + f x \right )} \sec ^{m}{\left (e + f x \right )}\, dx - \int m \sec ^{2}{\left (e + f x \right )} \sec ^{m}{\left (e + f x \right )}\, dx \] Input:
integrate(sec(f*x+e)**m*(m-(1+m)*sec(f*x+e)**2),x)
Output:
-Integral(-m*sec(e + f*x)**m, x) - Integral(sec(e + f*x)**2*sec(e + f*x)** m, x) - Integral(m*sec(e + f*x)**2*sec(e + f*x)**m, x)
Leaf count of result is larger than twice the leaf count of optimal. 283 vs. \(2 (21) = 42\).
Time = 0.24 (sec) , antiderivative size = 283, normalized size of antiderivative = 13.48 \[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=\frac {2^{m} \cos \left (-{\left (f x + e\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) \sin \left (2 \, f x + 2 \, e\right ) - 2^{m} \cos \left (-{\left (f x + e\right )} m + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) \sin \left (2 \, f x + 2 \, e\right ) + {\left (2^{m} \cos \left (2 \, f x + 2 \, e\right ) + 2^{m}\right )} \sin \left (-{\left (f x + e\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - {\left (2^{m} \cos \left (2 \, f x + 2 \, e\right ) + 2^{m}\right )} \sin \left (-{\left (f x + e\right )} m + m \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )}{{\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, m} f} \] Input:
integrate(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x, algorithm="maxima")
Output:
(2^m*cos(-(f*x + e)*(m + 2) + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sin(2*f*x + 2*e) - 2^m*cos(-(f*x + e)*m + m*arctan2(sin(2*f*x + 2*e ), cos(2*f*x + 2*e) + 1))*sin(2*f*x + 2*e) + (2^m*cos(2*f*x + 2*e) + 2^m)* sin(-(f*x + e)*(m + 2) + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) ) - (2^m*cos(2*f*x + 2*e) + 2^m)*sin(-(f*x + e)*m + m*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)))/((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)*(cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2 *f*x + 2*e) + 1)^(1/2*m)*f)
\[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=\int { -{\left ({\left (m + 1\right )} \sec \left (f x + e\right )^{2} - m\right )} \sec \left (f x + e\right )^{m} \,d x } \] Input:
integrate(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x, algorithm="giac")
Output:
integrate(-((m + 1)*sec(f*x + e)^2 - m)*sec(f*x + e)^m, x)
Time = 11.84 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.76 \[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=-\frac {\sin \left (2\,e+2\,f\,x\right )\,{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^m}{f\,\left (\cos \left (2\,e+2\,f\,x\right )+1\right )} \] Input:
int((m - (m + 1)/cos(e + f*x)^2)*(1/cos(e + f*x))^m,x)
Output:
-(sin(2*e + 2*f*x)*(1/cos(e + f*x))^m)/(f*(cos(2*e + 2*f*x) + 1))
\[ \int \sec ^m(e+f x) \left (m-(1+m) \sec ^2(e+f x)\right ) \, dx=\left (\int \sec \left (f x +e \right )^{m}d x \right ) m -\left (\int \sec \left (f x +e \right )^{m} \sec \left (f x +e \right )^{2}d x \right ) m -\left (\int \sec \left (f x +e \right )^{m} \sec \left (f x +e \right )^{2}d x \right ) \] Input:
int(sec(f*x+e)^m*(m-(1+m)*sec(f*x+e)^2),x)
Output:
int(sec(e + f*x)**m,x)*m - int(sec(e + f*x)**m*sec(e + f*x)**2,x)*m - int( sec(e + f*x)**m*sec(e + f*x)**2,x)