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

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

Optimal result

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

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.34 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.34 \[ \int \frac {c+d \sin (e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=\frac {2 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left ((1+i) (-1)^{3/4} (c-d) \text {arctanh}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right )+d \left (-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{f \sqrt {a (1+\sin (e+f x))}} \] Input:

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

Output:

(2*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*((1 + I)*(-1)^(3/4)*(c - d)*ArcTa 
nh[(1/2 + I/2)*(-1)^(3/4)*(-1 + Tan[(e + f*x)/4])] + d*(-Cos[(e + f*x)/2] 
+ Sin[(e + f*x)/2])))/(f*Sqrt[a*(1 + Sin[e + f*x])])
 

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 79, 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.200, Rules used = {3042, 3230, 3042, 3128, 219}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3230

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3128

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

\(\Big \downarrow \) 219

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

Input:

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

Output:

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

Defintions of rubi rules used

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

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

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

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

Time = 2.67 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.62

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 (\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right ) c -\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right ) d +2 \sqrt {a -\sin \left (f x +e \right ) a}\, d \right )}{a \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) \(128\)
parts \(-\frac {c \left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{\sqrt {a}\, \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}+\frac {d \left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (-1+\sin \left (f x +e \right )\right )}\, \left (\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a -\sin \left (f x +e \right ) a}\, \sqrt {2}}{2 \sqrt {a}}\right )-2 \sqrt {a -\sin \left (f x +e \right ) a}\right )}{a \cos \left (f x +e \right ) \sqrt {a +\sin \left (f x +e \right ) a}\, f}\) \(171\)
risch \(-\frac {\left (-2 i c +i d +d \,{\mathrm e}^{i \left (f x +e \right )}\right ) \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) \sqrt {2}\, {\mathrm e}^{-i \left (f x +e \right )}}{f \sqrt {-a \left (i {\mathrm e}^{2 i \left (f x +e \right )}-i-2 \,{\mathrm e}^{i \left (f x +e \right )}\right ) {\mathrm e}^{-i \left (f x +e \right )}}}-\frac {2 i \left (c -d \right ) \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) \left (\arctan \left (\frac {\sqrt {-i a \,{\mathrm e}^{i \left (f x +e \right )}}}{\sqrt {a}}\right ) a \sqrt {-i a \,{\mathrm e}^{i \left (f x +e \right )}}+a^{\frac {3}{2}}\right ) \sqrt {2}\, {\mathrm e}^{-i \left (f x +e \right )}}{f \,a^{\frac {3}{2}} \sqrt {-a \left (i {\mathrm e}^{2 i \left (f x +e \right )}-i-2 \,{\mathrm e}^{i \left (f x +e \right )}\right ) {\mathrm e}^{-i \left (f x +e \right )}}}\) \(222\)

Input:

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

Output:

-(1+sin(f*x+e))*(-a*(-1+sin(f*x+e)))^(1/2)*(a^(1/2)*2^(1/2)*arctanh(1/2*(a 
-sin(f*x+e)*a)^(1/2)*2^(1/2)/a^(1/2))*c-a^(1/2)*2^(1/2)*arctanh(1/2*(a-sin 
(f*x+e)*a)^(1/2)*2^(1/2)/a^(1/2))*d+2*(a-sin(f*x+e)*a)^(1/2)*d)/a/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. 214 vs. \(2 (68) = 136\).

Time = 0.08 (sec) , antiderivative size = 214, normalized size of antiderivative = 2.71 \[ \int \frac {c+d \sin (e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=-\frac {\frac {\sqrt {2} {\left (a c - a d + {\left (a c - a d\right )} \cos \left (f x + e\right ) + {\left (a c - a d\right )} \sin \left (f x + e\right )\right )} \log \left (-\frac {\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) + \frac {2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {a}} + 4 \, {\left (d \cos \left (f x + e\right ) - d \sin \left (f x + e\right ) + d\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{2 \, {\left (a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f\right )}} \] Input:

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

Output:

-1/2*(sqrt(2)*(a*c - a*d + (a*c - a*d)*cos(f*x + e) + (a*c - a*d)*sin(f*x 
+ e))*log(-(cos(f*x + e)^2 - (cos(f*x + e) - 2)*sin(f*x + e) + 2*sqrt(2)*s 
qrt(a*sin(f*x + e) + a)*(cos(f*x + e) - sin(f*x + e) + 1)/sqrt(a) + 3*cos( 
f*x + e) + 2)/(cos(f*x + e)^2 - (cos(f*x + e) + 2)*sin(f*x + e) - cos(f*x 
+ e) - 2))/sqrt(a) + 4*(d*cos(f*x + e) - d*sin(f*x + e) + d)*sqrt(a*sin(f* 
x + e) + a))/(a*f*cos(f*x + e) + a*f*sin(f*x + e) + a*f)
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F(-2)]

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

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const 
index_m & i,const vecteur & l) Error: Bad Argument Value
 

Mupad [B] (verification not implemented)

Time = 17.83 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.91 \[ \int \frac {c+d \sin (e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx=-\frac {c\,\mathrm {F}\left (\frac {\pi }{4}-\frac {e}{2}-\frac {f\,x}{2}\middle |1\right )\,\sqrt {\frac {2\,\left (a+a\,\sin \left (e+f\,x\right )\right )}{a}}}{f\,\sqrt {a+a\,\sin \left (e+f\,x\right )}}-\frac {d\,\left (4\,\mathrm {E}\left (\mathrm {asin}\left (\frac {\sqrt {2}\,\sqrt {1-\sin \left (e+f\,x\right )}}{2}\right )\middle |1\right )-2\,\mathrm {F}\left (\mathrm {asin}\left (\frac {\sqrt {2}\,\sqrt {1-\sin \left (e+f\,x\right )}}{2}\right )\middle |1\right )\right )\,\sqrt {{\cos \left (e+f\,x\right )}^2}\,\sqrt {\frac {a+a\,\sin \left (e+f\,x\right )}{2\,a}}}{f\,\cos \left (e+f\,x\right )\,\sqrt {a+a\,\sin \left (e+f\,x\right )}} \] Input:

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

Output:

- (c*ellipticF(pi/4 - e/2 - (f*x)/2, 1)*((2*(a + a*sin(e + f*x)))/a)^(1/2) 
)/(f*(a + a*sin(e + f*x))^(1/2)) - (d*(4*ellipticE(asin((2^(1/2)*(1 - sin( 
e + f*x))^(1/2))/2), 1) - 2*ellipticF(asin((2^(1/2)*(1 - sin(e + f*x))^(1/ 
2))/2), 1))*(cos(e + f*x)^2)^(1/2)*((a + a*sin(e + f*x))/(2*a))^(1/2))/(f* 
cos(e + f*x)*(a + a*sin(e + f*x))^(1/2))
 

Reduce [F]

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

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

Output:

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