\(\int (a+b \cos (c+d x) \sin (c+d x)) \, dx\) [569]

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

Optimal result

Integrand size = 16, antiderivative size = 20 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=a x+\frac {b \sin ^2(c+d x)}{2 d} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2644, 30} \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=a x+\frac {b \sin ^2(c+d x)}{2 d} \]

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

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

Rule 2644

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

Rubi steps \begin{align*} \text {integral}& = a x+b \int \cos (c+d x) \sin (c+d x) \, dx \\ & = a x+\frac {b \text {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] (verified)

Time = 0.00 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.90 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=a x-\frac {b \cos (2 c) \cos (2 d x)}{4 d}+\frac {b \sin (2 c) \sin (2 d x)}{4 d} \]

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

Time = 0.58 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.95

method result size
default \(a x +\frac {b \sin \left (d x +c \right )^{2}}{2 d}\) \(19\)
parts \(a x +\frac {b \sin \left (d x +c \right )^{2}}{2 d}\) \(19\)
risch \(a x -\frac {b \cos \left (2 d x +2 c \right )}{4 d}\) \(20\)
derivativedivides \(\frac {\left (d x +c \right ) a +\frac {b \sin \left (d x +c \right )^{2}}{2}}{d}\) \(24\)
parallelrisch \(\frac {b \left (1-\cos \left (2 d x +2 c \right )\right )}{4 d}+a x\) \(24\)
norman \(\frac {a x +a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+2 a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}\) \(67\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.10 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=\frac {2 \, a d x - b \cos \left (d x + c\right )^{2}}{2 \, d} \]

[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] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.30 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=a x + b \left (\begin {cases} - \frac {\cos ^{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 ) \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.90 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=a x - \frac {b \cos \left (d x + c\right )^{2}}{2 \, d} \]

[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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.90 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=a x + \frac {b \sin \left (d x + c\right )^{2}}{2 \, d} \]

[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

Mupad [B] (verification not implemented)

Time = 26.77 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.10 \[ \int (a+b \cos (c+d x) \sin (c+d x)) \, dx=-\frac {\frac {b\,{\cos \left (c+d\,x\right )}^2}{2}-a\,d\,x}{d} \]

[In]

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

[Out]

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