Integrand size = 29, antiderivative size = 66 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-((A b+a B) x)-\frac {(A b+a B) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}-\frac {(a A-b B) \log (\sin (c+d x))}{d} \] Output:
-(A*b+B*a)*x-(A*b+B*a)*cot(d*x+c)/d-1/2*a*A*cot(d*x+c)^2/d-(A*a-B*b)*ln(si n(d*x+c))/d
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.03 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.62 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {a A \csc ^2(c+d x)}{2 d}-\frac {A b \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}-\frac {a B \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}-\frac {a A \log (\sin (c+d x))}{d}+\frac {b B \log (\sin (c+d x))}{d} \] Input:
Integrate[Cot[c + d*x]^3*(a + b*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]
Output:
-1/2*(a*A*Csc[c + d*x]^2)/d - (A*b*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2])/d - (a*B*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1 /2, -Tan[c + d*x]^2])/d - (a*A*Log[Sin[c + d*x]])/d + (b*B*Log[Sin[c + d*x ]])/d
Time = 0.51 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.03, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {3042, 4074, 3042, 4012, 25, 3042, 4014, 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 ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x)) (A+B \tan (c+d x))}{\tan (c+d x)^3}dx\) |
\(\Big \downarrow \) 4074 |
\(\displaystyle \int \cot ^2(c+d x) (A b+a B-(a A-b B) \tan (c+d x))dx-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A b+a B-(a A-b B) \tan (c+d x)}{\tan (c+d x)^2}dx-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 4012 |
\(\displaystyle \int -\cot (c+d x) (a A-b B+(A b+a B) \tan (c+d x))dx-\frac {(a B+A b) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \cot (c+d x) (a A-b B+(A b+a B) \tan (c+d x))dx-\frac {(a B+A b) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\int \frac {a A-b B+(A b+a B) \tan (c+d x)}{\tan (c+d x)}dx-\frac {(a B+A b) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle -(a A-b B) \int \cot (c+d x)dx-\frac {(a B+A b) \cot (c+d x)}{d}-x (a B+A b)-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -(a A-b B) \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx-\frac {(a B+A b) \cot (c+d x)}{d}-x (a B+A b)-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle (a A-b B) \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx-\frac {(a B+A b) \cot (c+d x)}{d}-x (a B+A b)-\frac {a A \cot ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle -\frac {(a B+A b) \cot (c+d x)}{d}-\frac {(a A-b B) \log (-\sin (c+d x))}{d}-x (a B+A b)-\frac {a A \cot ^2(c+d x)}{2 d}\) |
Input:
Int[Cot[c + d*x]^3*(a + b*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]
Output:
-((A*b + a*B)*x) - ((A*b + a*B)*Cot[c + d*x])/d - (a*A*Cot[c + d*x]^2)/(2* d) - ((a*A - b*B)*Log[-Sin[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_)]), x_Symbol] :> Simp[(b*c - a*d)*((a + b*Tan[e + f*x])^(m + 1)/ (f*(m + 1)*(a^2 + b^2))), x] + Simp[1/(a^2 + b^2) Int[(a + b*Tan[e + f*x] )^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a , b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1 ]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a *d)/(a^2 + b^2) Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && N eQ[a*c + b*d, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b *c - a*d)*(A*b - a*B)*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1)*(a^2 + b^2 ))), x] + Simp[1/(a^2 + b^2) Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[a*A*c + b*B*c + A*b*d - a*B*d - (A*b*c - a*B*c - a*A*d - b*B*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && LtQ[m , -1] && NeQ[a^2 + b^2, 0]
Time = 0.16 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.35
method | result | size |
derivativedivides | \(\frac {\frac {\left (a A -B b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-A b -B a \right ) \arctan \left (\tan \left (d x +c \right )\right )-\frac {A b +B a}{\tan \left (d x +c \right )}+\left (-a A +B b \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {a A}{2 \tan \left (d x +c \right )^{2}}}{d}\) | \(89\) |
default | \(\frac {\frac {\left (a A -B b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-A b -B a \right ) \arctan \left (\tan \left (d x +c \right )\right )-\frac {A b +B a}{\tan \left (d x +c \right )}+\left (-a A +B b \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {a A}{2 \tan \left (d x +c \right )^{2}}}{d}\) | \(89\) |
parallelrisch | \(-\frac {a A \left (-\ln \left (\sec \left (d x +c \right )^{2}\right )+2 \ln \left (\tan \left (d x +c \right )\right )\right )-B b \left (-\ln \left (\sec \left (d x +c \right )^{2}\right )+2 \ln \left (\tan \left (d x +c \right )\right )\right )+2 A b d x +2 B x a d +2 A \cot \left (d x +c \right ) b +A \cot \left (d x +c \right )^{2} a +2 B \cot \left (d x +c \right ) a}{2 d}\) | \(99\) |
norman | \(\frac {\left (-A b -B a \right ) x \tan \left (d x +c \right )^{2}-\frac {a A}{2 d}-\frac {\left (A b +B a \right ) \tan \left (d x +c \right )}{d}}{\tan \left (d x +c \right )^{2}}-\frac {\left (a A -B b \right ) \ln \left (\tan \left (d x +c \right )\right )}{d}+\frac {\left (a A -B b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(100\) |
risch | \(-A b x -B a x +i A a x -i B b x +\frac {2 i a A c}{d}-\frac {2 i B b c}{d}-\frac {2 i \left (i A a \,{\mathrm e}^{2 i \left (d x +c \right )}+A b \,{\mathrm e}^{2 i \left (d x +c \right )}+B a \,{\mathrm e}^{2 i \left (d x +c \right )}-A b -B a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {a A \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B b}{d}\) | \(145\) |
Input:
int(cot(d*x+c)^3*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/d*(1/2*(A*a-B*b)*ln(1+tan(d*x+c)^2)+(-A*b-B*a)*arctan(tan(d*x+c))-(A*b+B *a)/tan(d*x+c)+(-A*a+B*b)*ln(tan(d*x+c))-1/2*a*A/tan(d*x+c)^2)
Time = 0.10 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.44 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {{\left (A a - B b\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{2} + {\left (2 \, {\left (B a + A b\right )} d x + A a\right )} \tan \left (d x + c\right )^{2} + A a + 2 \, {\left (B a + A b\right )} \tan \left (d x + c\right )}{2 \, d \tan \left (d x + c\right )^{2}} \] Input:
integrate(cot(d*x+c)^3*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fri cas")
Output:
-1/2*((A*a - B*b)*log(tan(d*x + c)^2/(tan(d*x + c)^2 + 1))*tan(d*x + c)^2 + (2*(B*a + A*b)*d*x + A*a)*tan(d*x + c)^2 + A*a + 2*(B*a + A*b)*tan(d*x + c))/(d*tan(d*x + c)^2)
Leaf count of result is larger than twice the leaf count of optimal. 148 vs. \(2 (56) = 112\).
Time = 0.75 (sec) , antiderivative size = 148, normalized size of antiderivative = 2.24 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\begin {cases} \tilde {\infty } A a x & \text {for}\: c = 0 \wedge d = 0 \\x \left (A + B \tan {\left (c \right )}\right ) \left (a + b \tan {\left (c \right )}\right ) \cot ^{3}{\left (c \right )} & \text {for}\: d = 0 \\\tilde {\infty } A a x & \text {for}\: c = - d x \\\frac {A a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {A a \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {A a}{2 d \tan ^{2}{\left (c + d x \right )}} - A b x - \frac {A b}{d \tan {\left (c + d x \right )}} - B a x - \frac {B a}{d \tan {\left (c + d x \right )}} - \frac {B b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases} \] Input:
integrate(cot(d*x+c)**3*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x)
Output:
Piecewise((zoo*A*a*x, Eq(c, 0) & Eq(d, 0)), (x*(A + B*tan(c))*(a + b*tan(c ))*cot(c)**3, Eq(d, 0)), (zoo*A*a*x, Eq(c, -d*x)), (A*a*log(tan(c + d*x)** 2 + 1)/(2*d) - A*a*log(tan(c + d*x))/d - A*a/(2*d*tan(c + d*x)**2) - A*b*x - A*b/(d*tan(c + d*x)) - B*a*x - B*a/(d*tan(c + d*x)) - B*b*log(tan(c + d *x)**2 + 1)/(2*d) + B*b*log(tan(c + d*x))/d, True))
Time = 0.11 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.30 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {2 \, {\left (B a + A b\right )} {\left (d x + c\right )} - {\left (A a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, {\left (A a - B b\right )} \log \left (\tan \left (d x + c\right )\right ) + \frac {A a + 2 \, {\left (B a + A b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2}}}{2 \, d} \] Input:
integrate(cot(d*x+c)^3*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="max ima")
Output:
-1/2*(2*(B*a + A*b)*(d*x + c) - (A*a - B*b)*log(tan(d*x + c)^2 + 1) + 2*(A *a - B*b)*log(tan(d*x + c)) + (A*a + 2*(B*a + A*b)*tan(d*x + c))/tan(d*x + c)^2)/d
Time = 0.37 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.44 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {{\left (B a + A b\right )} {\left (d x + c\right )}}{d} + \frac {{\left (A a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} - \frac {{\left (A a - B b\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{d} - \frac {A a + 2 \, {\left (B a + A b\right )} \tan \left (d x + c\right )}{2 \, d \tan \left (d x + c\right )^{2}} \] Input:
integrate(cot(d*x+c)^3*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="gia c")
Output:
-(B*a + A*b)*(d*x + c)/d + 1/2*(A*a - B*b)*log(tan(d*x + c)^2 + 1)/d - (A* a - B*b)*log(abs(tan(d*x + c)))/d - 1/2*(A*a + 2*(B*a + A*b)*tan(d*x + c)) /(d*tan(d*x + c)^2)
Time = 3.57 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.64 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (A\,a-B\,b\right )}{d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^2\,\left (\frac {A\,a}{2}+\mathrm {tan}\left (c+d\,x\right )\,\left (A\,b+B\,a\right )\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (A+B\,1{}\mathrm {i}\right )\,\left (a+b\,1{}\mathrm {i}\right )}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )\,\left (b+a\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d} \] Input:
int(cot(c + d*x)^3*(A + B*tan(c + d*x))*(a + b*tan(c + d*x)),x)
Output:
(log(tan(c + d*x) - 1i)*(A + B*1i)*(a + b*1i))/(2*d) - (cot(c + d*x)^2*((A *a)/2 + tan(c + d*x)*(A*b + B*a)))/d - (log(tan(c + d*x))*(A*a - B*b))/d - (log(tan(c + d*x) + 1i)*(A - B*1i)*(a*1i + b)*1i)/(2*d)
Time = 0.23 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.44 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {-8 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b +4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{2} a^{2}-4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{2} b^{2}-4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2} a^{2}+4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2} b^{2}+\sin \left (d x +c \right )^{2} a^{2}-8 \sin \left (d x +c \right )^{2} a b d x -2 a^{2}}{4 \sin \left (d x +c \right )^{2} d} \] Input:
int(cot(d*x+c)^3*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x)
Output:
( - 8*cos(c + d*x)*sin(c + d*x)*a*b + 4*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)**2*a**2 - 4*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)**2*b**2 - 4* log(tan((c + d*x)/2))*sin(c + d*x)**2*a**2 + 4*log(tan((c + d*x)/2))*sin(c + d*x)**2*b**2 + sin(c + d*x)**2*a**2 - 8*sin(c + d*x)**2*a*b*d*x - 2*a** 2)/(4*sin(c + d*x)**2*d)