Optimal. Leaf size=10 \[ -4 x+\tan (x)-\cot (x) \]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {461, 203} \[ -4 x+\tan (x)-\cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 461
Rubi steps
\begin {align*} \int (-\cot (x)+\tan (x))^2 \, dx &=\operatorname {Subst}\left (\int \frac {\left (1-x^2\right )^2}{x^2 \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\operatorname {Subst}\left (\int \left (1+\frac {1}{x^2}-\frac {4}{1+x^2}\right ) \, dx,x,\tan (x)\right )\\ &=-\cot (x)+\tan (x)-4 \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )\\ &=-4 x-\cot (x)+\tan (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 10, normalized size = 1.00 \[ -4 x+\tan (x)-\cot (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int (-\cot (x)+\tan (x))^2 \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.90, size = 19, normalized size = 1.90 \[ -\frac {4 \, x \tan \relax (x) - \tan \relax (x)^{2} + 1}{\tan \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.83, size = 12, normalized size = 1.20 \[ -4 \, x - \frac {1}{\tan \relax (x)} + \tan \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 11, normalized size = 1.10
method | result | size |
default | \(-4 x -\cot \relax (x )+\tan \relax (x )\) | \(11\) |
norman | \(\frac {-1+\tan ^{2}\relax (x )-4 x \tan \relax (x )}{\tan \relax (x )}\) | \(17\) |
risch | \(-4 x -\frac {4 i}{\left (1+{\mathrm e}^{2 i x}\right ) \left ({\mathrm e}^{2 i x}-1\right )}\) | \(26\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.95, size = 12, normalized size = 1.20 \[ -4 \, x - \frac {1}{\tan \relax (x)} + \tan \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.27, size = 12, normalized size = 1.20 \[ \mathrm {tan}\relax (x)-4\,x-\frac {1}{\mathrm {tan}\relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.37, size = 10, normalized size = 1.00 \[ - 4 x + \tan {\relax (x )} - \frac {1}{\tan {\relax (x )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________