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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 41, antiderivative size = 137 \[ \int \frac {a+b \sin (d+e x)}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \, dx=\frac {b x (b+a \sin (d+e x))}{a \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}}-\frac {2 \sqrt {a^2-b^2} \text {arctanh}\left (\frac {a+b \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \sin (d+e x))}{a e \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \]

[Out]

b*x*(b+a*sin(e*x+d))/a/(b^2+2*a*b*sin(e*x+d)+a^2*sin(e*x+d)^2)^(1/2)-2*arctanh((a+b*tan(1/2*e*x+1/2*d))/(a^2-b
^2)^(1/2))*(b+a*sin(e*x+d))*(a^2-b^2)^(1/2)/a/e/(b^2+2*a*b*sin(e*x+d)+a^2*sin(e*x+d)^2)^(1/2)

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3371, 2814, 2739, 632, 212} \[ \int \frac {a+b \sin (d+e x)}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \, dx=\frac {b x (a \sin (d+e x)+b)}{a \sqrt {a^2 \sin ^2(d+e x)+2 a b \sin (d+e x)+b^2}}-\frac {2 \sqrt {a^2-b^2} (a \sin (d+e x)+b) \text {arctanh}\left (\frac {a+b \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a^2-b^2}}\right )}{a e \sqrt {a^2 \sin ^2(d+e x)+2 a b \sin (d+e x)+b^2}} \]

[In]

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

[Out]

(b*x*(b + a*Sin[d + e*x]))/(a*Sqrt[b^2 + 2*a*b*Sin[d + e*x] + a^2*Sin[d + e*x]^2]) - (2*Sqrt[a^2 - b^2]*ArcTan
h[(a + b*Tan[(d + e*x)/2])/Sqrt[a^2 - b^2]]*(b + a*Sin[d + e*x]))/(a*e*Sqrt[b^2 + 2*a*b*Sin[d + e*x] + a^2*Sin
[d + e*x]^2])

Rule 212

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] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2739

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[2*(e/d), Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2814

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

Rule 3371

Int[((A_) + (B_.)*sin[(d_.) + (e_.)*(x_)])*((a_) + (b_.)*sin[(d_.) + (e_.)*(x_)] + (c_.)*sin[(d_.) + (e_.)*(x_
)]^2)^(n_), x_Symbol] :> Dist[(a + b*Sin[d + e*x] + c*Sin[d + e*x]^2)^n/(b + 2*c*Sin[d + e*x])^(2*n), Int[(A +
 B*Sin[d + e*x])*(b + 2*c*Sin[d + e*x])^(2*n), x], x] /; FreeQ[{a, b, c, d, e, A, B}, x] && EqQ[b^2 - 4*a*c, 0
] &&  !IntegerQ[n]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (2 a b+2 a^2 \sin (d+e x)\right ) \int \frac {a+b \sin (d+e x)}{2 a b+2 a^2 \sin (d+e x)} \, dx}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \\ & = \frac {b x (b+a \sin (d+e x))}{a \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}}-\frac {\left (\left (-2 a^3+2 a b^2\right ) \left (2 a b+2 a^2 \sin (d+e x)\right )\right ) \int \frac {1}{2 a b+2 a^2 \sin (d+e x)} \, dx}{2 a^2 \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \\ & = \frac {b x (b+a \sin (d+e x))}{a \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}}-\frac {\left (\left (-2 a^3+2 a b^2\right ) \left (2 a b+2 a^2 \sin (d+e x)\right )\right ) \text {Subst}\left (\int \frac {1}{2 a b+4 a^2 x+2 a b x^2} \, dx,x,\tan \left (\frac {1}{2} (d+e x)\right )\right )}{a^2 e \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \\ & = \frac {b x (b+a \sin (d+e x))}{a \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}}+\frac {\left (2 \left (-2 a^3+2 a b^2\right ) \left (2 a b+2 a^2 \sin (d+e x)\right )\right ) \text {Subst}\left (\int \frac {1}{16 a^2 \left (a^2-b^2\right )-x^2} \, dx,x,4 a^2+4 a b \tan \left (\frac {1}{2} (d+e x)\right )\right )}{a^2 e \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \\ & = \frac {b x (b+a \sin (d+e x))}{a \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}}-\frac {2 \sqrt {a^2-b^2} \text {arctanh}\left (\frac {a+b \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \sin (d+e x))}{a e \sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.45 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.62 \[ \int \frac {a+b \sin (d+e x)}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \, dx=\frac {\left (b (d+e x)-2 \sqrt {-a^2+b^2} \arctan \left (\frac {a+b \tan \left (\frac {1}{2} (d+e x)\right )}{\sqrt {-a^2+b^2}}\right )\right ) (b+a \sin (d+e x))}{a e \sqrt {(b+a \sin (d+e x))^2}} \]

[In]

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

[Out]

((b*(d + e*x) - 2*Sqrt[-a^2 + b^2]*ArcTan[(a + b*Tan[(d + e*x)/2])/Sqrt[-a^2 + b^2]])*(b + a*Sin[d + e*x]))/(a
*e*Sqrt[(b + a*Sin[d + e*x])^2])

Maple [C] (warning: unable to verify)

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

Time = 2.05 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.64

method result size
default \(\frac {\operatorname {csgn}\left (b +a \sin \left (e x +d \right )\right ) \left (\frac {2 b \arctan \left (\tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )}{a}+\frac {2 \left (a^{2}-b^{2}\right ) \arctan \left (\frac {2 b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{a \sqrt {-a^{2}+b^{2}}}\right )}{e}\) \(88\)
parts \(-\frac {2 a \,\operatorname {csgn}\left (b +a \sin \left (e x +d \right )\right ) \arctan \left (\frac {\cot \left (e x +d \right ) b -b \csc \left (e x +d \right )-a}{\sqrt {-a^{2}+b^{2}}}\right )}{e \sqrt {-a^{2}+b^{2}}}+\frac {b \,\operatorname {csgn}\left (b +a \sin \left (e x +d \right )\right ) \left (2 b \arctan \left (\frac {\cot \left (e x +d \right ) b -b \csc \left (e x +d \right )-a}{\sqrt {-a^{2}+b^{2}}}\right )+\left (e x +d \right ) \sqrt {-a^{2}+b^{2}}\right )}{e a \sqrt {-a^{2}+b^{2}}}\) \(149\)

[In]

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

[Out]

csgn(b+a*sin(e*x+d))/e*(2*b/a*arctan(tan(1/2*e*x+1/2*d))+2*(a^2-b^2)/a/(-a^2+b^2)^(1/2)*arctan(1/2*(2*b*tan(1/
2*e*x+1/2*d)+2*a)/(-a^2+b^2)^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.49 \[ \int \frac {a+b \sin (d+e x)}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \, dx=\left [\frac {2 \, b e x + \sqrt {a^{2} - b^{2}} \log \left (-\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (e x + d\right )^{2} + 2 \, a b \sin \left (e x + d\right ) + a^{2} + b^{2} - 2 \, {\left (b \cos \left (e x + d\right ) \sin \left (e x + d\right ) + a \cos \left (e x + d\right )\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \left (e x + d\right )^{2} - 2 \, a b \sin \left (e x + d\right ) - a^{2} - b^{2}}\right )}{2 \, a e}, \frac {b e x - \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \left (e x + d\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (e x + d\right )}\right )}{a e}\right ] \]

[In]

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

[Out]

[1/2*(2*b*e*x + sqrt(a^2 - b^2)*log(-((a^2 - 2*b^2)*cos(e*x + d)^2 + 2*a*b*sin(e*x + d) + a^2 + b^2 - 2*(b*cos
(e*x + d)*sin(e*x + d) + a*cos(e*x + d))*sqrt(a^2 - b^2))/(a^2*cos(e*x + d)^2 - 2*a*b*sin(e*x + d) - a^2 - b^2
)))/(a*e), (b*e*x - sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*sin(e*x + d) + a)/((a^2 - b^2)*cos(e*x + d)))
)/(a*e)]

Sympy [F]

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

[In]

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

[Out]

Integral((a + b*sin(d + e*x))/sqrt((a*sin(d + e*x) + b)**2), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {a+b \sin (d+e x)}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \, dx=\text {Exception raised: ValueError} \]

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more de

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.80 \[ \int \frac {a+b \sin (d+e x)}{\sqrt {b^2+2 a b \sin (d+e x)+a^2 \sin ^2(d+e x)}} \, dx=\frac {\frac {{\left (e x + d\right )} b}{a \mathrm {sgn}\left (a \sin \left (e x + d\right ) + b\right )} + \frac {2 \, {\left (\pi \left \lfloor \frac {e x + d}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} {\left (a^{2} - b^{2}\right )}}{\sqrt {-a^{2} + b^{2}} a \mathrm {sgn}\left (a \sin \left (e x + d\right ) + b\right )}}{e} \]

[In]

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

[Out]

((e*x + d)*b/(a*sgn(a*sin(e*x + d) + b)) + 2*(pi*floor(1/2*(e*x + d)/pi + 1/2)*sgn(b) + arctan((b*tan(1/2*e*x
+ 1/2*d) + a)/sqrt(-a^2 + b^2)))*(a^2 - b^2)/(sqrt(-a^2 + b^2)*a*sgn(a*sin(e*x + d) + b)))/e

Mupad [F(-1)]

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

[In]

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

[Out]

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