Optimal. Leaf size=14 \[ -x-\frac {2 \cos (x)}{1+\sin (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, 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 = {4476, 2749,
2759, 8} \begin {gather*} -x-\frac {2 \cos (x)}{\sin (x)+1} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2749
Rule 2759
Rule 4476
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 \begin {gather*} -x-2 \sec (x)+2 \tan (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.04, size = 15, normalized size = 1.07
method | result | size |
default | \(2 \tan \left (x \right )-\frac {2}{\cos \left (x \right )}-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 = 2.16, size = 14, normalized size = 1.00 \begin {gather*} -x - \frac {2}{\cos \left (x\right )} + 2 \, \tan \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.61, size = 25, normalized size = 1.79 \begin {gather*} -\frac {{\left (x + 2\right )} \cos \left (x\right ) + {\left (x - 2\right )} \sin \left (x\right ) + x + 2}{\cos \left (x\right ) + \sin \left (x\right ) + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.64, size = 10, normalized size = 0.71 \begin {gather*} - x + 2 \tan {\left (x \right )} - 2 \sec {\left (x \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.05, size = 14, normalized size = 1.00 \begin {gather*} -x - \frac {4}{\tan \left (\frac {1}{2} \, x\right ) + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.27, size = 14, normalized size = 1.00 \begin {gather*} -x-\frac {4}{\mathrm {tan}\left (\frac {x}{2}\right )+1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________