Integrand size = 14, antiderivative size = 78 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=(a-b)^3 x-\frac {b \left (3 a^2-3 a b+b^2\right ) \cot (c+d x)}{d}-\frac {(3 a-b) b^2 \cot ^3(c+d x)}{3 d}-\frac {b^3 \cot ^5(c+d x)}{5 d} \] Output:
(a-b)^3*x-b*(3*a^2-3*a*b+b^2)*cot(d*x+c)/d-1/3*(3*a-b)*b^2*cot(d*x+c)^3/d- 1/5*b^3*cot(d*x+c)^5/d
Time = 1.36 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.42 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=-\frac {\cot ^5(c+d x) \left (\frac {15 (a-b)^3 \text {arctanh}\left (\sqrt {-\tan ^2(c+d x)}\right ) \tan ^8(c+d x)}{\left (-\tan ^2(c+d x)\right )^{3/2}}+b \left (3 b^2+5 (3 a-b) b \tan ^2(c+d x)+15 \left (3 a^2-3 a b+b^2\right ) \tan ^4(c+d x)\right )\right )}{15 d} \] Input:
Integrate[(a + b*Cot[c + d*x]^2)^3,x]
Output:
-1/15*(Cot[c + d*x]^5*((15*(a - b)^3*ArcTanh[Sqrt[-Tan[c + d*x]^2]]*Tan[c + d*x]^8)/(-Tan[c + d*x]^2)^(3/2) + b*(3*b^2 + 5*(3*a - b)*b*Tan[c + d*x]^ 2 + 15*(3*a^2 - 3*a*b + b^2)*Tan[c + d*x]^4)))/d
Time = 0.26 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.01, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4144, 300, 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 \left (a+b \cot ^2(c+d x)\right )^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \tan \left (c+d x+\frac {\pi }{2}\right )^2\right )^3dx\) |
\(\Big \downarrow \) 4144 |
\(\displaystyle -\frac {\int \frac {\left (b \cot ^2(c+d x)+a\right )^3}{\cot ^2(c+d x)+1}d\cot (c+d x)}{d}\) |
\(\Big \downarrow \) 300 |
\(\displaystyle -\frac {\int \left (b^3 \cot ^4(c+d x)+(3 a-b) b^2 \cot ^2(c+d x)+b \left (3 a^2-3 b a+b^2\right )+\frac {(a-b)^3}{\cot ^2(c+d x)+1}\right )d\cot (c+d x)}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {b \left (3 a^2-3 a b+b^2\right ) \cot (c+d x)+(a-b)^3 \arctan (\cot (c+d x))+\frac {1}{3} b^2 (3 a-b) \cot ^3(c+d x)+\frac {1}{5} b^3 \cot ^5(c+d x)}{d}\) |
Input:
Int[(a + b*Cot[c + d*x]^2)^3,x]
Output:
-(((a - b)^3*ArcTan[Cot[c + d*x]] + b*(3*a^2 - 3*a*b + b^2)*Cot[c + d*x] + ((3*a - b)*b^2*Cot[c + d*x]^3)/3 + (b^3*Cot[c + d*x]^5)/5)/d)
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(a + b* (ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Time = 0.26 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.99
method | result | size |
parallelrisch | \(\frac {-3 \cot \left (d x +c \right )^{5} b^{3}+5 \left (-3 a \,b^{2}+b^{3}\right ) \cot \left (d x +c \right )^{3}+15 \left (-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) \cot \left (d x +c \right )+15 d x \left (a -b \right )^{3}}{15 d}\) | \(77\) |
norman | \(\frac {\left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right ) x \tan \left (d x +c \right )^{5}-\frac {b^{3}}{5 d}-\frac {b \left (3 a^{2}-3 a b +b^{2}\right ) \tan \left (d x +c \right )^{4}}{d}-\frac {b^{2} \left (3 a -b \right ) \tan \left (d x +c \right )^{2}}{3 d}}{\tan \left (d x +c \right )^{5}}\) | \(100\) |
derivativedivides | \(\frac {-\frac {\cot \left (d x +c \right )^{5} b^{3}}{5}-a \,b^{2} \cot \left (d x +c \right )^{3}+\frac {\cot \left (d x +c \right )^{3} b^{3}}{3}-3 \cot \left (d x +c \right ) a^{2} b +3 a \,b^{2} \cot \left (d x +c \right )-b^{3} \cot \left (d x +c \right )+\left (-a^{3}+3 a^{2} b -3 a \,b^{2}+b^{3}\right ) \left (\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(116\) |
default | \(\frac {-\frac {\cot \left (d x +c \right )^{5} b^{3}}{5}-a \,b^{2} \cot \left (d x +c \right )^{3}+\frac {\cot \left (d x +c \right )^{3} b^{3}}{3}-3 \cot \left (d x +c \right ) a^{2} b +3 a \,b^{2} \cot \left (d x +c \right )-b^{3} \cot \left (d x +c \right )+\left (-a^{3}+3 a^{2} b -3 a \,b^{2}+b^{3}\right ) \left (\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(116\) |
parts | \(a^{3} x +\frac {b^{3} \left (-\frac {\cot \left (d x +c \right )^{5}}{5}+\frac {\cot \left (d x +c \right )^{3}}{3}-\cot \left (d x +c \right )+\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}+\frac {3 a^{2} b \left (-\cot \left (d x +c \right )+\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}+\frac {3 a \,b^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )-\frac {\pi }{2}+\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(121\) |
risch | \(a^{3} x -3 a^{2} b x +3 a \,b^{2} x -b^{3} x -\frac {2 i b \left (45 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-90 a b \,{\mathrm e}^{8 i \left (d x +c \right )}+45 \,{\mathrm e}^{8 i \left (d x +c \right )} b^{2}-180 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+270 a b \,{\mathrm e}^{6 i \left (d x +c \right )}-90 \,{\mathrm e}^{6 i \left (d x +c \right )} b^{2}+270 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-330 a b \,{\mathrm e}^{4 i \left (d x +c \right )}+140 \,{\mathrm e}^{4 i \left (d x +c \right )} b^{2}-180 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+210 a b \,{\mathrm e}^{2 i \left (d x +c \right )}-70 \,{\mathrm e}^{2 i \left (d x +c \right )} b^{2}+45 a^{2}-60 a b +23 b^{2}\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}\) | \(226\) |
Input:
int((a+b*cot(d*x+c)^2)^3,x,method=_RETURNVERBOSE)
Output:
1/15*(-3*cot(d*x+c)^5*b^3+5*(-3*a*b^2+b^3)*cot(d*x+c)^3+15*(-3*a^2*b+3*a*b ^2-b^3)*cot(d*x+c)+15*d*x*(a-b)^3)/d
Leaf count of result is larger than twice the leaf count of optimal. 253 vs. \(2 (74) = 148\).
Time = 0.08 (sec) , antiderivative size = 253, normalized size of antiderivative = 3.24 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=-\frac {{\left (45 \, a^{2} b - 60 \, a b^{2} + 23 \, b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )^{3} + 45 \, a^{2} b - 30 \, a b^{2} + 13 \, b^{3} - {\left (45 \, a^{2} b - 30 \, a b^{2} + b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )^{2} - {\left (45 \, a^{2} b - 60 \, a b^{2} + 11 \, b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right ) - 15 \, {\left ({\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cos \left (2 \, d x + 2 \, c\right )^{2} - 2 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x \cos \left (2 \, d x + 2 \, c\right ) + {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} d x\right )} \sin \left (2 \, d x + 2 \, c\right )}{15 \, {\left (d \cos \left (2 \, d x + 2 \, c\right )^{2} - 2 \, d \cos \left (2 \, d x + 2 \, c\right ) + d\right )} \sin \left (2 \, d x + 2 \, c\right )} \] Input:
integrate((a+b*cot(d*x+c)^2)^3,x, algorithm="fricas")
Output:
-1/15*((45*a^2*b - 60*a*b^2 + 23*b^3)*cos(2*d*x + 2*c)^3 + 45*a^2*b - 30*a *b^2 + 13*b^3 - (45*a^2*b - 30*a*b^2 + b^3)*cos(2*d*x + 2*c)^2 - (45*a^2*b - 60*a*b^2 + 11*b^3)*cos(2*d*x + 2*c) - 15*((a^3 - 3*a^2*b + 3*a*b^2 - b^ 3)*d*x*cos(2*d*x + 2*c)^2 - 2*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x*cos(2*d* x + 2*c) + (a^3 - 3*a^2*b + 3*a*b^2 - b^3)*d*x)*sin(2*d*x + 2*c))/((d*cos( 2*d*x + 2*c)^2 - 2*d*cos(2*d*x + 2*c) + d)*sin(2*d*x + 2*c))
Time = 0.13 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.62 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=\begin {cases} a^{3} x - 3 a^{2} b x - \frac {3 a^{2} b \cot {\left (c + d x \right )}}{d} + 3 a b^{2} x - \frac {a b^{2} \cot ^{3}{\left (c + d x \right )}}{d} + \frac {3 a b^{2} \cot {\left (c + d x \right )}}{d} - b^{3} x - \frac {b^{3} \cot ^{5}{\left (c + d x \right )}}{5 d} + \frac {b^{3} \cot ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{3} \cot {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \cot ^{2}{\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \] Input:
integrate((a+b*cot(d*x+c)**2)**3,x)
Output:
Piecewise((a**3*x - 3*a**2*b*x - 3*a**2*b*cot(c + d*x)/d + 3*a*b**2*x - a* b**2*cot(c + d*x)**3/d + 3*a*b**2*cot(c + d*x)/d - b**3*x - b**3*cot(c + d *x)**5/(5*d) + b**3*cot(c + d*x)**3/(3*d) - b**3*cot(c + d*x)/d, Ne(d, 0)) , (x*(a + b*cot(c)**2)**3, True))
Time = 0.11 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.44 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=a^{3} x - \frac {3 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} b}{d} + \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 b^{2}}{d} - \frac {{\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} - 5 \, \tan \left (d x + c\right )^{2} + 3}{\tan \left (d x + c\right )^{5}}\right )} b^{3}}{15 \, d} \] Input:
integrate((a+b*cot(d*x+c)^2)^3,x, algorithm="maxima")
Output:
a^3*x - 3*(d*x + c + 1/tan(d*x + c))*a^2*b/d + (3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/tan(d*x + c)^3)*a*b^2/d - 1/15*(15*d*x + 15*c + (15*tan(d*x + c )^4 - 5*tan(d*x + c)^2 + 3)/tan(d*x + c)^5)*b^3/d
Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (74) = 148\).
Time = 0.20 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.94 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=\frac {3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 60 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 35 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 900 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 330 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 480 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} {\left (d x + c\right )} - \frac {720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 900 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 330 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 60 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 35 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, b^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \] Input:
integrate((a+b*cot(d*x+c)^2)^3,x, algorithm="giac")
Output:
1/480*(3*b^3*tan(1/2*d*x + 1/2*c)^5 + 60*a*b^2*tan(1/2*d*x + 1/2*c)^3 - 35 *b^3*tan(1/2*d*x + 1/2*c)^3 + 720*a^2*b*tan(1/2*d*x + 1/2*c) - 900*a*b^2*t an(1/2*d*x + 1/2*c) + 330*b^3*tan(1/2*d*x + 1/2*c) + 480*(a^3 - 3*a^2*b + 3*a*b^2 - b^3)*(d*x + c) - (720*a^2*b*tan(1/2*d*x + 1/2*c)^4 - 900*a*b^2*t an(1/2*d*x + 1/2*c)^4 + 330*b^3*tan(1/2*d*x + 1/2*c)^4 + 60*a*b^2*tan(1/2* d*x + 1/2*c)^2 - 35*b^3*tan(1/2*d*x + 1/2*c)^2 + 3*b^3)/tan(1/2*d*x + 1/2* c)^5)/d
Time = 8.82 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.97 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=x\,{\left (a-b\right )}^3-\frac {b^3\,{\mathrm {cot}\left (c+d\,x\right )}^5}{5\,d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^3\,\left (3\,a\,b^2-b^3\right )}{3\,d}-\frac {b\,\mathrm {cot}\left (c+d\,x\right )\,\left (3\,a^2-3\,a\,b+b^2\right )}{d} \] Input:
int((a + b*cot(c + d*x)^2)^3,x)
Output:
x*(a - b)^3 - (b^3*cot(c + d*x)^5)/(5*d) - (cot(c + d*x)^3*(3*a*b^2 - b^3) )/(3*d) - (b*cot(c + d*x)*(3*a^2 - 3*a*b + b^2))/d
Time = 0.19 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.42 \[ \int \left (a+b \cot ^2(c+d x)\right )^3 \, dx=\frac {-3 \cot \left (d x +c \right )^{5} b^{3}-15 \cot \left (d x +c \right )^{3} a \,b^{2}+5 \cot \left (d x +c \right )^{3} b^{3}-45 \cot \left (d x +c \right ) a^{2} b +45 \cot \left (d x +c \right ) a \,b^{2}-15 \cot \left (d x +c \right ) b^{3}+15 a^{3} d x -45 a^{2} b d x +45 a \,b^{2} d x -15 b^{3} d x}{15 d} \] Input:
int((a+b*cot(d*x+c)^2)^3,x)
Output:
( - 3*cot(c + d*x)**5*b**3 - 15*cot(c + d*x)**3*a*b**2 + 5*cot(c + d*x)**3 *b**3 - 45*cot(c + d*x)*a**2*b + 45*cot(c + d*x)*a*b**2 - 15*cot(c + d*x)* b**3 + 15*a**3*d*x - 45*a**2*b*d*x + 45*a*b**2*d*x - 15*b**3*d*x)/(15*d)