Integrand size = 23, antiderivative size = 56 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {a^2 \cot ^2(e+f x)}{2 f}-\frac {(a-b)^2 \log (\cos (e+f x))}{f}-\frac {a (a-2 b) \log (\tan (e+f x))}{f} \] Output:
-1/2*a^2*cot(f*x+e)^2/f-(a-b)^2*ln(cos(f*x+e))/f-a*(a-2*b)*ln(tan(f*x+e))/ f
Time = 0.04 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.12 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {a^2 \csc ^2(e+f x)}{2 f}-\frac {b^2 \log (\cos (e+f x))}{f}-\frac {a^2 \log (\sin (e+f x))}{f}+\frac {2 a b \log (\sin (e+f x))}{f} \] Input:
Integrate[Cot[e + f*x]^3*(a + b*Tan[e + f*x]^2)^2,x]
Output:
-1/2*(a^2*Csc[e + f*x]^2)/f - (b^2*Log[Cos[e + f*x]])/f - (a^2*Log[Sin[e + f*x]])/f + (2*a*b*Log[Sin[e + f*x]])/f
Time = 0.45 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.98, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4153, 354, 99, 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 ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \tan (e+f x)^2\right )^2}{\tan (e+f x)^3}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\cot ^3(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle \frac {\int \frac {\cot ^2(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 99 |
\(\displaystyle \frac {\int \left (\frac {(a-b)^2}{\tan ^2(e+f x)+1}+a^2 \cot ^2(e+f x)-a (a-2 b) \cot (e+f x)\right )d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 (-\cot (e+f x))-a (a-2 b) \log \left (\tan ^2(e+f x)\right )+(a-b)^2 \log \left (\tan ^2(e+f x)+1\right )}{2 f}\) |
Input:
Int[Cot[e + f*x]^3*(a + b*Tan[e + f*x]^2)^2,x]
Output:
(-(a^2*Cot[e + f*x]) - a*(a - 2*b)*Log[Tan[e + f*x]^2] + (a - b)^2*Log[1 + Tan[e + f*x]^2])/(2*f)
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) )^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | | (GtQ[m, 0] && GeQ[n, -1]))
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((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[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.98 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.95
method | result | size |
parallelrisch | \(\frac {\left (a -b \right )^{2} \ln \left (\sec \left (f x +e \right )^{2}\right )-a \left (\left (2 a -4 b \right ) \ln \left (\tan \left (f x +e \right )\right )+a \cot \left (f x +e \right )^{2}\right )}{2 f}\) | \(53\) |
derivativedivides | \(\frac {\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}-\frac {a^{2}}{2 \tan \left (f x +e \right )^{2}}-a \left (a -2 b \right ) \ln \left (\tan \left (f x +e \right )\right )}{f}\) | \(58\) |
default | \(\frac {\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}-\frac {a^{2}}{2 \tan \left (f x +e \right )^{2}}-a \left (a -2 b \right ) \ln \left (\tan \left (f x +e \right )\right )}{f}\) | \(58\) |
norman | \(-\frac {a^{2}}{2 f \tan \left (f x +e \right )^{2}}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}-\frac {a \left (a -2 b \right ) \ln \left (\tan \left (f x +e \right )\right )}{f}\) | \(63\) |
risch | \(i a^{2} x -2 i a b x +i b^{2} x +\frac {2 i b^{2} e}{f}+\frac {2 i a^{2} e}{f}-\frac {4 i a b e}{f}+\frac {2 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b^{2}}{f}-\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{f}+\frac {2 a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b}{f}\) | \(140\) |
Input:
int(cot(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
Output:
1/2*((a-b)^2*ln(sec(f*x+e)^2)-a*((2*a-4*b)*ln(tan(f*x+e))+a*cot(f*x+e)^2)) /f
Time = 0.09 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.66 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {b^{2} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + a^{2} \tan \left (f x + e\right )^{2} + {\left (a^{2} - 2 \, a b\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} + a^{2}}{2 \, f \tan \left (f x + e\right )^{2}} \] Input:
integrate(cot(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")
Output:
-1/2*(b^2*log(1/(tan(f*x + e)^2 + 1))*tan(f*x + e)^2 + a^2*tan(f*x + e)^2 + (a^2 - 2*a*b)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1))*tan(f*x + e)^2 + a^2)/(f*tan(f*x + e)^2)
Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (48) = 96\).
Time = 1.17 (sec) , antiderivative size = 129, normalized size of antiderivative = 2.30 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\begin {cases} \tilde {\infty } a^{2} x & \text {for}\: e = 0 \wedge f = 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \cot ^{3}{\left (e \right )} & \text {for}\: f = 0 \\\tilde {\infty } a^{2} x & \text {for}\: e = - f x \\\frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {a^{2} \log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {a^{2}}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac {a b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {2 a b \log {\left (\tan {\left (e + f x \right )} \right )}}{f} + \frac {b^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} & \text {otherwise} \end {cases} \] Input:
integrate(cot(f*x+e)**3*(a+b*tan(f*x+e)**2)**2,x)
Output:
Piecewise((zoo*a**2*x, Eq(e, 0) & Eq(f, 0)), (x*(a + b*tan(e)**2)**2*cot(e )**3, Eq(f, 0)), (zoo*a**2*x, Eq(e, -f*x)), (a**2*log(tan(e + f*x)**2 + 1) /(2*f) - a**2*log(tan(e + f*x))/f - a**2/(2*f*tan(e + f*x)**2) - a*b*log(t an(e + f*x)**2 + 1)/f + 2*a*b*log(tan(e + f*x))/f + b**2*log(tan(e + f*x)* *2 + 1)/(2*f), True))
Time = 0.03 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.91 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {b^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) + {\left (a^{2} - 2 \, a b\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac {a^{2}}{\sin \left (f x + e\right )^{2}}}{2 \, f} \] Input:
integrate(cot(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")
Output:
-1/2*(b^2*log(sin(f*x + e)^2 - 1) + (a^2 - 2*a*b)*log(sin(f*x + e)^2) + a^ 2/sin(f*x + e)^2)/f
Time = 0.74 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.66 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{2 \, f} - \frac {{\left (a^{2} - 2 \, a b\right )} \log \left (\tan \left (f x + e\right )^{2}\right )}{2 \, f} + \frac {a^{2} \tan \left (f x + e\right )^{2} - 2 \, a b \tan \left (f x + e\right )^{2} - a^{2}}{2 \, f \tan \left (f x + e\right )^{2}} \] Input:
integrate(cot(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
Output:
1/2*(a^2 - 2*a*b + b^2)*log(tan(f*x + e)^2 + 1)/f - 1/2*(a^2 - 2*a*b)*log( tan(f*x + e)^2)/f + 1/2*(a^2*tan(f*x + e)^2 - 2*a*b*tan(f*x + e)^2 - a^2)/ (f*tan(f*x + e)^2)
Time = 7.75 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.21 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (2\,a\,b-a^2\right )}{f}-\frac {a^2\,{\mathrm {cot}\left (e+f\,x\right )}^2}{2\,f} \] Input:
int(cot(e + f*x)^3*(a + b*tan(e + f*x)^2)^2,x)
Output:
(log(tan(e + f*x)^2 + 1)*(a^2/2 - a*b + b^2/2))/f + (log(tan(e + f*x))*(2* a*b - a^2))/f - (a^2*cot(e + f*x)^2)/(2*f)
Time = 0.15 (sec) , antiderivative size = 206, normalized size of antiderivative = 3.68 \[ \int \cot ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \sin \left (f x +e \right )^{2} a^{2}-8 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \sin \left (f x +e \right )^{2} a b +4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+1\right ) \sin \left (f x +e \right )^{2} b^{2}-4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) \sin \left (f x +e \right )^{2} b^{2}-4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \sin \left (f x +e \right )^{2} b^{2}-4 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{2} a^{2}+8 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{2} a b +\sin \left (f x +e \right )^{2} a^{2}-2 a^{2}}{4 \sin \left (f x +e \right )^{2} f} \] Input:
int(cot(f*x+e)^3*(a+b*tan(f*x+e)^2)^2,x)
Output:
(4*log(tan((e + f*x)/2)**2 + 1)*sin(e + f*x)**2*a**2 - 8*log(tan((e + f*x) /2)**2 + 1)*sin(e + f*x)**2*a*b + 4*log(tan((e + f*x)/2)**2 + 1)*sin(e + f *x)**2*b**2 - 4*log(tan((e + f*x)/2) - 1)*sin(e + f*x)**2*b**2 - 4*log(tan ((e + f*x)/2) + 1)*sin(e + f*x)**2*b**2 - 4*log(tan((e + f*x)/2))*sin(e + f*x)**2*a**2 + 8*log(tan((e + f*x)/2))*sin(e + f*x)**2*a*b + sin(e + f*x)* *2*a**2 - 2*a**2)/(4*sin(e + f*x)**2*f)