3.506 \(\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\)

Optimal. Leaf size=137 \[ \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) \tanh ^{-1}\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}} \]

[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])

________________________________________________________________________________________

Rubi [A]  time = 0.198201, antiderivative size = 137, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.122, Rules used = {3290, 2735, 2660, 618, 206} \[ \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) \tanh ^{-1}\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}} \]

Antiderivative was successfully verified.

[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 3290

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]

Rule 2735

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 2660

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 618

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 206

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

Rubi steps

\begin{align*} \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 (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 ) \operatorname{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 ) \operatorname{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} \tanh ^{-1}\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]  time = 0.183296, size = 85, normalized size = 0.62 \[ \frac{(a \sin (d+e x)+b) \left (b (d+e x)-2 \sqrt{b^2-a^2} \tan ^{-1}\left (\frac{a+b \tan \left (\frac{1}{2} (d+e x)\right )}{\sqrt{b^2-a^2}}\right )\right )}{a e \sqrt{(a \sin (d+e x)+b)^2}} \]

Antiderivative was successfully verified.

[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 [A]  time = 0.164, size = 176, normalized size = 1.3 \begin{align*} -{\frac{b+a\sin \left ( ex+d \right ) }{ae} \left ( 2\,\arctan \left ({\frac{b\cos \left ( ex+d \right ) -a\sin \left ( ex+d \right ) -b}{\sin \left ( ex+d \right ) \sqrt{-{a}^{2}+{b}^{2}}}} \right ){a}^{2}-2\,\arctan \left ({\frac{b\cos \left ( ex+d \right ) -a\sin \left ( ex+d \right ) -b}{\sin \left ( ex+d \right ) \sqrt{-{a}^{2}+{b}^{2}}}} \right ){b}^{2}-b \left ( ex+d \right ) \sqrt{-{a}^{2}+{b}^{2}} \right ){\frac{1}{\sqrt{-{a}^{2}+{b}^{2}}}}{\frac{1}{\sqrt{-{a}^{2} \left ( \cos \left ( ex+d \right ) \right ) ^{2}+2\,ab\sin \left ( ex+d \right ) +{a}^{2}+{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

[Out]

-1/e/a/(-a^2+b^2)^(1/2)*(2*arctan((b*cos(e*x+d)-a*sin(e*x+d)-b)/sin(e*x+d)/(-a^2+b^2)^(1/2))*a^2-2*arctan((b*c
os(e*x+d)-a*sin(e*x+d)-b)/sin(e*x+d)/(-a^2+b^2)^(1/2))*b^2-b*(e*x+d)*(-a^2+b^2)^(1/2))*(b+a*sin(e*x+d))/(-a^2*
cos(e*x+d)^2+2*a*b*sin(e*x+d)+a^2+b^2)^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Fricas [A]  time = 1.88315, size = 462, normalized size = 3.37 \begin{align*} \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 ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.34954, size = 281, normalized size = 2.05 \begin{align*}{\left (\frac{{\left (x e - 2 \, \pi \left \lfloor \frac{x e + d}{2 \, \pi } + \frac{1}{2} \right \rfloor + d\right )} b}{a \mathrm{sgn}\left (b \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right )^{4} + 2 \, a \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right )^{3} + 2 \, b \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right )^{2} + 2 \, a \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right ) + b\right )} + \frac{2 \,{\left (a^{2} - b^{2}\right )} \arctan \left (\frac{b \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right ) + a}{\sqrt{-a^{2} + b^{2}}}\right )}{\sqrt{-a^{2} + b^{2}} a \mathrm{sgn}\left (b \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right )^{4} + 2 \, a \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right )^{3} + 2 \, b \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right )^{2} + 2 \, a \tan \left (\frac{1}{2} \, x e + \frac{1}{2} \, d\right ) + b\right )}\right )} e^{\left (-1\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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]

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