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

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

Optimal result

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

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

Mathematica [C] (verified)

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

Time = 5.51 (sec) , antiderivative size = 871, normalized size of antiderivative = 8.30 \[ \int \frac {\sqrt {a+a \sin (e+f x)}}{(c+d \sin (e+f x))^2} \, dx =\text {Too large to display} \] Input:

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

Output:

((1/4 + I/4)*Sqrt[a*(1 + Sin[e + f*x])]*(((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*x - (2 - 2*I)*d*Sqrt[E^((-I)*e)]*Log[E^((I/2) 
*f*x) - #1] - I*Sqrt[d]*Sqrt[c + d]*f*x*#1 + 2*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) - ((2 - 2*I)*(Cos[(e + f*x)/2] - Sin[(e 
+ f*x)/2]))/((c + d)*f*(c + d*Sin[e + f*x]))))/(Cos[(e + f*x)/2] + Sin[...
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 105, 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.185, Rules used = {3042, 3251, 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}}{(c+d \sin (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3251

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3252

\(\displaystyle -\frac {a \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}}}{f (c+d)}-\frac {a \cos (e+f x)}{f (c+d) \sqrt {a \sin (e+f x)+a} (c+d \sin (e+f x))}\)

\(\Big \downarrow \) 221

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

Input:

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

Output:

-((Sqrt[a]*ArcTanh[(Sqrt[a]*Sqrt[d]*Cos[e + f*x])/(Sqrt[c + d]*Sqrt[a + a* 
Sin[e + f*x]])])/(Sqrt[d]*(c + d)^(3/2)*f)) - (a*Cos[e + f*x])/((c + d)*f* 
Sqrt[a + a*Sin[e + f*x]]*(c + d*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 3251
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((c_.) + (d_.)*sin[(e_.) + ( 
f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*c - a*d)*Cos[e + f*x]*((c + d*Sin[e 
+ f*x])^(n + 1)/(f*(n + 1)*(c^2 - d^2)*Sqrt[a + b*Sin[e + f*x]])), x] + Sim 
p[(2*n + 3)*((b*c - a*d)/(2*b*(n + 1)*(c^2 - d^2)))   Int[Sqrt[a + b*Sin[e 
+ f*x]]*(c + d*Sin[e + f*x])^(n + 1), 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] && LtQ[n, 
-1] && NeQ[2*n + 3, 0] && IntegerQ[2*n]
 

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]
 
Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.48

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

Input:

int((a+sin(f*x+e)*a)^(1/2)/(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 235 vs. \(2 (89) = 178\).

Time = 0.16 (sec) , antiderivative size = 786, normalized size of antiderivative = 7.49 \[ \int \frac {\sqrt {a+a \sin (e+f x)}}{(c+d \sin (e+f x))^2} \, dx =\text {Too large to display} \] Input:

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

Output:

[1/4*((d*cos(f*x + e)^2 - c*cos(f*x + e) - (d*cos(f*x + e) + c + d)*sin(f* 
x + e) - c - d)*sqrt(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)*cos(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*sqrt(a*sin(f*x + e) + a)*(cos(f*x + e) - sin(f*x + e) + 1))/((c*d + d^2) 
*f*cos(f*x + e)^2 - (c^2 + c*d)*f*cos(f*x + e) - (c^2 + 2*c*d + d^2)*f - ( 
(c*d + d^2)*f*cos(f*x + e) + (c^2 + 2*c*d + d^2)*f)*sin(f*x + e)), -1/2*(( 
d*cos(f*x + e)^2 - c*cos(f*x + e) - (d*cos(f*x + e) + c + d)*sin(f*x + e) 
- c - d)*sqrt(-a/(c*d + d^2))*arctan(1/2*sqrt(a*sin(f*x + e) + a)*(d*sin(f 
*x + e) - c - 2*d)*sqrt(-a/(c*d + d^2))/(a*cos(f*x + e))) - 2*sqrt(a*sin(f 
*x + e) + a)*(cos(f*x + e) - sin(f*x + e) + 1))/((c*d + d^2)*f*cos(f*x + e 
)^2 - (c^2 + c*d)*f*cos(f*x + e) - (c^2 + 2*c*d + d^2)*f - ((c*d + d^2)*f* 
cos(f*x + e) + (c^2 + 2*c*d + d^2)*f)*sin(f*x + e))]
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.28 \[ \int \frac {\sqrt {a+a \sin (e+f x)}}{(c+d \sin (e+f x))^2} \, dx=-\frac {\sqrt {2} \sqrt {a} {\left (\frac {\sqrt {2} \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 ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{\sqrt {-c d - d^{2}} {\left (c + d\right )}} + \frac {2 \, \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 )}{{\left (2 \, d \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c - d\right )} {\left (c + d\right )}}\right )}}{2 \, f} \] Input:

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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