Optimal. Leaf size=148 \[ \frac{4 b c \text{EllipticF}\left (\frac{1}{2} \left (c+d x-\frac{\pi }{2}\right ),2\right )}{3 d}-\frac{a^2 \cos (c+d x)}{d}+\frac{4 a b E\left (\left .\frac{1}{2} \left (c+d x-\frac{\pi }{2}\right )\right |2\right )}{d}-\frac{a c \sin (c+d x) \cos (c+d x)}{d}+a c x+b^2 x-\frac{4 b c \sqrt{\sin (c+d x)} \cos (c+d x)}{3 d}+\frac{c^2 \cos ^3(c+d x)}{3 d}-\frac{c^2 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.239463, antiderivative size = 148, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.258, Rules used = {4395, 4401, 2639, 2638, 2635, 2641, 8, 2633} \[ -\frac{a^2 \cos (c+d x)}{d}+\frac{4 a b E\left (\left .\frac{1}{2} \left (c+d x-\frac{\pi }{2}\right )\right |2\right )}{d}-\frac{a c \sin (c+d x) \cos (c+d x)}{d}+a c x+b^2 x+\frac{4 b c F\left (\left .\frac{1}{2} \left (c+d x-\frac{\pi }{2}\right )\right |2\right )}{3 d}-\frac{4 b c \sqrt{\sin (c+d x)} \cos (c+d x)}{3 d}+\frac{c^2 \cos ^3(c+d x)}{3 d}-\frac{c^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4395
Rule 4401
Rule 2639
Rule 2638
Rule 2635
Rule 2641
Rule 8
Rule 2633
Rubi steps
\begin{align*} \int \sin (c+d x) \left (a+\frac{b}{\sqrt{\sin (c+d x)}}+c \sin (c+d x)\right )^2 \, dx &=\int \left (b+a \sqrt{\sin (c+d x)}+c \sin ^{\frac{3}{2}}(c+d x)\right )^2 \, dx\\ &=\int \left (b^2+2 a b \sqrt{\sin (c+d x)}+a^2 \sin (c+d x)+2 b c \sin ^{\frac{3}{2}}(c+d x)+2 a c \sin ^2(c+d x)+c^2 \sin ^3(c+d x)\right ) \, dx\\ &=b^2 x+a^2 \int \sin (c+d x) \, dx+(2 a b) \int \sqrt{\sin (c+d x)} \, dx+(2 a c) \int \sin ^2(c+d x) \, dx+(2 b c) \int \sin ^{\frac{3}{2}}(c+d x) \, dx+c^2 \int \sin ^3(c+d x) \, dx\\ &=b^2 x-\frac{a^2 \cos (c+d x)}{d}+\frac{4 a b E\left (\left .\frac{1}{2} \left (c-\frac{\pi }{2}+d x\right )\right |2\right )}{d}-\frac{4 b c \cos (c+d x) \sqrt{\sin (c+d x)}}{3 d}-\frac{a c \cos (c+d x) \sin (c+d x)}{d}+(a c) \int 1 \, dx+\frac{1}{3} (2 b c) \int \frac{1}{\sqrt{\sin (c+d x)}} \, dx-\frac{c^2 \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=b^2 x+a c x-\frac{a^2 \cos (c+d x)}{d}-\frac{c^2 \cos (c+d x)}{d}+\frac{c^2 \cos ^3(c+d x)}{3 d}+\frac{4 a b E\left (\left .\frac{1}{2} \left (c-\frac{\pi }{2}+d x\right )\right |2\right )}{d}+\frac{4 b c F\left (\left .\frac{1}{2} \left (c-\frac{\pi }{2}+d x\right )\right |2\right )}{3 d}-\frac{4 b c \cos (c+d x) \sqrt{\sin (c+d x)}}{3 d}-\frac{a c \cos (c+d x) \sin (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.276039, size = 137, normalized size = 0.93 \[ \frac{-16 b c \text{EllipticF}\left (\frac{1}{4} (-2 c-2 d x+\pi ),2\right )-12 a^2 \cos (c+d x)-48 a b E\left (\left .\frac{1}{4} (-2 c-2 d x+\pi )\right |2\right )+12 a c^2+12 a c d x-6 a c \sin (2 (c+d x))+12 b^2 c+12 b^2 d x-16 b c \sqrt{\sin (c+d x)} \cos (c+d x)-9 c^2 \cos (c+d x)+c^2 \cos (3 (c+d x))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 1.197, size = 266, normalized size = 1.8 \begin{align*}{b}^{2}x-{\frac{{a}^{2}\cos \left ( dx+c \right ) }{d}}-{\frac{{c}^{2} \left ( 2+ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \right ) \cos \left ( dx+c \right ) }{3\,d}}+2\,{\frac{ac \left ( -1/2\,\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) +1/2\,dx+c/2 \right ) }{d}}+{\frac{2\,b}{3\,d\cos \left ( dx+c \right ) } \left ( 3\,a\sqrt{\sin \left ( dx+c \right ) +1}\sqrt{-2\,\sin \left ( dx+c \right ) +2}\sqrt{-\sin \left ( dx+c \right ) }{\it EllipticF} \left ( \sqrt{\sin \left ( dx+c \right ) +1},1/2\,\sqrt{2} \right ) +\sqrt{\sin \left ( dx+c \right ) +1}\sqrt{-2\,\sin \left ( dx+c \right ) +2}\sqrt{-\sin \left ( dx+c \right ) }{\it EllipticF} \left ( \sqrt{\sin \left ( dx+c \right ) +1},{\frac{\sqrt{2}}{2}} \right ) c-6\,a\sqrt{\sin \left ( dx+c \right ) +1}\sqrt{-2\,\sin \left ( dx+c \right ) +2}\sqrt{-\sin \left ( dx+c \right ) }{\it EllipticE} \left ( \sqrt{\sin \left ( dx+c \right ) +1},1/2\,\sqrt{2} \right ) -2\, \left ( \cos \left ( dx+c \right ) \right ) ^{2}\sin \left ( dx+c \right ) c \right ){\frac{1}{\sqrt{\sin \left ( dx+c \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (-2 \, a c \cos \left (d x + c\right )^{2} + b^{2} + 2 \, a c -{\left (c^{2} \cos \left (d x + c\right )^{2} - a^{2} - c^{2}\right )} \sin \left (d x + c\right ) + 2 \,{\left (b c \sin \left (d x + c\right ) + a b\right )} \sqrt{\sin \left (d x + c\right )}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (c \sin \left (d x + c\right ) + a + \frac{b}{\sqrt{\sin \left (d x + c\right )}}\right )}^{2} \sin \left (d x + c\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]