Integrand size = 19, antiderivative size = 62 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=b \left (3 a^2-b^2\right ) x-\frac {3 a b^2 \log (\cos (c+d x))}{d}+\frac {a^3 \log (\sin (c+d x))}{d}+\frac {b^2 (a+b \tan (c+d x))}{d} \] Output:
b*(3*a^2-b^2)*x-3*a*b^2*ln(cos(d*x+c))/d+a^3*ln(sin(d*x+c))/d+b^2*(a+b*tan (d*x+c))/d
Result contains complex when optimal does not.
Time = 0.13 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.27 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=-\frac {(a+i b)^3 \log (i-\tan (c+d x))-2 a^3 \log (\tan (c+d x))+(a-i b)^3 \log (i+\tan (c+d x))-2 b^2 (a+b \tan (c+d x))}{2 d} \] Input:
Integrate[Cot[c + d*x]*(a + b*Tan[c + d*x])^3,x]
Output:
-1/2*((a + I*b)^3*Log[I - Tan[c + d*x]] - 2*a^3*Log[Tan[c + d*x]] + (a - I *b)^3*Log[I + Tan[c + d*x]] - 2*b^2*(a + b*Tan[c + d*x]))/d
Time = 0.39 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.03, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3042, 4049, 3042, 4107, 3042, 25, 3956}
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 (c+d x) (a+b \tan (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x))^3}{\tan (c+d x)}dx\) |
\(\Big \downarrow \) 4049 |
\(\displaystyle \int \cot (c+d x) \left (a^3+3 b^2 \tan ^2(c+d x) a+b \left (3 a^2-b^2\right ) \tan (c+d x)\right )dx+\frac {b^2 (a+b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a^3+3 b^2 \tan (c+d x)^2 a+b \left (3 a^2-b^2\right ) \tan (c+d x)}{\tan (c+d x)}dx+\frac {b^2 (a+b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 4107 |
\(\displaystyle a^3 \int \cot (c+d x)dx+3 a b^2 \int \tan (c+d x)dx+b x \left (3 a^2-b^2\right )+\frac {b^2 (a+b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a^3 \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx+3 a b^2 \int \tan (c+d x)dx+b x \left (3 a^2-b^2\right )+\frac {b^2 (a+b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle a^3 \left (-\int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx\right )+3 a b^2 \int \tan (c+d x)dx+b x \left (3 a^2-b^2\right )+\frac {b^2 (a+b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {a^3 \log (-\sin (c+d x))}{d}+b x \left (3 a^2-b^2\right )+\frac {b^2 (a+b \tan (c+d x))}{d}-\frac {3 a b^2 \log (\cos (c+d x))}{d}\) |
Input:
Int[Cot[c + d*x]*(a + b*Tan[c + d*x])^3,x]
Output:
b*(3*a^2 - b^2)*x - (3*a*b^2*Log[Cos[c + d*x]])/d + (a^3*Log[-Sin[c + d*x] ])/d + (b^2*(a + b*Tan[c + d*x]))/d
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Simp[1/(d*(m + n - 1)) Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[ e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2 , 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || I ntegerQ[m]) && !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])) )
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2 )/tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[B*x, x] + (Simp[A Int[1/Tan[ e + f*x], x], x] + Simp[C Int[Tan[e + f*x], x], x]) /; FreeQ[{e, f, A, B, C}, x] && NeQ[A, C]
Time = 0.90 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.11
method | result | size |
norman | \(\left (3 a^{2} b -b^{3}\right ) x +\frac {b^{3} \tan \left (d x +c \right )}{d}+\frac {a^{3} \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {a \left (a^{2}-3 b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(69\) |
parallelrisch | \(\frac {a^{3} \left (2 \ln \left (\tan \left (d x +c \right )\right )-\ln \left (\sec \left (d x +c \right )^{2}\right )\right )+3 \ln \left (\sec \left (d x +c \right )^{2}\right ) a \,b^{2}+6 a^{2} b d x -2 b^{3} d x +2 b^{3} \tan \left (d x +c \right )}{2 d}\) | \(73\) |
derivativedivides | \(-\frac {\frac {\left (a^{3}-3 a \,b^{2}\right ) \ln \left (\cot \left (d x +c \right )^{2}+1\right )}{2}+\left (3 a^{2} b -b^{3}\right ) \left (\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )-\frac {b^{3}}{\cot \left (d x +c \right )}+3 a \,b^{2} \ln \left (\cot \left (d x +c \right )\right )}{d}\) | \(82\) |
default | \(-\frac {\frac {\left (a^{3}-3 a \,b^{2}\right ) \ln \left (\cot \left (d x +c \right )^{2}+1\right )}{2}+\left (3 a^{2} b -b^{3}\right ) \left (\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )-\frac {b^{3}}{\cot \left (d x +c \right )}+3 a \,b^{2} \ln \left (\cot \left (d x +c \right )\right )}{d}\) | \(82\) |
risch | \(3 a^{2} b x -b^{3} x -i a^{3} x +3 i a \,b^{2} x +\frac {6 i a \,b^{2} c}{d}-\frac {2 i a^{3} c}{d}+\frac {2 i b^{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {3 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) b^{2}}{d}+\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(113\) |
Input:
int(cot(d*x+c)*(a+b*tan(d*x+c))^3,x,method=_RETURNVERBOSE)
Output:
(3*a^2*b-b^3)*x+b^3/d*tan(d*x+c)+1/d*a^3*ln(tan(d*x+c))-1/2*a*(a^2-3*b^2)/ d*ln(1+tan(d*x+c)^2)
Time = 0.10 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.26 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {a^{3} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - 3 \, a b^{2} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} d x}{2 \, d} \] Input:
integrate(cot(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="fricas")
Output:
1/2*(a^3*log(tan(d*x + c)^2/(tan(d*x + c)^2 + 1)) - 3*a*b^2*log(1/(tan(d*x + c)^2 + 1)) + 2*b^3*tan(d*x + c) + 2*(3*a^2*b - b^3)*d*x)/d
Time = 0.33 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.48 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=\begin {cases} - \frac {a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + 3 a^{2} b x + \frac {3 a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - b^{3} x + \frac {b^{3} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{3} \cot {\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(cot(d*x+c)*(a+b*tan(d*x+c))**3,x)
Output:
Piecewise((-a**3*log(tan(c + d*x)**2 + 1)/(2*d) + a**3*log(tan(c + d*x))/d + 3*a**2*b*x + 3*a*b**2*log(tan(c + d*x)**2 + 1)/(2*d) - b**3*x + b**3*ta n(c + d*x)/d, Ne(d, 0)), (x*(a + b*tan(c))**3*cot(c), True))
Time = 0.11 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.15 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {2 \, a^{3} \log \left (\tan \left (d x + c\right )\right ) + 2 \, b^{3} \tan \left (d x + c\right ) + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} - {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \] Input:
integrate(cot(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="maxima")
Output:
1/2*(2*a^3*log(tan(d*x + c)) + 2*b^3*tan(d*x + c) + 2*(3*a^2*b - b^3)*(d*x + c) - (a^3 - 3*a*b^2)*log(tan(d*x + c)^2 + 1))/d
Time = 0.24 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.23 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {a^{3} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{d} + \frac {b^{3} \tan \left (d x + c\right )}{d} + \frac {{\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )}}{d} - \frac {{\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \] Input:
integrate(cot(d*x+c)*(a+b*tan(d*x+c))^3,x, algorithm="giac")
Output:
a^3*log(abs(tan(d*x + c)))/d + b^3*tan(d*x + c)/d + (3*a^2*b - b^3)*(d*x + c)/d - 1/2*(a^3 - 3*a*b^2)*log(tan(d*x + c)^2 + 1)/d
Time = 1.08 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.21 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {b^3\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,{\left (a+b\,1{}\mathrm {i}\right )}^3}{2\,d}+\frac {a^3\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d} \] Input:
int(cot(c + d*x)*(a + b*tan(c + d*x))^3,x)
Output:
(b^3*tan(c + d*x))/d - (log(tan(c + d*x) + 1i)*(a*1i + b)^3*1i)/(2*d) - (l og(tan(c + d*x) - 1i)*(a + b*1i)^3)/(2*d) + (a^3*log(tan(c + d*x)))/d
Time = 0.27 (sec) , antiderivative size = 169, normalized size of antiderivative = 2.73 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {-\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a^{3}+3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a \,b^{2}-3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \,b^{2}-3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a \,b^{2}+\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{3}+3 \cos \left (d x +c \right ) a^{2} b d x -\cos \left (d x +c \right ) b^{3} d x +\sin \left (d x +c \right ) b^{3}}{\cos \left (d x +c \right ) d} \] Input:
int(cot(d*x+c)*(a+b*tan(d*x+c))^3,x)
Output:
( - cos(c + d*x)*log(tan((c + d*x)/2)**2 + 1)*a**3 + 3*cos(c + d*x)*log(ta n((c + d*x)/2)**2 + 1)*a*b**2 - 3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a *b**2 - 3*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a*b**2 + cos(c + d*x)*log (tan((c + d*x)/2))*a**3 + 3*cos(c + d*x)*a**2*b*d*x - cos(c + d*x)*b**3*d* x + sin(c + d*x)*b**3)/(cos(c + d*x)*d)