Optimal. Leaf size=90 \[ \frac {\left (2 a^2-b^2\right ) \cos (c+d x)}{3 d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {a b \sin (c+d x) \cos (c+d x)}{3 d}+\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}+a b x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.25, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {2889, 3050, 3033, 3023, 2735, 3770} \[ \frac {\left (2 a^2-b^2\right ) \cos (c+d x)}{3 d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {a b \sin (c+d x) \cos (c+d x)}{3 d}+\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}+a b x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2889
Rule 3023
Rule 3033
Rule 3050
Rule 3770
Rubi steps
\begin {align*} \int \cos (c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx &=\int \csc (c+d x) (a+b \sin (c+d x))^2 \left (1-\sin ^2(c+d x)\right ) \, dx\\ &=\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}+\frac {1}{3} \int \csc (c+d x) (a+b \sin (c+d x)) \left (3 a+b \sin (c+d x)-2 a \sin ^2(c+d x)\right ) \, dx\\ &=\frac {a b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}+\frac {1}{6} \int \csc (c+d x) \left (6 a^2+6 a b \sin (c+d x)-2 \left (2 a^2-b^2\right ) \sin ^2(c+d x)\right ) \, dx\\ &=\frac {\left (2 a^2-b^2\right ) \cos (c+d x)}{3 d}+\frac {a b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}+\frac {1}{6} \int \csc (c+d x) \left (6 a^2+6 a b \sin (c+d x)\right ) \, dx\\ &=a b x+\frac {\left (2 a^2-b^2\right ) \cos (c+d x)}{3 d}+\frac {a b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}+a^2 \int \csc (c+d x) \, dx\\ &=a b x-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {\left (2 a^2-b^2\right ) \cos (c+d x)}{3 d}+\frac {a b \cos (c+d x) \sin (c+d x)}{3 d}+\frac {\cos (c+d x) (a+b \sin (c+d x))^2}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.22, size = 91, normalized size = 1.01 \[ \frac {3 \left (4 a^2-b^2\right ) \cos (c+d x)+6 a \left (2 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+b \sin (2 (c+d x))+2 b c+2 b d x\right )+b^2 (-\cos (3 (c+d x)))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.77, size = 84, normalized size = 0.93 \[ -\frac {2 \, b^{2} \cos \left (d x + c\right )^{3} - 6 \, a b d x - 6 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 6 \, a^{2} \cos \left (d x + c\right ) + 3 \, a^{2} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 3 \, a^{2} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 133, normalized size = 1.48 \[ \frac {3 \, {\left (d x + c\right )} a b + 3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {2 \, {\left (3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2} + b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.40, size = 83, normalized size = 0.92 \[ \frac {a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {a^{2} \cos \left (d x +c \right )}{d}+\frac {a b \cos \left (d x +c \right ) \sin \left (d x +c \right )}{d}+a b x +\frac {a b c}{d}-\frac {b^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.31, size = 74, normalized size = 0.82 \[ -\frac {2 \, b^{2} \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a b - 3 \, a^{2} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.87, size = 225, normalized size = 2.50 \[ \frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (2\,a^2-2\,b^2\right )+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^2-\frac {2\,b^2}{3}-2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {2\,a\,b\,\mathrm {atan}\left (\frac {4\,a^2\,b^2}{4\,a^3\,b-4\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {4\,a^3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,a^3\,b-4\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________