Optimal. Leaf size=18 \[ \frac {1}{2} \tanh ^{-1}(\sin (x))-\frac {1}{2 (1+\sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2746, 46, 213}
\begin {gather*} \frac {1}{2} \tanh ^{-1}(\sin (x))-\frac {1}{2 (\sin (x)+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 213
Rule 2746
Rubi steps
\begin {align*} \int \frac {\sec (x)}{1+\sin (x)} \, dx &=\text {Subst}\left (\int \frac {1}{(1-x) (1+x)^2} \, dx,x,\sin (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {1}{2 (1+x)^2}-\frac {1}{2 \left (-1+x^2\right )}\right ) \, dx,x,\sin (x)\right )\\ &=-\frac {1}{2 (1+\sin (x))}-\frac {1}{2} \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sin (x)\right )\\ &=\frac {1}{2} \tanh ^{-1}(\sin (x))-\frac {1}{2 (1+\sin (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 18, normalized size = 1.00 \begin {gather*} \frac {1}{2} \tanh ^{-1}(\sin (x))-\frac {1}{2 (1+\sin (x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [B] Leaf count is larger than twice the leaf count of optimal. \(65\) vs. \(2(18)=36\).
time = 4.48, size = 55, normalized size = 3.06 \begin {gather*} \frac {\text {Log}\left [1+\text {Tan}\left [\frac {x}{2}\right ]\right ]+\text {Sin}\left [x\right ]-\text {Log}\left [-1+\text {Tan}\left [\frac {x}{2}\right ]\right ]-\text {Log}\left [-1+\text {Tan}\left [\frac {x}{2}\right ]\right ] \text {Sin}\left [x\right ]+\text {Log}\left [1+\text {Tan}\left [\frac {x}{2}\right ]\right ] \text {Sin}\left [x\right ]}{\left (1+\text {Cos}\left [x\right ]\right ) \left (1+\text {Tan}\left [\frac {x}{2}\right ]\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 24, normalized size = 1.33
method | result | size |
default | \(-\frac {1}{2 \left (\sin \left (x \right )+1\right )}+\frac {\ln \left (\sin \left (x \right )+1\right )}{4}-\frac {\ln \left (-1+\sin \left (x \right )\right )}{4}\) | \(24\) |
norman | \(\frac {\tan \left (\frac {x}{2}\right )}{\left (1+\tan \left (\frac {x}{2}\right )\right )^{2}}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{2}+\frac {\ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{2}\) | \(33\) |
risch | \(-\frac {i {\mathrm e}^{i x}}{\left ({\mathrm e}^{i x}+i\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-i\right )}{2}+\frac {\ln \left ({\mathrm e}^{i x}+i\right )}{2}\) | \(42\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.25, size = 23, normalized size = 1.28 \begin {gather*} -\frac {1}{2 \, {\left (\sin \left (x\right ) + 1\right )}} + \frac {1}{4} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{4} \, \log \left (\sin \left (x\right ) - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 33 vs.
\(2 (14) = 28\).
time = 0.39, size = 33, normalized size = 1.83 \begin {gather*} \frac {{\left (\sin \left (x\right ) + 1\right )} \log \left (\sin \left (x\right ) + 1\right ) - {\left (\sin \left (x\right ) + 1\right )} \log \left (-\sin \left (x\right ) + 1\right ) - 2}{4 \, {\left (\sin \left (x\right ) + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (x \right )}}{\sin {\left (x \right )} + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 28, normalized size = 1.56 \begin {gather*} -\frac {\ln \left (-\sin x+1\right )}{4}+\frac {\ln \left (\sin x+1\right )}{4}-\frac {1}{2 \left (\sin x+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.13, size = 22, normalized size = 1.22 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}+\frac {\pi }{4}\right )\right )}{2}-\frac {1}{2\,\left (\sin \left (x\right )+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________