Integrand size = 33, antiderivative size = 280 \[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=-\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \cos (e+f x) \log (\cos (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \]
[Out]
Time = 2.57 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.00, number of steps used = 34, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.424, Rules used = {4700, 6873, 12, 6874, 4271, 3855, 4266, 2611, 2320, 6724, 3842, 4269, 3556, 4498} \[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=\frac {2 a \cos (e+f x) \text {arctanh}(\sin (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}+\frac {2 a \cos (e+f x) \log (\cos (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}-\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}} \]
[In]
[Out]
Rule 12
Rule 2320
Rule 2611
Rule 3556
Rule 3842
Rule 3855
Rule 4266
Rule 4269
Rule 4271
Rule 4498
Rule 4700
Rule 6724
Rule 6873
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \frac {\cos (e+f x) \int x^2 \sec ^3(e+f x) (a-a \sin (e+f x))^2 \, dx}{a c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {\cos (e+f x) \int a^2 x^2 \sec ^3(e+f x) (1-\sin (e+f x))^2 \, dx}{a c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {(a \cos (e+f x)) \int x^2 \sec ^3(e+f x) (1-\sin (e+f x))^2 \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {(a \cos (e+f x)) \int \left (x^2 \sec ^3(e+f x)-2 x^2 \sec ^2(e+f x) \tan (e+f x)+x^2 \sec (e+f x) \tan ^2(e+f x)\right ) \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {(a \cos (e+f x)) \int x^2 \sec ^3(e+f x) \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int x^2 \sec (e+f x) \tan ^2(e+f x) \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(2 a \cos (e+f x)) \int x^2 \sec ^2(e+f x) \tan (e+f x) \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{2 c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int x^2 \sec (e+f x) \, dx}{2 c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a \cos (e+f x)) \int x^2 \sec (e+f x) \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int x^2 \sec ^3(e+f x) \, dx}{c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int \sec (e+f x) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(2 a \cos (e+f x)) \int x \sec ^2(e+f x) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {i a x^2 \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int x^2 \sec (e+f x) \, dx}{2 c \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int \sec (e+f x) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(2 a \cos (e+f x)) \int \tan (e+f x) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a \cos (e+f x)) \int x \log \left (1-i e^{i (e+f x)}\right ) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int x \log \left (1+i e^{i (e+f x)}\right ) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(2 a \cos (e+f x)) \int x \log \left (1-i e^{i (e+f x)}\right ) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(2 a \cos (e+f x)) \int x \log \left (1+i e^{i (e+f x)}\right ) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \cos (e+f x) \log (\cos (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {i a x \cos (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {i a x \cos (e+f x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(i a \cos (e+f x)) \int \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right ) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(i a \cos (e+f x)) \int \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right ) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(2 i a \cos (e+f x)) \int \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right ) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(2 i a \cos (e+f x)) \int \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right ) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a \cos (e+f x)) \int x \log \left (1-i e^{i (e+f x)}\right ) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \int x \log \left (1+i e^{i (e+f x)}\right ) \, dx}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \cos (e+f x) \log (\cos (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a \cos (e+f x)) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(2 a \cos (e+f x)) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(2 a \cos (e+f x)) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(i a \cos (e+f x)) \int \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right ) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(i a \cos (e+f x)) \int \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right ) \, dx}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \cos (e+f x) \log (\cos (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a \cos (e+f x) \operatorname {PolyLog}\left (3,-i e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a \cos (e+f x) \operatorname {PolyLog}\left (3,i e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a \cos (e+f x)) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a \cos (e+f x)) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {2 a x}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \text {arctanh}(\sin (e+f x)) \cos (e+f x)}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a \cos (e+f x) \log (\cos (e+f x))}{c f^3 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {a x^2 \sec (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {2 a x \sin (e+f x)}{c f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a x^2 \tan (e+f x)}{c f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.90 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.55 \[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=-\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sqrt {a-a \sin (e+f x)} \left (2 i f x+f^2 x^2+2 f x \cos (e+f x)-4 \log \left (i+e^{i (e+f x)}\right )+\left (2 i f x-4 \log \left (i+e^{i (e+f x)}\right )\right ) \sin (e+f x)\right )}{f^3 \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) (c (1+\sin (e+f x)))^{3/2}} \]
[In]
[Out]
\[\int \frac {x^{2} \sqrt {a -\sin \left (f x +e \right ) a}}{\left (c +c \sin \left (f x +e \right )\right )^{\frac {3}{2}}}d x\]
[In]
[Out]
Exception generated. \[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
\[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=\int \frac {x^{2} \sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right )}}{\left (c \left (\sin {\left (e + f x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \]
[In]
[Out]
\[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=\int { \frac {\sqrt {-a \sin \left (f x + e\right ) + a} x^{2}}{{\left (c \sin \left (f x + e\right ) + c\right )}^{\frac {3}{2}}} \,d x } \]
[In]
[Out]
\[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=\int { \frac {\sqrt {-a \sin \left (f x + e\right ) + a} x^{2}}{{\left (c \sin \left (f x + e\right ) + c\right )}^{\frac {3}{2}}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {x^2 \sqrt {a-a \sin (e+f x)}}{(c+c \sin (e+f x))^{3/2}} \, dx=\int \frac {x^2\,\sqrt {a-a\,\sin \left (e+f\,x\right )}}{{\left (c+c\,\sin \left (e+f\,x\right )\right )}^{3/2}} \,d x \]
[In]
[Out]