Integrand size = 29, antiderivative size = 43 \[ \int \cot ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-((a A-b B) x)-\frac {a A \cot (c+d x)}{d}+\frac {(A b+a B) \log (\sin (c+d x))}{d} \] Output:
-(A*a-B*b)*x-a*A*cot(d*x+c)/d+(A*b+B*a)*ln(sin(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 = 62, normalized size of antiderivative = 1.44 \[ \int \cot ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=b B x-\frac {a A \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}+\frac {A b \log (\sin (c+d x))}{d}+\frac {a B \log (\sin (c+d x))}{d} \] Input:
Integrate[Cot[c + d*x]^2*(a + b*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]
Output:
b*B*x - (a*A*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2] )/d + (A*b*Log[Sin[c + d*x]])/d + (a*B*Log[Sin[c + d*x]])/d
Time = 0.39 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.05, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3042, 4074, 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 ^2(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)^2}dx\) |
\(\Big \downarrow \) 4074 |
\(\displaystyle \int \cot (c+d x) (A b+a B-(a A-b B) \tan (c+d x))dx-\frac {a A \cot (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A b+a B-(a A-b B) \tan (c+d x)}{\tan (c+d x)}dx-\frac {a A \cot (c+d x)}{d}\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle (a B+A b) \int \cot (c+d x)dx-(x (a A-b B))-\frac {a A \cot (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (a B+A b) \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx-(x (a A-b B))-\frac {a A \cot (c+d x)}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -(a B+A b) \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx-(x (a A-b B))-\frac {a A \cot (c+d x)}{d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {(a B+A b) \log (-\sin (c+d x))}{d}-(x (a A-b B))-\frac {a A \cot (c+d x)}{d}\) |
Input:
Int[Cot[c + d*x]^2*(a + b*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]
Output:
-((a*A - b*B)*x) - (a*A*Cot[c + d*x])/d + ((A*b + a*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[((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.13 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.51
method | result | size |
parallelrisch | \(\frac {\left (-A b -B a \right ) \ln \left (\sec \left (d x +c \right )^{2}\right )+\left (2 A b +2 B a \right ) \ln \left (\tan \left (d x +c \right )\right )-2 a A \cot \left (d x +c \right )-2 d x \left (a A -B b \right )}{2 d}\) | \(65\) |
derivativedivides | \(\frac {\frac {\left (-A b -B a \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-a A +B b \right ) \arctan \left (\tan \left (d x +c \right )\right )+\left (A b +B a \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {a A}{\tan \left (d x +c \right )}}{d}\) | \(71\) |
default | \(\frac {\frac {\left (-A b -B a \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-a A +B b \right ) \arctan \left (\tan \left (d x +c \right )\right )+\left (A b +B a \right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {a A}{\tan \left (d x +c \right )}}{d}\) | \(71\) |
norman | \(\frac {\left (-a A +B b \right ) x \tan \left (d x +c \right )-\frac {a A}{d}}{\tan \left (d x +c \right )}+\frac {\left (A b +B a \right ) \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {\left (A b +B a \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(76\) |
risch | \(-i A b x -i B a x -A a x +B b x -\frac {2 i A b c}{d}-\frac {2 i a B c}{d}-\frac {2 i a A}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) A b}{d}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B}{d}\) | \(98\) |
Input:
int(cot(d*x+c)^2*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/2*((-A*b-B*a)*ln(sec(d*x+c)^2)+(2*A*b+2*B*a)*ln(tan(d*x+c))-2*a*A*cot(d* x+c)-2*d*x*(A*a-B*b))/d
Time = 0.10 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.70 \[ \int \cot ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {2 \, {\left (A a - B b\right )} d x \tan \left (d x + c\right ) - {\left (B a + A 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 \, A a}{2 \, d \tan \left (d x + c\right )} \] Input:
integrate(cot(d*x+c)^2*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fri cas")
Output:
-1/2*(2*(A*a - B*b)*d*x*tan(d*x + c) - (B*a + A*b)*log(tan(d*x + c)^2/(tan (d*x + c)^2 + 1))*tan(d*x + c) + 2*A*a)/(d*tan(d*x + c))
Leaf count of result is larger than twice the leaf count of optimal. 121 vs. \(2 (36) = 72\).
Time = 0.31 (sec) , antiderivative size = 121, normalized size of antiderivative = 2.81 \[ \int \cot ^2(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 ^{2}{\left (c \right )} & \text {for}\: d = 0 \\\tilde {\infty } A a x & \text {for}\: c = - d x \\- A a x - \frac {A a}{d \tan {\left (c + d x \right )}} - \frac {A b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {A b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {B a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B a \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + B b x & \text {otherwise} \end {cases} \] Input:
integrate(cot(d*x+c)**2*(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)**2, Eq(d, 0)), (zoo*A*a*x, Eq(c, -d*x)), (-A*a*x - A*a/(d*tan(c + d*x)) - A*b*log(tan(c + d*x)**2 + 1)/(2*d) + A*b*log(tan(c + d*x))/d - B *a*log(tan(c + d*x)**2 + 1)/(2*d) + B*a*log(tan(c + d*x))/d + B*b*x, True) )
Time = 0.11 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.58 \[ \int \cot ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {2 \, {\left (A a - B b\right )} {\left (d x + c\right )} + {\left (B a + A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, {\left (B a + A b\right )} \log \left (\tan \left (d x + c\right )\right ) + \frac {2 \, A a}{\tan \left (d x + c\right )}}{2 \, d} \] Input:
integrate(cot(d*x+c)^2*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="max ima")
Output:
-1/2*(2*(A*a - B*b)*(d*x + c) + (B*a + A*b)*log(tan(d*x + c)^2 + 1) - 2*(B *a + A*b)*log(tan(d*x + c)) + 2*A*a/tan(d*x + c))/d
Time = 0.27 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.77 \[ \int \cot ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {{\left (A a - B b\right )} {\left (d x + c\right )}}{d} - \frac {{\left (B a + A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} + \frac {{\left (B a + A b\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{d} - \frac {A a}{d \tan \left (d x + c\right )} \] Input:
integrate(cot(d*x+c)^2*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="gia c")
Output:
-(A*a - B*b)*(d*x + c)/d - 1/2*(B*a + A*b)*log(tan(d*x + c)^2 + 1)/d + (B* a + A*b)*log(abs(tan(d*x + c)))/d - A*a/(d*tan(d*x + c))
Time = 3.57 (sec) , antiderivative size = 87, normalized size of antiderivative = 2.02 \[ \int \cot ^2(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\,b+B\,a\right )}{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 )}{2\,d}-\frac {A\,a\,\mathrm {cot}\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 )\,\left (a+b\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d} \] Input:
int(cot(c + d*x)^2*(A + B*tan(c + d*x))*(a + b*tan(c + d*x)),x)
Output:
(log(tan(c + d*x))*(A*b + B*a))/d + (log(tan(c + d*x) - 1i)*(A + B*1i)*(a + b*1i)*1i)/(2*d) - (log(tan(c + d*x) + 1i)*(A - B*1i)*(a*1i + b))/(2*d) - (A*a*cot(c + d*x))/d
Time = 0.23 (sec) , antiderivative size = 93, normalized size of antiderivative = 2.16 \[ \int \cot ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {-\cos \left (d x +c \right ) a^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right ) a b +2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right ) a b -\sin \left (d x +c \right ) a^{2} d x +\sin \left (d x +c \right ) b^{2} d x}{\sin \left (d x +c \right ) d} \] Input:
int(cot(d*x+c)^2*(a+b*tan(d*x+c))*(A+B*tan(d*x+c)),x)
Output:
( - cos(c + d*x)*a**2 - 2*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)*a*b + 2*log(tan((c + d*x)/2))*sin(c + d*x)*a*b - sin(c + d*x)*a**2*d*x + sin(c + d*x)*b**2*d*x)/(sin(c + d*x)*d)