Integrand size = 21, antiderivative size = 85 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=a^2 x+\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot ^3(c+d x)}{3 d}+\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d} \] Output:
a^2*x+a^2*cot(d*x+c)/d-1/3*a^2*cot(d*x+c)^3/d-1/3*b^2*cot(d*x+c)^3/d+2*a*b *csc(d*x+c)/d-2/3*a*b*csc(d*x+c)^3/d
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.25 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.82 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {b \left (b \cot ^3(c+d x)+2 a \csc (c+d x) \left (-3+\csc ^2(c+d x)\right )\right )+a^2 \cot ^3(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-\tan ^2(c+d x)\right )}{3 d} \] Input:
Integrate[Cot[c + d*x]^4*(a + b*Sec[c + d*x])^2,x]
Output:
-1/3*(b*(b*Cot[c + d*x]^3 + 2*a*Csc[c + d*x]*(-3 + Csc[c + d*x]^2)) + a^2* Cot[c + d*x]^3*Hypergeometric2F1[-3/2, 1, -1/2, -Tan[c + d*x]^2])/d
Time = 0.33 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 4374, 2009}
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 \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2}{\cot \left (c+d x+\frac {\pi }{2}\right )^4}dx\) |
\(\Big \downarrow \) 4374 |
\(\displaystyle \int \left (a^2 \cot ^4(c+d x)+2 a b \cot ^3(c+d x) \csc (c+d x)+b^2 \cot ^2(c+d x) \csc ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}+a^2 x-\frac {2 a b \csc ^3(c+d x)}{3 d}+\frac {2 a b \csc (c+d x)}{d}-\frac {b^2 \cot ^3(c+d x)}{3 d}\) |
Input:
Int[Cot[c + d*x]^4*(a + b*Sec[c + d*x])^2,x]
Output:
a^2*x + (a^2*Cot[c + d*x])/d - (a^2*Cot[c + d*x]^3)/(3*d) - (b^2*Cot[c + d *x]^3)/(3*d) + (2*a*b*Csc[c + d*x])/d - (2*a*b*Csc[c + d*x]^3)/(3*d)
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( a_))^(n_), x_Symbol] :> Int[ExpandIntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[ c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]
Time = 0.66 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.31
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{4}}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos \left (d x +c \right )^{4}}{3 \sin \left (d x +c \right )}+\frac {\left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}\right )-\frac {b^{2} \cos \left (d x +c \right )^{3}}{3 \sin \left (d x +c \right )^{3}}}{d}\) | \(111\) |
default | \(\frac {a^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{4}}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos \left (d x +c \right )^{4}}{3 \sin \left (d x +c \right )}+\frac {\left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}\right )-\frac {b^{2} \cos \left (d x +c \right )^{3}}{3 \sin \left (d x +c \right )^{3}}}{d}\) | \(111\) |
risch | \(a^{2} x +\frac {2 i \left (6 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-4 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 a b \,{\mathrm e}^{i \left (d x +c \right )}+4 a^{2}+b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}\) | \(116\) |
Input:
int(cot(d*x+c)^4*(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(a^2*(-1/3*cot(d*x+c)^3+cot(d*x+c)+d*x+c)+2*a*b*(-1/3/sin(d*x+c)^3*cos (d*x+c)^4+1/3/sin(d*x+c)*cos(d*x+c)^4+1/3*(2+cos(d*x+c)^2)*sin(d*x+c))-1/3 *b^2/sin(d*x+c)^3*cos(d*x+c)^3)
Time = 0.11 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.20 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {6 \, a b \cos \left (d x + c\right )^{2} + {\left (4 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{3} - 3 \, a^{2} \cos \left (d x + c\right ) - 4 \, a b + 3 \, {\left (a^{2} d x \cos \left (d x + c\right )^{2} - a^{2} d x\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \] Input:
integrate(cot(d*x+c)^4*(a+b*sec(d*x+c))^2,x, algorithm="fricas")
Output:
1/3*(6*a*b*cos(d*x + c)^2 + (4*a^2 + b^2)*cos(d*x + c)^3 - 3*a^2*cos(d*x + c) - 4*a*b + 3*(a^2*d*x*cos(d*x + c)^2 - a^2*d*x)*sin(d*x + c))/((d*cos(d *x + c)^2 - d)*sin(d*x + c))
\[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cot ^{4}{\left (c + d x \right )}\, dx \] Input:
integrate(cot(d*x+c)**4*(a+b*sec(d*x+c))**2,x)
Output:
Integral((a + b*sec(c + d*x))**2*cot(c + d*x)**4, x)
Time = 0.11 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.89 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {{\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} + \frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 1\right )} a b}{\sin \left (d x + c\right )^{3}} - \frac {b^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \] Input:
integrate(cot(d*x+c)^4*(a+b*sec(d*x+c))^2,x, algorithm="maxima")
Output:
1/3*((3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/tan(d*x + c)^3)*a^2 + 2*(3*sin( d*x + c)^2 - 1)*a*b/sin(d*x + c)^3 - b^2/tan(d*x + c)^3)/d
Leaf count of result is larger than twice the leaf count of optimal. 176 vs. \(2 (79) = 158\).
Time = 0.16 (sec) , antiderivative size = 176, normalized size of antiderivative = 2.07 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, {\left (d x + c\right )} a^{2} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 18 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{2} - 2 \, a b - b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \] Input:
integrate(cot(d*x+c)^4*(a+b*sec(d*x+c))^2,x, algorithm="giac")
Output:
1/24*(a^2*tan(1/2*d*x + 1/2*c)^3 - 2*a*b*tan(1/2*d*x + 1/2*c)^3 + b^2*tan( 1/2*d*x + 1/2*c)^3 + 24*(d*x + c)*a^2 - 15*a^2*tan(1/2*d*x + 1/2*c) + 18*a *b*tan(1/2*d*x + 1/2*c) - 3*b^2*tan(1/2*d*x + 1/2*c) + (15*a^2*tan(1/2*d*x + 1/2*c)^2 + 18*a*b*tan(1/2*d*x + 1/2*c)^2 + 3*b^2*tan(1/2*d*x + 1/2*c)^2 - a^2 - 2*a*b - b^2)/tan(1/2*d*x + 1/2*c)^3)/d
Time = 11.75 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.39 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=a^2\,x+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\left (a-b\right )}^2}{24\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a\,\left (a-b\right )}{2}+\frac {{\left (a-b\right )}^2}{8}\right )}{d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {2\,a\,b}{3}+\frac {a^2}{3}+\frac {b^2}{3}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (5\,a^2+6\,a\,b+b^2\right )\right )}{8\,d} \] Input:
int(cot(c + d*x)^4*(a + b/cos(c + d*x))^2,x)
Output:
a^2*x + (tan(c/2 + (d*x)/2)^3*(a - b)^2)/(24*d) - (tan(c/2 + (d*x)/2)*((a* (a - b))/2 + (a - b)^2/8))/d - (cot(c/2 + (d*x)/2)^3*((2*a*b)/3 + a^2/3 + b^2/3 - tan(c/2 + (d*x)/2)^2*(6*a*b + 5*a^2 + b^2)))/(8*d)
Time = 0.16 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.22 \[ \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {4 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{2}+\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{2}-\cos \left (d x +c \right ) a^{2}-\cos \left (d x +c \right ) b^{2}+3 \sin \left (d x +c \right )^{3} a^{2} d x +6 \sin \left (d x +c \right )^{2} a b -2 a b}{3 \sin \left (d x +c \right )^{3} d} \] Input:
int(cot(d*x+c)^4*(a+b*sec(d*x+c))^2,x)
Output:
(4*cos(c + d*x)*sin(c + d*x)**2*a**2 + cos(c + d*x)*sin(c + d*x)**2*b**2 - cos(c + d*x)*a**2 - cos(c + d*x)*b**2 + 3*sin(c + d*x)**3*a**2*d*x + 6*si n(c + d*x)**2*a*b - 2*a*b)/(3*sin(c + d*x)**3*d)