\(\int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx\) [166]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F(-2)]
   Sympy [F]
   Maxima [F]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 33, antiderivative size = 118 \[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=\frac {2 x \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}{f^2}-\frac {2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \tan (e+f x)}{f^3}+\frac {x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \tan (e+f x)}{f} \]

[Out]

2*x*(a-a*sin(f*x+e))^(1/2)*(c+c*sin(f*x+e))^(1/2)/f^2-2*(a-a*sin(f*x+e))^(1/2)*(c+c*sin(f*x+e))^(1/2)*tan(f*x+
e)/f^3+x^2*(a-a*sin(f*x+e))^(1/2)*(c+c*sin(f*x+e))^(1/2)*tan(f*x+e)/f

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {4700, 3377, 2717} \[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=-\frac {2 \tan (e+f x) \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}{f^3}+\frac {2 x \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}{f^2}+\frac {x^2 \tan (e+f x) \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}{f} \]

[In]

Int[x^2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]],x]

[Out]

(2*x*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]])/f^2 - (2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f
*x]]*Tan[e + f*x])/f^3 + (x^2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]]*Tan[e + f*x])/f

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 4700

Int[((g_.) + (h_.)*(x_))^(p_.)*((a_) + (b_.)*Sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*Sin[(e_.) + (f_.)*(x_
)])^(n_), x_Symbol] :> Dist[a^IntPart[m]*c^IntPart[m]*(a + b*Sin[e + f*x])^FracPart[m]*((c + d*Sin[e + f*x])^F
racPart[m]/Cos[e + f*x]^(2*FracPart[m])), Int[(g + h*x)^p*Cos[e + f*x]^(2*m)*(c + d*Sin[e + f*x])^(n - m), x],
 x] /; FreeQ[{a, b, c, d, e, f, g, h}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[p] && IntegerQ
[2*m] && IGeQ[n - m, 0]

Rubi steps \begin{align*} \text {integral}& = \left (\sec (e+f x) \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}\right ) \int x^2 \cos (e+f x) \, dx \\ & = \frac {x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \tan (e+f x)}{f}-\frac {\left (2 \sec (e+f x) \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}\right ) \int x \sin (e+f x) \, dx}{f} \\ & = \frac {2 x \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}{f^2}+\frac {x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \tan (e+f x)}{f}-\frac {\left (2 \sec (e+f x) \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}\right ) \int \cos (e+f x) \, dx}{f^2} \\ & = \frac {2 x \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}{f^2}-\frac {2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \tan (e+f x)}{f^3}+\frac {x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \tan (e+f x)}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.51 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.46 \[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=\frac {\sqrt {c (1+\sin (e+f x))} \sqrt {a-a \sin (e+f x)} \left (2 f x+\left (-2+f^2 x^2\right ) \tan (e+f x)\right )}{f^3} \]

[In]

Integrate[x^2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]],x]

[Out]

(Sqrt[c*(1 + Sin[e + f*x])]*Sqrt[a - a*Sin[e + f*x]]*(2*f*x + (-2 + f^2*x^2)*Tan[e + f*x]))/f^3

Maple [F]

\[\int x^{2} \sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {c +c \sin \left (f x +e \right )}d x\]

[In]

int(x^2*(a-sin(f*x+e)*a)^(1/2)*(c+c*sin(f*x+e))^(1/2),x)

[Out]

int(x^2*(a-sin(f*x+e)*a)^(1/2)*(c+c*sin(f*x+e))^(1/2),x)

Fricas [F(-2)]

Exception generated. \[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=\text {Exception raised: TypeError} \]

[In]

integrate(x^2*(a-a*sin(f*x+e))^(1/2)*(c+c*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

Exception raised: TypeError >>  Error detected within library code:   integrate: implementation incomplete (ha
s polynomial part)

Sympy [F]

\[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=\int x^{2} \sqrt {c \left (\sin {\left (e + f x \right )} + 1\right )} \sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right )}\, dx \]

[In]

integrate(x**2*(a-a*sin(f*x+e))**(1/2)*(c+c*sin(f*x+e))**(1/2),x)

[Out]

Integral(x**2*sqrt(c*(sin(e + f*x) + 1))*sqrt(-a*(sin(e + f*x) - 1)), x)

Maxima [F]

\[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=\int { \sqrt {-a \sin \left (f x + e\right ) + a} \sqrt {c \sin \left (f x + e\right ) + c} x^{2} \,d x } \]

[In]

integrate(x^2*(a-a*sin(f*x+e))^(1/2)*(c+c*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(-a*sin(f*x + e) + a)*sqrt(c*sin(f*x + e) + c)*x^2, x)

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.01 \[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=-{\left (\frac {2 \, x \cos \left (f x + e\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{f^{2}} + \frac {{\left (f^{2} x^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) - 2 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )\right )} \sin \left (f x + e\right )}{f^{3}}\right )} \sqrt {a} \sqrt {c} \]

[In]

integrate(x^2*(a-a*sin(f*x+e))^(1/2)*(c+c*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

-(2*x*cos(f*x + e)*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))/f^2 + (f^2*x^2*sgn(
cos(-1/4*pi + 1/2*f*x + 1/2*e))*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e)) - 2*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sg
n(sin(-1/4*pi + 1/2*f*x + 1/2*e)))*sin(f*x + e)/f^3)*sqrt(a)*sqrt(c)

Mupad [B] (verification not implemented)

Time = 27.42 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.73 \[ \int x^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)} \, dx=\frac {\sqrt {-a\,\left (\sin \left (e+f\,x\right )-1\right )}\,\sqrt {c\,\left (\sin \left (e+f\,x\right )+1\right )}\,\left (2\,f\,x-2\,\sin \left (2\,e+2\,f\,x\right )+2\,f\,x\,\left (2\,{\cos \left (e+f\,x\right )}^2-1\right )+f^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )\right )}{2\,f^3\,{\cos \left (e+f\,x\right )}^2} \]

[In]

int(x^2*(a - a*sin(e + f*x))^(1/2)*(c + c*sin(e + f*x))^(1/2),x)

[Out]

((-a*(sin(e + f*x) - 1))^(1/2)*(c*(sin(e + f*x) + 1))^(1/2)*(2*f*x - 2*sin(2*e + 2*f*x) + 2*f*x*(2*cos(e + f*x
)^2 - 1) + f^2*x^2*sin(2*e + 2*f*x)))/(2*f^3*cos(e + f*x)^2)