3.1288 \(\int \frac {\cos ^2(c+d x) \sin (c+d x)}{a+b \sin (c+d x)} \, dx\)

Optimal. Leaf size=100 \[ \frac {2 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^3 d}-\frac {x \left (2 a^2-b^2\right )}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2865, 2735, 2660, 618, 204} \[ \frac {2 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^3 d}-\frac {x \left (2 a^2-b^2\right )}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 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 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 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 2865

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> Simp[(g*(g*Cos[e + f*x])^(p - 1)*(a + b*Sin[e + f*x])^(m + 1)*(b*c*(m + p + 1) -
 a*d*p + b*d*(m + p)*Sin[e + f*x]))/(b^2*f*(m + p)*(m + p + 1)), x] + Dist[(g^2*(p - 1))/(b^2*(m + p)*(m + p +
 1)), Int[(g*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^m*Simp[b*(a*d*m + b*c*(m + p + 1)) + (a*b*c*(m + p + 1
) - d*(a^2*p - b^2*(m + p)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[a^2 - b^2,
0] && GtQ[p, 1] && NeQ[m + p, 0] && NeQ[m + p + 1, 0] && IntegerQ[2*m]

Rubi steps

\begin {align*} \int \frac {\cos ^2(c+d x) \sin (c+d x)}{a+b \sin (c+d x)} \, dx &=-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}+\frac {\int \frac {-a b-\left (2 a^2-b^2\right ) \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{2 b^2}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}+\frac {\left (a \left (a^2-b^2\right )\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{b^3}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}+\frac {\left (2 a \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^3 d}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}-\frac {\left (4 a \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^3 d}\\ &=-\frac {\left (2 a^2-b^2\right ) x}{2 b^3}+\frac {2 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^3 d}-\frac {\cos (c+d x) (2 a-b \sin (c+d x))}{2 b^2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.23, size = 104, normalized size = 1.04 \[ \frac {8 a \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )-4 a^2 c-4 a^2 d x-4 a b \cos (c+d x)+b^2 \sin (2 (c+d x))+2 b^2 c+2 b^2 d x}{4 b^3 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-4*a^2*c + 2*b^2*c - 4*a^2*d*x + 2*b^2*d*x + 8*a*Sqrt[a^2 - b^2]*ArcTan[(b + a*Tan[(c + d*x)/2])/Sqrt[a^2 - b
^2]] - 4*a*b*Cos[c + d*x] + b^2*Sin[2*(c + d*x)])/(4*b^3*d)

________________________________________________________________________________________

fricas [A]  time = 0.85, size = 275, normalized size = 2.75 \[ \left [\frac {b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (2 \, a^{2} - b^{2}\right )} d x - 2 \, a b \cos \left (d x + c\right ) + \sqrt {-a^{2} + b^{2}} a \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right )}{2 \, b^{3} d}, \frac {b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - {\left (2 \, a^{2} - b^{2}\right )} d x - 2 \, a b \cos \left (d x + c\right ) - 2 \, \sqrt {a^{2} - b^{2}} a \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right )}{2 \, b^{3} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.16, size = 159, normalized size = 1.59 \[ -\frac {\frac {{\left (2 \, a^{2} - b^{2}\right )} {\left (d x + c\right )}}{b^{3}} - \frac {4 \, {\left (a^{3} - a b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} b^{3}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} b^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [B]  time = 0.24, size = 214, normalized size = 2.14 \[ -\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{d b \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a}{d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d b \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {2 a}{d \,b^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}}{d \,b^{3}}+\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d b}+\frac {2 a \sqrt {a^{2}-b^{2}}\, \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{d \,b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*sin(d*x+c)/(a+b*sin(d*x+c)),x)

[Out]

-1/d/b/(1+tan(1/2*d*x+1/2*c)^2)^2*tan(1/2*d*x+1/2*c)^3-2/d/b^2/(1+tan(1/2*d*x+1/2*c)^2)^2*tan(1/2*d*x+1/2*c)^2
*a+1/d/b/(1+tan(1/2*d*x+1/2*c)^2)^2*tan(1/2*d*x+1/2*c)-2/d/b^2/(1+tan(1/2*d*x+1/2*c)^2)^2*a-2/d/b^3*arctan(tan
(1/2*d*x+1/2*c))*a^2+1/d/b*arctan(tan(1/2*d*x+1/2*c))+2/d*a*(a^2-b^2)^(1/2)/b^3*arctan(1/2*(2*a*tan(1/2*d*x+1/
2*c)+2*b)/(a^2-b^2)^(1/2))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*sin(d*x+c)/(a+b*sin(d*x+c)),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*b^2-4*a^2>0)', see `assume?`
 for more details)Is 4*b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 12.07, size = 190, normalized size = 1.90 \[ \frac {\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {\sin \left (2\,c+2\,d\,x\right )}{4}}{b\,d}-\frac {2\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^3\,d}-\frac {a\,\cos \left (c+d\,x\right )}{b^2\,d}-\frac {2\,a\,\mathrm {atanh}\left (\frac {-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{\sqrt {b^2-a^2}\,\left (a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}\right )\,\sqrt {b^2-a^2}}{b^3\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(c + d*x)^2*sin(c + d*x))/(a + b*sin(c + d*x)),x)

[Out]

(atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) + sin(2*c + 2*d*x)/4)/(b*d) - (2*a^2*atan(sin(c/2 + (d*x)/2)/cos(
c/2 + (d*x)/2)))/(b^3*d) - (a*cos(c + d*x))/(b^2*d) - (2*a*atanh((2*b^2*sin(c/2 + (d*x)/2) - a^2*sin(c/2 + (d*
x)/2) + a*b*cos(c/2 + (d*x)/2))/((b^2 - a^2)^(1/2)*(a*cos(c/2 + (d*x)/2) + 2*b*sin(c/2 + (d*x)/2))))*(b^2 - a^
2)^(1/2))/(b^3*d)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*sin(d*x+c)/(a+b*sin(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________