Integrand size = 29, antiderivative size = 26 \[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\frac {C \sec ^{1+m}(c+d x) \sin (c+d x)}{d (1+m)} \] Output:
C*sec(d*x+c)^(1+m)*sin(d*x+c)/d/(1+m)
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.34 (sec) , antiderivative size = 113, normalized size of antiderivative = 4.35 \[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\frac {C \csc (c+d x) \sec ^{-1+m}(c+d x) \left (-\left ((2+m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m}{2},\frac {2+m}{2},\sec ^2(c+d x)\right )\right )+(1+m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+m}{2},\frac {4+m}{2},\sec ^2(c+d x)\right ) \sec ^2(c+d x)\right ) \sqrt {-\tan ^2(c+d x)}}{d (1+m) (2+m)} \] Input:
Integrate[Sec[c + d*x]^m*(-((C*m)/(1 + m)) + C*Sec[c + d*x]^2),x]
Output:
(C*Csc[c + d*x]*Sec[c + d*x]^(-1 + m)*(-((2 + m)*Hypergeometric2F1[1/2, m/ 2, (2 + m)/2, Sec[c + d*x]^2]) + (1 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Sec[c + d*x]^2]*Sec[c + d*x]^2)*Sqrt[-Tan[c + d*x]^2])/(d*(1 + m)*(2 + m))
Time = 0.22 (sec) , antiderivative size = 26, 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.069, 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(c+d x) \left (C \sec ^2(c+d x)-\frac {C m}{m+1}\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (C \csc \left (c+d x+\frac {\pi }{2}\right )^2-\frac {C m}{m+1}\right )dx\) |
\(\Big \downarrow \) 4531 |
\(\displaystyle \frac {C \sin (c+d x) \sec ^{m+1}(c+d x)}{d (m+1)}\) |
Input:
Int[Sec[c + d*x]^m*(-((C*m)/(1 + m)) + C*Sec[c + d*x]^2),x]
Output:
(C*Sec[c + d*x]^(1 + m)*Sin[c + d*x])/(d*(1 + m))
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.89 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.27
method | result | size |
parallelrisch | \(\frac {\sin \left (d x +c \right ) C \sec \left (d x +c \right )^{m}}{\cos \left (d x +c \right ) \left (1+m \right ) d}\) | \(33\) |
risch | \(-\frac {i C 2^{m} \left ({\mathrm e}^{i \left (d x +c \right )}\right )^{m} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{-m} \left ({\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{3} \pi m}{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \operatorname {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) \pi m}{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) m}{2}} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \operatorname {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) \pi \,\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) m}{2}} {\mathrm e}^{2 i d x} {\mathrm e}^{2 i c}-{\mathrm e}^{-\frac {i \operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \pi m \left (-\operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )+\operatorname {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )\right ) \left (-\operatorname {csgn}\left (\frac {i {\mathrm e}^{i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )+\operatorname {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right )\right )}{2}}\right )}{\left (1+m \right ) d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) | \(384\) |
Input:
int(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)
Output:
sin(d*x+c)/cos(d*x+c)/(1+m)/d*C*sec(d*x+c)^m
Time = 0.08 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.27 \[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\frac {C \frac {1}{\cos \left (d x + c\right )}^{m} \sin \left (d x + c\right )}{{\left (d m + d\right )} \cos \left (d x + c\right )} \] Input:
integrate(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x, algorithm="fricas")
Output:
C*(1/cos(d*x + c))^m*sin(d*x + c)/((d*m + d)*cos(d*x + c))
\[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\frac {C \left (\int \left (- m \sec ^{m}{\left (c + d x \right )}\right )\, dx + \int \sec ^{2}{\left (c + d x \right )} \sec ^{m}{\left (c + d x \right )}\, dx + \int m \sec ^{2}{\left (c + d x \right )} \sec ^{m}{\left (c + d x \right )}\, dx\right )}{m + 1} \] Input:
integrate(sec(d*x+c)**m*(-C*m/(1+m)+C*sec(d*x+c)**2),x)
Output:
C*(Integral(-m*sec(c + d*x)**m, x) + Integral(sec(c + d*x)**2*sec(c + d*x) **m, x) + Integral(m*sec(c + d*x)**2*sec(c + d*x)**m, x))/(m + 1)
Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (26) = 52\).
Time = 0.25 (sec) , antiderivative size = 304, normalized size of antiderivative = 11.69 \[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=-\frac {2^{m} C \cos \left (-{\left (d x + c\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) \sin \left (2 \, d x + 2 \, c\right ) - 2^{m} C \cos \left (-{\left (d x + c\right )} m + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) \sin \left (2 \, d x + 2 \, c\right ) + {\left (2^{m} C \cos \left (2 \, d x + 2 \, c\right ) + 2^{m} C\right )} \sin \left (-{\left (d x + c\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) - {\left (2^{m} C \cos \left (2 \, d x + 2 \, c\right ) + 2^{m} C\right )} \sin \left (-{\left (d x + c\right )} m + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right )}{{\left ({\left (m + 1\right )} \cos \left (2 \, d x + 2 \, c\right )^{2} + {\left (m + 1\right )} \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, {\left (m + 1\right )} \cos \left (2 \, d x + 2 \, c\right ) + m + 1\right )} {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, m} d} \] Input:
integrate(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x, algorithm="maxima")
Output:
-(2^m*C*cos(-(d*x + c)*(m + 2) + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2 *c) + 1))*sin(2*d*x + 2*c) - 2^m*C*cos(-(d*x + c)*m + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(2*d*x + 2*c) + (2^m*C*cos(2*d*x + 2*c) + 2^m*C)*sin(-(d*x + c)*(m + 2) + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - (2^m*C*cos(2*d*x + 2*c) + 2^m*C)*sin(-(d*x + c)*m + m*arctan2 (sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/(((m + 1)*cos(2*d*x + 2*c)^2 + (m + 1)*sin(2*d*x + 2*c)^2 + 2*(m + 1)*cos(2*d*x + 2*c) + m + 1)*(cos(2*d* x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/2*m)*d)
\[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} - \frac {C m}{m + 1}\right )} \sec \left (d x + c\right )^{m} \,d x } \] Input:
integrate(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x, algorithm="giac")
Output:
integrate((C*sec(d*x + c)^2 - C*m/(m + 1))*sec(d*x + c)^m, x)
Time = 12.08 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.62 \[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\frac {C\,\sin \left (2\,c+2\,d\,x\right )\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^m}{d\,\left (\cos \left (2\,c+2\,d\,x\right )+1\right )\,\left (m+1\right )} \] Input:
int((1/cos(c + d*x))^m*(C/cos(c + d*x)^2 - (C*m)/(m + 1)),x)
Output:
(C*sin(2*c + 2*d*x)*(1/cos(c + d*x))^m)/(d*(cos(2*c + 2*d*x) + 1)*(m + 1))
\[ \int \sec ^m(c+d x) \left (-\frac {C m}{1+m}+C \sec ^2(c+d x)\right ) \, dx=\frac {c \left (-\left (\int \sec \left (d x +c \right )^{m}d x \right ) m +\left (\int \sec \left (d x +c \right )^{m} \sec \left (d x +c \right )^{2}d x \right ) m +\int \sec \left (d x +c \right )^{m} \sec \left (d x +c \right )^{2}d x \right )}{m +1} \] Input:
int(sec(d*x+c)^m*(-C*m/(1+m)+C*sec(d*x+c)^2),x)
Output:
(c*( - int(sec(c + d*x)**m,x)*m + int(sec(c + d*x)**m*sec(c + d*x)**2,x)*m + int(sec(c + d*x)**m*sec(c + d*x)**2,x)))/(m + 1)