\(\int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx\) [290]

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

Optimal result

Integrand size = 37, antiderivative size = 100 \[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx=\frac {2 \sqrt {a} (B c-A d) \text {arctanh}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a+a \sin (e+f x)}}\right )}{d^{3/2} \sqrt {c+d} f}-\frac {2 a B \cos (e+f x)}{d f \sqrt {a+a \sin (e+f x)}} \] Output:

2*a^(1/2)*(-A*d+B*c)*arctanh(a^(1/2)*d^(1/2)*cos(f*x+e)/(c+d)^(1/2)/(a+a*s 
in(f*x+e))^(1/2))/d^(3/2)/(c+d)^(1/2)/f-2*a*B*cos(f*x+e)/d/f/(a+a*sin(f*x+ 
e))^(1/2)
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.

Time = 11.79 (sec) , antiderivative size = 903, normalized size of antiderivative = 9.03 \[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx =\text {Too large to display} \] Input:

Integrate[(Sqrt[a + a*Sin[e + f*x]]*(A + B*Sin[e + f*x]))/(c + d*Sin[e + f 
*x]),x]
 

Output:

((1/2 + I/2)*(((-2 + 2*I)*B*Sqrt[d]*Cos[(f*x)/2]*(Cos[e/2] - Sin[e/2]))/f 
+ ((-(B*c) + A*d)*(Cos[e/2] + I*Sin[e/2])*((-1 + I)*x*Cos[e] + (RootSum[-d 
 + (2*I)*c*E^(I*e)*#1^2 + d*E^((2*I)*e)*#1^4 & , ((1 + I)*d*Sqrt[E^((-I)*e 
)]*f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cos[e] + Sin 
[e]))/(4*f)))/(Sqrt[c + d]*(Cos[e] + I*(-1 + Sin[e]))*Sqrt[Cos[e] - I*Sin[ 
e]]) + ((2 - 2*I)*B*Sqrt[d]*(Cos[e/2] + Sin[e/2])*Sin[(f*x)/2])/f)*Sqrt...
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.135, Rules used = {3042, 3460, 3042, 3252, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sqrt {a \sin (e+f x)+a} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sqrt {a \sin (e+f x)+a} (A+B \sin (e+f x))}{c+d \sin (e+f x)}dx\)

\(\Big \downarrow \) 3460

\(\displaystyle -\frac {(B c-A d) \int \frac {\sqrt {\sin (e+f x) a+a}}{c+d \sin (e+f x)}dx}{d}-\frac {2 a B \cos (e+f x)}{d f \sqrt {a \sin (e+f x)+a}}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {(B c-A d) \int \frac {\sqrt {\sin (e+f x) a+a}}{c+d \sin (e+f x)}dx}{d}-\frac {2 a B \cos (e+f x)}{d f \sqrt {a \sin (e+f x)+a}}\)

\(\Big \downarrow \) 3252

\(\displaystyle \frac {2 a (B c-A d) \int \frac {1}{a (c+d)-\frac {a^2 d \cos ^2(e+f x)}{\sin (e+f x) a+a}}d\frac {a \cos (e+f x)}{\sqrt {\sin (e+f x) a+a}}}{d f}-\frac {2 a B \cos (e+f x)}{d f \sqrt {a \sin (e+f x)+a}}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {2 \sqrt {a} (B c-A d) \text {arctanh}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a \sin (e+f x)+a}}\right )}{d^{3/2} f \sqrt {c+d}}-\frac {2 a B \cos (e+f x)}{d f \sqrt {a \sin (e+f x)+a}}\)

Input:

Int[(Sqrt[a + a*Sin[e + f*x]]*(A + B*Sin[e + f*x]))/(c + d*Sin[e + f*x]),x 
]
 

Output:

(2*Sqrt[a]*(B*c - A*d)*ArcTanh[(Sqrt[a]*Sqrt[d]*Cos[e + f*x])/(Sqrt[c + d] 
*Sqrt[a + a*Sin[e + f*x]])])/(d^(3/2)*Sqrt[c + d]*f) - (2*a*B*Cos[e + f*x] 
)/(d*f*Sqrt[a + a*Sin[e + f*x]])
 

Defintions of rubi rules used

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3252
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + ( 
f_.)*(x_)]), x_Symbol] :> Simp[-2*(b/f)   Subst[Int[1/(b*c + a*d - d*x^2), 
x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c, d, 
 e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
 

rule 3460
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((A_.) + (B_.)*sin[(e_.) + ( 
f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp 
[-2*b*B*Cos[e + f*x]*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(2*n + 3)*Sqrt[a + 
b*Sin[e + f*x]])), x] + Simp[(A*b*d*(2*n + 3) - B*(b*c - 2*a*d*(n + 1)))/(b 
*d*(2*n + 3))   Int[Sqrt[a + b*Sin[e + f*x]]*(c + d*Sin[e + f*x])^n, x], x] 
 /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - 
 b^2, 0] && NeQ[c^2 - d^2, 0] &&  !LtQ[n, -1]
 
Maple [A] (verified)

Time = 0.45 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.39

method result size
default \(-\frac {2 \left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (A \,\operatorname {arctanh}\left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, d}{\sqrt {\left (c +d \right ) a d}}\right ) a d -B \,\operatorname {arctanh}\left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, d}{\sqrt {\left (c +d \right ) a d}}\right ) a c +B \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {\left (c +d \right ) a d}\right )}{d \sqrt {\left (c +d \right ) a d}\, \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) \(139\)

Input:

int((a+a*sin(f*x+e))^(1/2)*(A+B*sin(f*x+e))/(c+d*sin(f*x+e)),x,method=_RET 
URNVERBOSE)
 

Output:

-2*(1+sin(f*x+e))*(-a*(sin(f*x+e)-1))^(1/2)*(A*arctanh((-a*(sin(f*x+e)-1)) 
^(1/2)*d/((c+d)*a*d)^(1/2))*a*d-B*arctanh((-a*(sin(f*x+e)-1))^(1/2)*d/((c+ 
d)*a*d)^(1/2))*a*c+B*(-a*(sin(f*x+e)-1))^(1/2)*((c+d)*a*d)^(1/2))/d/((c+d) 
*a*d)^(1/2)/cos(f*x+e)/(a+a*sin(f*x+e))^(1/2)/f
 

Fricas [A] (verification not implemented)

Time = 0.54 (sec) , antiderivative size = 651, normalized size of antiderivative = 6.51 \[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx =\text {Too large to display} \] Input:

integrate((a+a*sin(f*x+e))^(1/2)*(A+B*sin(f*x+e))/(c+d*sin(f*x+e)),x, algo 
rithm="fricas")
 

Output:

[-1/2*((B*c - A*d + (B*c - A*d)*cos(f*x + e) + (B*c - A*d)*sin(f*x + e))*s 
qrt(a/(c*d + d^2))*log((a*d^2*cos(f*x + e)^3 - a*c^2 - 2*a*c*d - a*d^2 - ( 
6*a*c*d + 7*a*d^2)*cos(f*x + e)^2 + 4*(c^2*d + 4*c*d^2 + 3*d^3 - (c*d^2 + 
d^3)*cos(f*x + e)^2 + (c^2*d + 3*c*d^2 + 2*d^3)*cos(f*x + e) - (c^2*d + 4* 
c*d^2 + 3*d^3 + (c*d^2 + d^3)*cos(f*x + e))*sin(f*x + e))*sqrt(a*sin(f*x + 
 e) + a)*sqrt(a/(c*d + d^2)) - (a*c^2 + 8*a*c*d + 9*a*d^2)*cos(f*x + e) + 
(a*d^2*cos(f*x + e)^2 - a*c^2 - 2*a*c*d - a*d^2 + 2*(3*a*c*d + 4*a*d^2)*co 
s(f*x + e))*sin(f*x + e))/(d^2*cos(f*x + e)^3 + (2*c*d + d^2)*cos(f*x + e) 
^2 - c^2 - 2*c*d - d^2 - (c^2 + d^2)*cos(f*x + e) + (d^2*cos(f*x + e)^2 - 
2*c*d*cos(f*x + e) - c^2 - 2*c*d - d^2)*sin(f*x + e))) + 4*(B*cos(f*x + e) 
 - B*sin(f*x + e) + B)*sqrt(a*sin(f*x + e) + a))/(d*f*cos(f*x + e) + d*f*s 
in(f*x + e) + d*f), ((B*c - A*d + (B*c - A*d)*cos(f*x + e) + (B*c - A*d)*s 
in(f*x + e))*sqrt(-a/(c*d + d^2))*arctan(1/2*sqrt(a*sin(f*x + e) + a)*(d*s 
in(f*x + e) - c - 2*d)*sqrt(-a/(c*d + d^2))/(a*cos(f*x + e))) - 2*(B*cos(f 
*x + e) - B*sin(f*x + e) + B)*sqrt(a*sin(f*x + e) + a))/(d*f*cos(f*x + e) 
+ d*f*sin(f*x + e) + d*f)]
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx=\text {Timed out} \] Input:

integrate((a+a*sin(f*x+e))**(1/2)*(A+B*sin(f*x+e))/(c+d*sin(f*x+e)),x)
 

Output:

Timed out
 

Maxima [F]

\[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx=\int { \frac {{\left (B \sin \left (f x + e\right ) + A\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{d \sin \left (f x + e\right ) + c} \,d x } \] Input:

integrate((a+a*sin(f*x+e))^(1/2)*(A+B*sin(f*x+e))/(c+d*sin(f*x+e)),x, algo 
rithm="maxima")
 

Output:

integrate((B*sin(f*x + e) + A)*sqrt(a*sin(f*x + e) + a)/(d*sin(f*x + e) + 
c), x)
 

Giac [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.25 \[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx=\frac {\sqrt {2} {\left (\frac {2 \, B \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{d} + \frac {\sqrt {2} {\left (B c \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) - A d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )\right )} \arctan \left (\frac {\sqrt {2} d \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c d - d^{2}}}\right )}{\sqrt {-c d - d^{2}} d}\right )} \sqrt {a}}{f} \] Input:

integrate((a+a*sin(f*x+e))^(1/2)*(A+B*sin(f*x+e))/(c+d*sin(f*x+e)),x, algo 
rithm="giac")
 

Output:

sqrt(2)*(2*B*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e))*sin(-1/4*pi + 1/2*f*x + 1 
/2*e)/d + sqrt(2)*(B*c*sgn(cos(-1/4*pi + 1/2*f*x + 1/2*e)) - A*d*sgn(cos(- 
1/4*pi + 1/2*f*x + 1/2*e)))*arctan(sqrt(2)*d*sin(-1/4*pi + 1/2*f*x + 1/2*e 
)/sqrt(-c*d - d^2))/(sqrt(-c*d - d^2)*d))*sqrt(a)/f
 

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx=\int \frac {\left (A+B\,\sin \left (e+f\,x\right )\right )\,\sqrt {a+a\,\sin \left (e+f\,x\right )}}{c+d\,\sin \left (e+f\,x\right )} \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{c+d \sin (e+f x)} \, dx=\sqrt {a}\, \left (\left (\int \frac {\sqrt {\sin \left (f x +e \right )+1}}{\sin \left (f x +e \right ) d +c}d x \right ) a +\left (\int \frac {\sqrt {\sin \left (f x +e \right )+1}\, \sin \left (f x +e \right )}{\sin \left (f x +e \right ) d +c}d x \right ) b \right ) \] Input:

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

Output:

sqrt(a)*(int(sqrt(sin(e + f*x) + 1)/(sin(e + f*x)*d + c),x)*a + int((sqrt( 
sin(e + f*x) + 1)*sin(e + f*x))/(sin(e + f*x)*d + c),x)*b)