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

Optimal. Leaf size=24 \[ \frac {a \sin (c+d x)}{d}-\frac {b \cos (c+d x)}{d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2637, 2638} \[ \frac {a \sin (c+d x)}{d}-\frac {b \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 46, normalized size = 1.92 \[ \frac {a \sin (c) \cos (d x)}{d}+\frac {a \cos (c) \sin (d x)}{d}+\frac {b \sin (c) \sin (d x)}{d}-\frac {b \cos (c) \cos (d x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 23, normalized size = 0.96 \[ -\frac {b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.19, size = 24, normalized size = 1.00 \[ -\frac {b \cos \left (d x + c\right )}{d} + \frac {a \sin \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.13, size = 25, normalized size = 1.04 \[ -\frac {b \cos \left (d x +c \right )}{d}+\frac {a \sin \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 24, normalized size = 1.00 \[ -\frac {b \cos \left (d x + c\right )}{d} + \frac {a \sin \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.36, size = 38, normalized size = 1.58 \[ -\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 31, normalized size = 1.29 \[ a \left (\begin {cases} \frac {\sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \cos {\relax (c )} & \text {otherwise} \end {cases}\right ) + b \left (\begin {cases} - \frac {\cos {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \sin {\relax (c )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________