3.569 \(\int (a+b \cos (c+d x) \sin (c+d x)) \, dx\)

Optimal. Leaf size=20 \[ a x+\frac{b \sin ^2(c+d x)}{2 d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0155313, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {2564, 30} \[ a x+\frac{b \sin ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[a + b*Cos[c + d*x]*Sin[c + d*x],x]

[Out]

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

Rule 2564

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int (a+b \cos (c+d x) \sin (c+d x)) \, dx &=a x+b \int \cos (c+d x) \sin (c+d x) \, dx\\ &=a x+\frac{b \operatorname{Subst}(\int x \, dx,x,\sin (c+d x))}{d}\\ &=a x+\frac{b \sin ^2(c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0080549, size = 38, normalized size = 1.9 \[ a x+\frac{b \sin (2 c) \sin (2 d x)}{4 d}-\frac{b \cos (2 c) \cos (2 d x)}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Cos[c + d*x]*Sin[c + d*x],x]

[Out]

a*x - (b*Cos[2*c]*Cos[2*d*x])/(4*d) + (b*Sin[2*c]*Sin[2*d*x])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 19, normalized size = 1. \begin{align*} ax+{\frac{b \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*x+1/2*b*sin(d*x+c)^2/d

________________________________________________________________________________________

Maxima [A]  time = 1.00264, size = 24, normalized size = 1.2 \begin{align*} a x - \frac{b \cos \left (d x + c\right )^{2}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*cos(d*x+c)*sin(d*x+c),x, algorithm="maxima")

[Out]

a*x - 1/2*b*cos(d*x + c)^2/d

________________________________________________________________________________________

Fricas [A]  time = 2.30785, size = 49, normalized size = 2.45 \begin{align*} \frac{2 \, a d x - b \cos \left (d x + c\right )^{2}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(2*a*d*x - b*cos(d*x + c)^2)/d

________________________________________________________________________________________

Sympy [A]  time = 0.199445, size = 24, normalized size = 1.2 \begin{align*} a x + b \left (\begin{cases} \frac{\sin ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \sin{\left (c \right )} \cos{\left (c \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*x + b*Piecewise((sin(c + d*x)**2/(2*d), Ne(d, 0)), (x*sin(c)*cos(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.12474, size = 24, normalized size = 1.2 \begin{align*} a x + \frac{b \sin \left (d x + c\right )^{2}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*x + 1/2*b*sin(d*x + c)^2/d