\(\int x^{1+m} \cos ^2(a+b x) \, dx\) [113]

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

Optimal result

Integrand size = 14, antiderivative size = 97 \[ \int x^{1+m} \cos ^2(a+b x) \, dx=\frac {x^{2+m}}{2 (2+m)}+\frac {2^{-4-m} e^{2 i a} x^m (-i b x)^{-m} \Gamma (2+m,-2 i b x)}{b^2}+\frac {2^{-4-m} e^{-2 i a} x^m (i b x)^{-m} \Gamma (2+m,2 i b x)}{b^2} \] Output:

x^(2+m)/(4+2*m)+2^(-4-m)*exp(2*I*a)*x^m*GAMMA(2+m,-2*I*b*x)/b^2/((-I*b*x)^ 
m)+2^(-4-m)*x^m*GAMMA(2+m,2*I*b*x)/b^2/exp(2*I*a)/((I*b*x)^m)
 

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.93 \[ \int x^{1+m} \cos ^2(a+b x) \, dx=\frac {1}{16} x^m \left (\frac {8 x^2}{2+m}+\frac {2^{-m} e^{2 i a} (-i b x)^{-m} \Gamma (2+m,-2 i b x)}{b^2}+\frac {2^{-m} e^{-2 i a} (i b x)^{-m} \Gamma (2+m,2 i b x)}{b^2}\right ) \] Input:

Integrate[x^(1 + m)*Cos[a + b*x]^2,x]
 

Output:

(x^m*((8*x^2)/(2 + m) + (E^((2*I)*a)*Gamma[2 + m, (-2*I)*b*x])/(2^m*b^2*(( 
-I)*b*x)^m) + Gamma[2 + m, (2*I)*b*x]/(2^m*b^2*E^((2*I)*a)*(I*b*x)^m)))/16
 

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3042, 3793, 2009}

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 x^{m+1} \cos ^2(a+b x) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int x^{m+1} \sin \left (a+b x+\frac {\pi }{2}\right )^2dx\)

\(\Big \downarrow \) 3793

\(\displaystyle \int \left (\frac {1}{2} x^{m+1} \cos (2 a+2 b x)+\frac {x^{m+1}}{2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {e^{2 i a} 2^{-m-4} x^m (-i b x)^{-m} \Gamma (m+2,-2 i b x)}{b^2}+\frac {e^{-2 i a} 2^{-m-4} x^m (i b x)^{-m} \Gamma (m+2,2 i b x)}{b^2}+\frac {x^{m+2}}{2 (m+2)}\)

Input:

Int[x^(1 + m)*Cos[a + b*x]^2,x]
 

Output:

x^(2 + m)/(2*(2 + m)) + (2^(-4 - m)*E^((2*I)*a)*x^m*Gamma[2 + m, (-2*I)*b* 
x])/(b^2*((-I)*b*x)^m) + (2^(-4 - m)*x^m*Gamma[2 + m, (2*I)*b*x])/(b^2*E^( 
(2*I)*a)*(I*b*x)^m)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 3793
Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> In 
t[ExpandTrigReduce[(c + d*x)^m, Sin[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f 
, m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1]))
 
Maple [F]

\[\int x^{1+m} \cos \left (b x +a \right )^{2}d x\]

Input:

int(x^(1+m)*cos(b*x+a)^2,x)
 

Output:

int(x^(1+m)*cos(b*x+a)^2,x)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.79 \[ \int x^{1+m} \cos ^2(a+b x) \, dx=\frac {4 \, b x x^{m + 1} + {\left (i \, m + 2 i\right )} e^{\left (-{\left (m + 1\right )} \log \left (2 i \, b\right ) - 2 i \, a\right )} \Gamma \left (m + 2, 2 i \, b x\right ) + {\left (-i \, m - 2 i\right )} e^{\left (-{\left (m + 1\right )} \log \left (-2 i \, b\right ) + 2 i \, a\right )} \Gamma \left (m + 2, -2 i \, b x\right )}{8 \, {\left (b m + 2 \, b\right )}} \] Input:

integrate(x^(1+m)*cos(b*x+a)^2,x, algorithm="fricas")
 

Output:

1/8*(4*b*x*x^(m + 1) + (I*m + 2*I)*e^(-(m + 1)*log(2*I*b) - 2*I*a)*gamma(m 
 + 2, 2*I*b*x) + (-I*m - 2*I)*e^(-(m + 1)*log(-2*I*b) + 2*I*a)*gamma(m + 2 
, -2*I*b*x))/(b*m + 2*b)
 

Sympy [F]

\[ \int x^{1+m} \cos ^2(a+b x) \, dx=\int x^{m + 1} \cos ^{2}{\left (a + b x \right )}\, dx \] Input:

integrate(x**(1+m)*cos(b*x+a)**2,x)
 

Output:

Integral(x**(m + 1)*cos(a + b*x)**2, x)
 

Maxima [F]

\[ \int x^{1+m} \cos ^2(a+b x) \, dx=\int { x^{m + 1} \cos \left (b x + a\right )^{2} \,d x } \] Input:

integrate(x^(1+m)*cos(b*x+a)^2,x, algorithm="maxima")
 

Output:

1/2*((m + 2)*integrate(x*x^m*cos(2*b*x + 2*a), x) + e^(m*log(x) + 2*log(x) 
))/(m + 2)
 

Giac [F]

\[ \int x^{1+m} \cos ^2(a+b x) \, dx=\int { x^{m + 1} \cos \left (b x + a\right )^{2} \,d x } \] Input:

integrate(x^(1+m)*cos(b*x+a)^2,x, algorithm="giac")
 

Output:

integrate(x^(m + 1)*cos(b*x + a)^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int x^{1+m} \cos ^2(a+b x) \, dx=\int x^{m+1}\,{\cos \left (a+b\,x\right )}^2 \,d x \] Input:

int(x^(m + 1)*cos(a + b*x)^2,x)
 

Output:

int(x^(m + 1)*cos(a + b*x)^2, x)
 

Reduce [F]

\[ \int x^{1+m} \cos ^2(a+b x) \, dx=\frac {2 x^{m} \cos \left (b x +a \right ) \sin \left (b x +a \right ) b m x +4 x^{m} \cos \left (b x +a \right ) \sin \left (b x +a \right ) b x +2 x^{m} \cos \left (b x +a \right ) m^{2}+6 x^{m} \cos \left (b x +a \right ) m +4 x^{m} \cos \left (b x +a \right )-x^{m} \sin \left (b x +a \right )^{2} m^{2}-3 x^{m} \sin \left (b x +a \right )^{2} m -2 x^{m} \sin \left (b x +a \right )^{2}+2 x^{m} \sin \left (b x +a \right ) b m x +4 x^{m} \sin \left (b x +a \right ) b x +3 x^{m} b^{2} x^{2}+2 x^{m} m^{2}+6 x^{m} m +4 x^{m}-4 \left (\int \frac {x^{m}}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4} x +2 \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2} x +x}d x \right ) m^{3}-12 \left (\int \frac {x^{m}}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4} x +2 \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2} x +x}d x \right ) m^{2}-8 \left (\int \frac {x^{m}}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4} x +2 \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2} x +x}d x \right ) m -4 \left (\int \frac {x^{m} x}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4}+2 \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}+1}d x \right ) b^{2} m -8 \left (\int \frac {x^{m} x}{\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4}+2 \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}+1}d x \right ) b^{2}}{3 b^{2} \left (m +2\right )} \] Input:

int(x^(1+m)*cos(b*x+a)^2,x)
 

Output:

(2*x**m*cos(a + b*x)*sin(a + b*x)*b*m*x + 4*x**m*cos(a + b*x)*sin(a + b*x) 
*b*x + 2*x**m*cos(a + b*x)*m**2 + 6*x**m*cos(a + b*x)*m + 4*x**m*cos(a + b 
*x) - x**m*sin(a + b*x)**2*m**2 - 3*x**m*sin(a + b*x)**2*m - 2*x**m*sin(a 
+ b*x)**2 + 2*x**m*sin(a + b*x)*b*m*x + 4*x**m*sin(a + b*x)*b*x + 3*x**m*b 
**2*x**2 + 2*x**m*m**2 + 6*x**m*m + 4*x**m - 4*int(x**m/(tan((a + b*x)/2)* 
*4*x + 2*tan((a + b*x)/2)**2*x + x),x)*m**3 - 12*int(x**m/(tan((a + b*x)/2 
)**4*x + 2*tan((a + b*x)/2)**2*x + x),x)*m**2 - 8*int(x**m/(tan((a + b*x)/ 
2)**4*x + 2*tan((a + b*x)/2)**2*x + x),x)*m - 4*int((x**m*x)/(tan((a + b*x 
)/2)**4 + 2*tan((a + b*x)/2)**2 + 1),x)*b**2*m - 8*int((x**m*x)/(tan((a + 
b*x)/2)**4 + 2*tan((a + b*x)/2)**2 + 1),x)*b**2)/(3*b**2*(m + 2))