Optimal. Leaf size=14 \[ -x-\frac {2 \cos (x)}{\sin (x)+1} \]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {4391, 2670, 2680, 8} \[ -x-\frac {2 \cos (x)}{\sin (x)+1} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2670
Rule 2680
Rule 4391
Rubi steps
\begin {align*} \int (-\sec (x)+\tan (x))^2 \, dx &=\int \sec ^2(x) (-1+\sin (x))^2 \, dx\\ &=\int \frac {\cos ^2(x)}{(-1-\sin (x))^2} \, dx\\ &=-\frac {2 \cos (x)}{1+\sin (x)}-\int 1 \, dx\\ &=-x-\frac {2 \cos (x)}{1+\sin (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.01, size = 12, normalized size = 0.86 \[ -x+2 \tan (x)-2 \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int (-\sec (x)+\tan (x))^2 \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.00, size = 25, normalized size = 1.79 \[ -\frac {{\left (x + 2\right )} \cos \relax (x) + {\left (x - 2\right )} \sin \relax (x) + x + 2}{\cos \relax (x) + \sin \relax (x) + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.79, size = 14, normalized size = 1.00 \[ -x - \frac {4}{\tan \left (\frac {1}{2} \, x\right ) + 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.31, size = 15, normalized size = 1.07
method | result | size |
default | \(2 \tan \relax (x )-\frac {2}{\cos \relax (x )}-x\) | \(15\) |
risch | \(-x -\frac {4}{{\mathrm e}^{i x}+i}\) | \(17\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.96, size = 14, normalized size = 1.00 \[ -x - \frac {2}{\cos \relax (x)} + 2 \, \tan \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.27, size = 14, normalized size = 1.00 \[ -x-\frac {4}{\mathrm {tan}\left (\frac {x}{2}\right )+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.38, size = 10, normalized size = 0.71 \[ - x + 2 \tan {\relax (x )} - 2 \sec {\relax (x )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________