\(\int \frac {(g+h x) \sqrt {a-a \sin (e+f x)}}{\sqrt {c+c \sin (e+f x)}} \, dx\) [179]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F(-2)]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 35, antiderivative size = 355 \[ \int \frac {(g+h x) \sqrt {a-a \sin (e+f x)}}{\sqrt {c+c \sin (e+f x)}} \, dx=-\frac {i a (g+h x)^2 \cos (e+f x)}{2 h \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {2 i a (g+h x) \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a (g+h x) \cos (e+f x) \log \left (1+e^{2 i (e+f x)}\right )}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (e+f x)}\right )}{2 f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \]

[Out]

-1/2*I*a*(h*x+g)^2*cos(f*x+e)/h/(a-a*sin(f*x+e))^(1/2)/(c+c*sin(f*x+e))^(1/2)-2*I*a*(h*x+g)*arctan(exp(I*(f*x+
e)))*cos(f*x+e)/f/(a-a*sin(f*x+e))^(1/2)/(c+c*sin(f*x+e))^(1/2)+a*(h*x+g)*cos(f*x+e)*ln(1+exp(2*I*(f*x+e)))/f/
(a-a*sin(f*x+e))^(1/2)/(c+c*sin(f*x+e))^(1/2)+I*a*h*cos(f*x+e)*polylog(2,-I*exp(I*(f*x+e)))/f^2/(a-a*sin(f*x+e
))^(1/2)/(c+c*sin(f*x+e))^(1/2)-I*a*h*cos(f*x+e)*polylog(2,I*exp(I*(f*x+e)))/f^2/(a-a*sin(f*x+e))^(1/2)/(c+c*s
in(f*x+e))^(1/2)-1/2*I*a*h*cos(f*x+e)*polylog(2,-exp(2*I*(f*x+e)))/f^2/(a-a*sin(f*x+e))^(1/2)/(c+c*sin(f*x+e))
^(1/2)

Rubi [A] (verified)

Time = 0.64 (sec) , antiderivative size = 355, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.257, Rules used = {4700, 6873, 12, 6874, 4266, 2317, 2438, 3800, 2221} \[ \int \frac {(g+h x) \sqrt {a-a \sin (e+f x)}}{\sqrt {c+c \sin (e+f x)}} \, dx=-\frac {2 i a (g+h x) \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}+\frac {i a h \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right ) \cos (e+f x)}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}-\frac {i a h \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right ) \cos (e+f x)}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}-\frac {i a h \operatorname {PolyLog}\left (2,-e^{2 i (e+f x)}\right ) \cos (e+f x)}{2 f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}-\frac {i a (g+h x)^2 \cos (e+f x)}{2 h \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}}+\frac {a (g+h x) \log \left (1+e^{2 i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c \sin (e+f x)+c}} \]

[In]

Int[((g + h*x)*Sqrt[a - a*Sin[e + f*x]])/Sqrt[c + c*Sin[e + f*x]],x]

[Out]

((-1/2*I)*a*(g + h*x)^2*Cos[e + f*x])/(h*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]]) - ((2*I)*a*(g + h*
x)*ArcTan[E^(I*(e + f*x))]*Cos[e + f*x])/(f*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]]) + (a*(g + h*x)*
Cos[e + f*x]*Log[1 + E^((2*I)*(e + f*x))])/(f*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]]) + (I*a*h*Cos[
e + f*x]*PolyLog[2, (-I)*E^(I*(e + f*x))])/(f^2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]]) - (I*a*h*Co
s[e + f*x]*PolyLog[2, I*E^(I*(e + f*x))])/(f^2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]]) - ((I/2)*a*h
*Cos[e + f*x]*PolyLog[2, -E^((2*I)*(e + f*x))])/(f^2*Sqrt[a - a*Sin[e + f*x]]*Sqrt[c + c*Sin[e + f*x]])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3800

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

Rule 4266

Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E
^(I*k*Pi)*E^(I*(e + f*x))]/f), x] + (-Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))],
 x], x] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e,
f}, x] && IntegerQ[2*k] && IGtQ[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]

Rule 6873

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \frac {\cos (e+f x) \int (g+h x) \sec (e+f x) (a-a \sin (e+f x)) \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {\cos (e+f x) \int a (g+h x) \sec (e+f x) (1-\sin (e+f x)) \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {(a \cos (e+f x)) \int (g+h x) \sec (e+f x) (1-\sin (e+f x)) \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {(a \cos (e+f x)) \int ((g+h x) \sec (e+f x)-(g+h x) \tan (e+f x)) \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = \frac {(a \cos (e+f x)) \int (g+h x) \sec (e+f x) \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a \cos (e+f x)) \int (g+h x) \tan (e+f x) \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {i a (g+h x)^2 \cos (e+f x)}{2 h \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {2 i a (g+h x) \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(2 i a \cos (e+f x)) \int \frac {e^{2 i (e+f x)} (g+h x)}{1+e^{2 i (e+f x)}} \, dx}{\sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a h \cos (e+f x)) \int \log \left (1-i e^{i (e+f x)}\right ) \, dx}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(a h \cos (e+f x)) \int \log \left (1+i e^{i (e+f x)}\right ) \, dx}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {i a (g+h x)^2 \cos (e+f x)}{2 h \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {2 i a (g+h x) \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a (g+h x) \cos (e+f x) \log \left (1+e^{2 i (e+f x)}\right )}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(i a h \cos (e+f x)) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(i a h \cos (e+f x)) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {(a h \cos (e+f x)) \int \log \left (1+e^{2 i (e+f x)}\right ) \, dx}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {i a (g+h x)^2 \cos (e+f x)}{2 h \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {2 i a (g+h x) \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a (g+h x) \cos (e+f x) \log \left (1+e^{2 i (e+f x)}\right )}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {(i a h \cos (e+f x)) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i (e+f x)}\right )}{2 f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ & = -\frac {i a (g+h x)^2 \cos (e+f x)}{2 h \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {2 i a (g+h x) \arctan \left (e^{i (e+f x)}\right ) \cos (e+f x)}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {a (g+h x) \cos (e+f x) \log \left (1+e^{2 i (e+f x)}\right )}{f \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}+\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,i e^{i (e+f x)}\right )}{f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}}-\frac {i a h \cos (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (e+f x)}\right )}{2 f^2 \sqrt {a-a \sin (e+f x)} \sqrt {c+c \sin (e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.03 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.43 \[ \int \frac {(g+h x) \sqrt {a-a \sin (e+f x)}}{\sqrt {c+c \sin (e+f x)}} \, dx=\frac {\left (i+e^{i (e+f x)}\right ) \left (f \left (f x (2 g+h x)-4 i (g+h x) \log \left (1+i e^{-i (e+f x)}\right )\right )+4 h \operatorname {PolyLog}\left (2,-i e^{-i (e+f x)}\right )\right ) \sqrt {a-a \sin (e+f x)}}{\sqrt {2} \left (-i+e^{i (e+f x)}\right ) \sqrt {-i c e^{-i (e+f x)} \left (i+e^{i (e+f x)}\right )^2} f^2} \]

[In]

Integrate[((g + h*x)*Sqrt[a - a*Sin[e + f*x]])/Sqrt[c + c*Sin[e + f*x]],x]

[Out]

((I + E^(I*(e + f*x)))*(f*(f*x*(2*g + h*x) - (4*I)*(g + h*x)*Log[1 + I/E^(I*(e + f*x))]) + 4*h*PolyLog[2, (-I)
/E^(I*(e + f*x))])*Sqrt[a - a*Sin[e + f*x]])/(Sqrt[2]*(-I + E^(I*(e + f*x)))*Sqrt[((-I)*c*(I + E^(I*(e + f*x))
)^2)/E^(I*(e + f*x))]*f^2)

Maple [F]

\[\int \frac {\left (h x +g \right ) \sqrt {a -\sin \left (f x +e \right ) a}}{\sqrt {c +c \sin \left (f x +e \right )}}d x\]

[In]

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

[Out]

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

Fricas [F(-2)]

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

[In]

integrate((h*x+g)*(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 \frac {(g+h x) \sqrt {a-a \sin (e+f x)}}{\sqrt {c+c \sin (e+f x)}} \, dx=\int \frac {\sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right )} \left (g + h x\right )}{\sqrt {c \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \]

[In]

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

[Out]

Integral(sqrt(-a*(sin(e + f*x) - 1))*(g + h*x)/sqrt(c*(sin(e + f*x) + 1)), x)

Maxima [F]

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

[In]

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

[Out]

integrate((h*x + g)*sqrt(-a*sin(f*x + e) + a)/sqrt(c*sin(f*x + e) + c), x)

Giac [F]

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

[In]

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

[Out]

integrate((h*x + g)*sqrt(-a*sin(f*x + e) + a)/sqrt(c*sin(f*x + e) + c), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {(g+h x) \sqrt {a-a \sin (e+f x)}}{\sqrt {c+c \sin (e+f x)}} \, dx=\int \frac {\left (g+h\,x\right )\,\sqrt {a-a\,\sin \left (e+f\,x\right )}}{\sqrt {c+c\,\sin \left (e+f\,x\right )}} \,d x \]

[In]

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

[Out]

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