Optimal. Leaf size=117 \[ -\frac {a b^2 \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )^2}+\frac {\sec ^2(c+d x) (a-b \sin (c+d x))}{2 d \left (a^2-b^2\right )}-\frac {b \log (1-\sin (c+d x))}{4 d (a+b)^2}+\frac {b \log (\sin (c+d x)+1)}{4 d (a-b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2837, 12, 823, 801} \[ -\frac {a b^2 \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )^2}+\frac {\sec ^2(c+d x) (a-b \sin (c+d x))}{2 d \left (a^2-b^2\right )}-\frac {b \log (1-\sin (c+d x))}{4 d (a+b)^2}+\frac {b \log (\sin (c+d x)+1)}{4 d (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 801
Rule 823
Rule 2837
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x) \tan (c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {b^3 \operatorname {Subst}\left (\int \frac {x}{b (a+x) \left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b^2 \operatorname {Subst}\left (\int \frac {x}{(a+x) \left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^2(c+d x) (a-b \sin (c+d x))}{2 \left (a^2-b^2\right ) d}-\frac {\operatorname {Subst}\left (\int \frac {-a b^2+b^2 x}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \sin (c+d x)\right )}{2 \left (a^2-b^2\right ) d}\\ &=\frac {\sec ^2(c+d x) (a-b \sin (c+d x))}{2 \left (a^2-b^2\right ) d}-\frac {\operatorname {Subst}\left (\int \left (\frac {b (-a+b)}{2 (a+b) (b-x)}+\frac {2 a b^2}{(a-b) (a+b) (a+x)}-\frac {b (a+b)}{2 (a-b) (b+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{2 \left (a^2-b^2\right ) d}\\ &=-\frac {b \log (1-\sin (c+d x))}{4 (a+b)^2 d}+\frac {b \log (1+\sin (c+d x))}{4 (a-b)^2 d}-\frac {a b^2 \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^2 d}+\frac {\sec ^2(c+d x) (a-b \sin (c+d x))}{2 \left (a^2-b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.41, size = 162, normalized size = 1.38 \[ \frac {-\frac {4 a b^2 \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^2}+\frac {1}{(a+b) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {1}{(a-b) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{(a+b)^2}+\frac {2 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}{(a-b)^2}}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.86, size = 155, normalized size = 1.32 \[ -\frac {4 \, a b^{2} \cos \left (d x + c\right )^{2} \log \left (b \sin \left (d x + c\right ) + a\right ) - {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, a^{3} + 2 \, a b^{2} + 2 \, {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} d \cos \left (d x + c\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.23, size = 170, normalized size = 1.45 \[ -\frac {\frac {4 \, a b^{3} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{4} b - 2 \, a^{2} b^{3} + b^{5}} - \frac {b \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a^{2} - 2 \, a b + b^{2}} + \frac {b \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a^{2} + 2 \, a b + b^{2}} + \frac {2 \, {\left (a b^{2} \sin \left (d x + c\right )^{2} - a^{2} b \sin \left (d x + c\right ) + b^{3} \sin \left (d x + c\right ) + a^{3} - 2 \, a b^{2}\right )}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (\sin \left (d x + c\right )^{2} - 1\right )}}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.36, size = 123, normalized size = 1.05 \[ -\frac {1}{d \left (4 a +4 b \right ) \left (\sin \left (d x +c \right )-1\right )}-\frac {\ln \left (\sin \left (d x +c \right )-1\right ) b}{4 d \left (a +b \right )^{2}}-\frac {a \,b^{2} \ln \left (a +b \sin \left (d x +c \right )\right )}{d \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {1}{d \left (4 a -4 b \right ) \left (1+\sin \left (d x +c \right )\right )}+\frac {b \ln \left (1+\sin \left (d x +c \right )\right )}{4 \left (a -b \right )^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 132, normalized size = 1.13 \[ -\frac {\frac {4 \, a b^{2} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} - \frac {b \log \left (\sin \left (d x + c\right ) + 1\right )}{a^{2} - 2 \, a b + b^{2}} + \frac {b \log \left (\sin \left (d x + c\right ) - 1\right )}{a^{2} + 2 \, a b + b^{2}} - \frac {2 \, {\left (b \sin \left (d x + c\right ) - a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} - a^{2} + b^{2}}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.11, size = 208, normalized size = 1.78 \[ \frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}{2\,d\,{\left (a-b\right )}^2}-\frac {\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2-b^2}-\frac {2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{a^2-b^2}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{a^2-b^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}{2\,d\,{\left (a+b\right )}^2}-\frac {a\,b^2\,\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}{d\,\left (a^4-2\,a^2\,b^2+b^4\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sin {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________