\(\int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx\) [430]

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

Optimal result

Integrand size = 19, antiderivative size = 121 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {3}{8} b \left (4 a^2+b^2\right ) x+\frac {a \left (a^2+4 b^2\right ) \sin (c+d x)}{2 d}+\frac {b \left (2 a^2+3 b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (a+b \cos (c+d x))^2 \sin (c+d x)}{4 d}+\frac {(a+b \cos (c+d x))^3 \sin (c+d x)}{4 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.56 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.83 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {8 a \left (4 a^2+9 b^2\right ) \sin (c+d x)+b \left (48 a^2 c+12 b^2 c+48 a^2 d x+12 b^2 d x+8 \left (3 a^2+b^2\right ) \sin (2 (c+d x))+8 a b \sin (3 (c+d x))+b^2 \sin (4 (c+d x))\right )}{32 d} \] Input:

Integrate[Cos[c + d*x]*(a + b*Cos[c + d*x])^3,x]
 

Output:

(8*a*(4*a^2 + 9*b^2)*Sin[c + d*x] + b*(48*a^2*c + 12*b^2*c + 48*a^2*d*x + 
12*b^2*d*x + 8*(3*a^2 + b^2)*Sin[2*(c + d*x)] + 8*a*b*Sin[3*(c + d*x)] + b 
^2*Sin[4*(c + d*x)]))/(32*d)
 

Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.07, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3042, 3232, 27, 3042, 3232, 3042, 3213}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^3dx\)

\(\Big \downarrow \) 3232

\(\displaystyle \frac {1}{4} \int 3 (b+a \cos (c+d x)) (a+b \cos (c+d x))^2dx+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {3}{4} \int (b+a \cos (c+d x)) (a+b \cos (c+d x))^2dx+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {3}{4} \int \left (b+a \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2dx+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 3232

\(\displaystyle \frac {3}{4} \left (\frac {1}{3} \int (a+b \cos (c+d x)) \left (5 a b+\left (2 a^2+3 b^2\right ) \cos (c+d x)\right )dx+\frac {a \sin (c+d x) (a+b \cos (c+d x))^2}{3 d}\right )+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {3}{4} \left (\frac {1}{3} \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (5 a b+\left (2 a^2+3 b^2\right ) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {a \sin (c+d x) (a+b \cos (c+d x))^2}{3 d}\right )+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\)

\(\Big \downarrow \) 3213

\(\displaystyle \frac {3}{4} \left (\frac {1}{3} \left (\frac {2 a \left (a^2+4 b^2\right ) \sin (c+d x)}{d}+\frac {b \left (2 a^2+3 b^2\right ) \sin (c+d x) \cos (c+d x)}{2 d}+\frac {3}{2} b x \left (4 a^2+b^2\right )\right )+\frac {a \sin (c+d x) (a+b \cos (c+d x))^2}{3 d}\right )+\frac {\sin (c+d x) (a+b \cos (c+d x))^3}{4 d}\)

Input:

Int[Cos[c + d*x]*(a + b*Cos[c + d*x])^3,x]
 

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3213
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co 
s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free 
Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
 

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

Time = 10.06 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.84

method result size
derivativedivides \(\frac {\sin \left (d x +c \right ) a^{3}+3 a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} a \left (\cos \left (d x +c \right )^{2}+2\right ) \sin \left (d x +c \right )+b^{3} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(102\)
default \(\frac {\sin \left (d x +c \right ) a^{3}+3 a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+b^{2} a \left (\cos \left (d x +c \right )^{2}+2\right ) \sin \left (d x +c \right )+b^{3} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(102\)
parallelrisch \(\frac {48 a^{2} b d x +12 b^{3} d x +32 \sin \left (d x +c \right ) a^{3}+72 \sin \left (d x +c \right ) a \,b^{2}+\sin \left (4 d x +4 c \right ) b^{3}+8 \sin \left (3 d x +3 c \right ) a \,b^{2}+24 \sin \left (2 d x +2 c \right ) a^{2} b +8 \sin \left (2 d x +2 c \right ) b^{3}}{32 d}\) \(102\)
parts \(\frac {a^{3} \sin \left (d x +c \right )}{d}+\frac {b^{3} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {b^{2} a \left (\cos \left (d x +c \right )^{2}+2\right ) \sin \left (d x +c \right )}{d}+\frac {3 a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(110\)
risch \(\frac {3 a^{2} b x}{2}+\frac {3 b^{3} x}{8}+\frac {a^{3} \sin \left (d x +c \right )}{d}+\frac {9 a \,b^{2} \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (4 d x +4 c \right ) b^{3}}{32 d}+\frac {\sin \left (3 d x +3 c \right ) b^{2} a}{4 d}+\frac {3 \sin \left (2 d x +2 c \right ) a^{2} b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) b^{3}}{4 d}\) \(113\)
norman \(\frac {\left (\frac {3}{8} b^{3}+\frac {3}{2} a^{2} b \right ) x +\left (\frac {3}{2} b^{3}+6 a^{2} b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{2} b^{3}+6 a^{2} b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (\frac {3}{8} b^{3}+\frac {3}{2} a^{2} b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {9}{4} b^{3}+9 a^{2} b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {\left (8 a^{3}-12 a^{2} b +24 b^{2} a -5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}+\frac {\left (8 a^{3}+12 a^{2} b +24 b^{2} a +5 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (24 a^{3}-12 a^{2} b +40 b^{2} a +3 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}+\frac {\left (24 a^{3}+12 a^{2} b +40 b^{2} a -3 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) \(286\)
orering \(\text {Expression too large to display}\) \(1220\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.69 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {3 \, {\left (4 \, a^{2} b + b^{3}\right )} d x + {\left (2 \, b^{3} \cos \left (d x + c\right )^{3} + 8 \, a b^{2} \cos \left (d x + c\right )^{2} + 8 \, a^{3} + 16 \, a b^{2} + 3 \, {\left (4 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \] Input:

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

Output:

1/8*(3*(4*a^2*b + b^3)*d*x + (2*b^3*cos(d*x + c)^3 + 8*a*b^2*cos(d*x + c)^ 
2 + 8*a^3 + 16*a*b^2 + 3*(4*a^2*b + b^3)*cos(d*x + c))*sin(d*x + c))/d
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 233 vs. \(2 (109) = 218\).

Time = 0.18 (sec) , antiderivative size = 233, normalized size of antiderivative = 1.93 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\begin {cases} \frac {a^{3} \sin {\left (c + d x \right )}}{d} + \frac {3 a^{2} b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 a b^{2} \sin ^{3}{\left (c + d x \right )}}{d} + \frac {3 a b^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 b^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 b^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 b^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \cos {\left (c \right )}\right )^{3} \cos {\left (c \right )} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((a**3*sin(c + d*x)/d + 3*a**2*b*x*sin(c + d*x)**2/2 + 3*a**2*b*x 
*cos(c + d*x)**2/2 + 3*a**2*b*sin(c + d*x)*cos(c + d*x)/(2*d) + 2*a*b**2*s 
in(c + d*x)**3/d + 3*a*b**2*sin(c + d*x)*cos(c + d*x)**2/d + 3*b**3*x*sin( 
c + d*x)**4/8 + 3*b**3*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*b**3*x*cos( 
c + d*x)**4/8 + 3*b**3*sin(c + d*x)**3*cos(c + d*x)/(8*d) + 5*b**3*sin(c + 
 d*x)*cos(c + d*x)**3/(8*d), Ne(d, 0)), (x*(a + b*cos(c))**3*cos(c), True) 
)
 

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.79 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {24 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} b - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a b^{2} + {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{3} + 32 \, a^{3} \sin \left (d x + c\right )}{32 \, d} \] Input:

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

Output:

1/32*(24*(2*d*x + 2*c + sin(2*d*x + 2*c))*a^2*b - 32*(sin(d*x + c)^3 - 3*s 
in(d*x + c))*a*b^2 + (12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c 
))*b^3 + 32*a^3*sin(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.49 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.79 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {b^{3} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {a b^{2} \sin \left (3 \, d x + 3 \, c\right )}{4 \, d} + \frac {3}{8} \, {\left (4 \, a^{2} b + b^{3}\right )} x + \frac {{\left (3 \, a^{2} b + b^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, a^{3} + 9 \, a b^{2}\right )} \sin \left (d x + c\right )}{4 \, d} \] Input:

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

Output:

1/32*b^3*sin(4*d*x + 4*c)/d + 1/4*a*b^2*sin(3*d*x + 3*c)/d + 3/8*(4*a^2*b 
+ b^3)*x + 1/4*(3*a^2*b + b^3)*sin(2*d*x + 2*c)/d + 1/4*(4*a^3 + 9*a*b^2)* 
sin(d*x + c)/d
 

Mupad [B] (verification not implemented)

Time = 41.16 (sec) , antiderivative size = 279, normalized size of antiderivative = 2.31 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {\left (2\,a^3-3\,a^2\,b+6\,a\,b^2-\frac {5\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (6\,a^3-3\,a^2\,b+10\,a\,b^2+\frac {3\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (6\,a^3+3\,a^2\,b+10\,a\,b^2-\frac {3\,b^3}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^3+3\,a^2\,b+6\,a\,b^2+\frac {5\,b^3}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {3\,b\,\mathrm {atan}\left (\frac {3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2+b^2\right )}{4\,\left (3\,a^2\,b+\frac {3\,b^3}{4}\right )}\right )\,\left (4\,a^2+b^2\right )}{4\,d}-\frac {3\,b\,\left (4\,a^2+b^2\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d} \] Input:

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

Output:

(tan(c/2 + (d*x)/2)^7*(6*a*b^2 - 3*a^2*b + 2*a^3 - (5*b^3)/4) + tan(c/2 + 
(d*x)/2)^3*(10*a*b^2 + 3*a^2*b + 6*a^3 - (3*b^3)/4) + tan(c/2 + (d*x)/2)^5 
*(10*a*b^2 - 3*a^2*b + 6*a^3 + (3*b^3)/4) + tan(c/2 + (d*x)/2)*(6*a*b^2 + 
3*a^2*b + 2*a^3 + (5*b^3)/4))/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*tan(c/2 + (d* 
x)/2)^4 + 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1)) + (3*b*atan( 
(3*b*tan(c/2 + (d*x)/2)*(4*a^2 + b^2))/(4*(3*a^2*b + (3*b^3)/4)))*(4*a^2 + 
 b^2))/(4*d) - (3*b*(4*a^2 + b^2)*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2))/(4 
*d)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.93 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 \, dx=\frac {-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b^{3}+12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{2} b +5 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{3}-8 \sin \left (d x +c \right )^{3} a \,b^{2}+8 \sin \left (d x +c \right ) a^{3}+24 \sin \left (d x +c \right ) a \,b^{2}+12 a^{2} b d x +3 b^{3} d x}{8 d} \] Input:

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

Output:

( - 2*cos(c + d*x)*sin(c + d*x)**3*b**3 + 12*cos(c + d*x)*sin(c + d*x)*a** 
2*b + 5*cos(c + d*x)*sin(c + d*x)*b**3 - 8*sin(c + d*x)**3*a*b**2 + 8*sin( 
c + d*x)*a**3 + 24*sin(c + d*x)*a*b**2 + 12*a**2*b*d*x + 3*b**3*d*x)/(8*d)