Optimal. Leaf size=100 \[ \frac {2 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^3 d}-\frac {x \left (2 a^2-b^2\right )}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2865, 2735, 2660, 618, 204} \[ \frac {2 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^3 d}-\frac {x \left (2 a^2-b^2\right )}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 618
Rule 2660
Rule 2735
Rule 2865
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) \sin (c+d x)}{a+b \sin (c+d x)} \, dx &=-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}+\frac {\int \frac {-a b-\left (2 a^2-b^2\right ) \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{2 b^2}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}+\frac {\left (a \left (a^2-b^2\right )\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{b^3}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}+\frac {\left (2 a \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^3 d}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}-\frac {\left (4 a \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^3 d}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}+\frac {2 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^3 d}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.23, size = 104, normalized size = 1.04 \[ \frac {8 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )-4 a^2 c-4 a^2 d x-4 a b \cos (c+d x)+b^2 \sin (2 (c+d x))+2 b^2 c+2 b^2 d x}{4 b^3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.85, size = 275, normalized size = 2.75 \[ \left [\frac {b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (2 \, a^{2} - b^{2}\right )} d x - 2 \, a b \cos \left (d x + c\right ) + \sqrt {-a^{2} + b^{2}} a \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right )}{2 \, b^{3} d}, \frac {b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (2 \, a^{2} - b^{2}\right )} d x - 2 \, a b \cos \left (d x + c\right ) - 2 \, \sqrt {a^{2} - b^{2}} a \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right )}{2 \, b^{3} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 159, normalized size = 1.59 \[ -\frac {\frac {{\left (2 \, a^{2} - b^{2}\right )} {\left (d x + c\right )}}{b^{3}} - \frac {4 \, {\left (a^{3} - a b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} b^{3}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} b^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.24, size = 214, normalized size = 2.14 \[ -\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{d b \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a}{d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d b \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {2 a}{d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}}{d \,b^{3}}+\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d b}+\frac {2 a \sqrt {a^{2}-b^{2}}\, \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{d \,b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.07, size = 190, normalized size = 1.90 \[ \frac {\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {\sin \left (2\,c+2\,d\,x\right )}{4}}{b\,d}-\frac {2\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^3\,d}-\frac {a\,\cos \left (c+d\,x\right )}{b^2\,d}-\frac {2\,a\,\mathrm {atanh}\left (\frac {-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{\sqrt {b^2-a^2}\,\left (a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}\right )\,\sqrt {b^2-a^2}}{b^3\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________