Integrand size = 9, antiderivative size = 161 \[ \int d^x x^2 \cos (x) \, dx=-\frac {6 d^x \cos (x) \log (d)}{\left (1+\log ^2(d)\right )^3}+\frac {2 d^x \cos (x) \log ^3(d)}{\left (1+\log ^2(d)\right )^3}+\frac {2 d^x x \cos (x)}{\left (1+\log ^2(d)\right )^2}-\frac {2 d^x x \cos (x) \log ^2(d)}{\left (1+\log ^2(d)\right )^2}+\frac {d^x x^2 \cos (x) \log (d)}{1+\log ^2(d)}-\frac {2 d^x \sin (x)}{\left (1+\log ^2(d)\right )^3}+\frac {6 d^x \log ^2(d) \sin (x)}{\left (1+\log ^2(d)\right )^3}-\frac {4 d^x x \log (d) \sin (x)}{\left (1+\log ^2(d)\right )^2}+\frac {d^x x^2 \sin (x)}{1+\log ^2(d)} \]
-6*d^x*cos(x)*ln(d)/(1+ln(d)^2)^3+2*d^x*cos(x)*ln(d)^3/(1+ln(d)^2)^3+2*d^x *x*cos(x)/(1+ln(d)^2)^2-2*d^x*x*cos(x)*ln(d)^2/(1+ln(d)^2)^2+d^x*x^2*cos(x )*ln(d)/(1+ln(d)^2)-2*d^x*sin(x)/(1+ln(d)^2)^3+6*d^x*ln(d)^2*sin(x)/(1+ln( d)^2)^3-4*d^x*x*ln(d)*sin(x)/(1+ln(d)^2)^2+d^x*x^2*sin(x)/(1+ln(d)^2)
Time = 0.05 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.58 \[ \int d^x x^2 \cos (x) \, dx=\frac {d^x \left (\cos (x) \left (2 x+\left (-6+x^2\right ) \log (d)+2 \left (1+x^2\right ) \log ^3(d)-2 x \log ^4(d)+x^2 \log ^5(d)\right )+\left (-2+x^2-4 x \log (d)+2 \left (3+x^2\right ) \log ^2(d)-4 x \log ^3(d)+x^2 \log ^4(d)\right ) \sin (x)\right )}{\left (1+\log ^2(d)\right )^3} \]
(d^x*(Cos[x]*(2*x + (-6 + x^2)*Log[d] + 2*(1 + x^2)*Log[d]^3 - 2*x*Log[d]^ 4 + x^2*Log[d]^5) + (-2 + x^2 - 4*x*Log[d] + 2*(3 + x^2)*Log[d]^2 - 4*x*Lo g[d]^3 + x^2*Log[d]^4)*Sin[x]))/(1 + Log[d]^2)^3
Time = 0.38 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.01, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4969, 2010, 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^2 d^x \cos (x) \, dx\) |
\(\Big \downarrow \) 4969 |
\(\displaystyle -2 \int x \left (\frac {\sin (x) d^x}{\log ^2(d)+1}+\frac {\cos (x) \log (d) d^x}{\log ^2(d)+1}\right )dx+\frac {x^2 d^x \sin (x)}{\log ^2(d)+1}+\frac {x^2 d^x \log (d) \cos (x)}{\log ^2(d)+1}\) |
\(\Big \downarrow \) 2010 |
\(\displaystyle -2 \int \left (\frac {x \sin (x) d^x}{\log ^2(d)+1}+\frac {x \cos (x) \log (d) d^x}{\log ^2(d)+1}\right )dx+\frac {x^2 d^x \sin (x)}{\log ^2(d)+1}+\frac {x^2 d^x \log (d) \cos (x)}{\log ^2(d)+1}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {x^2 d^x \sin (x)}{\log ^2(d)+1}+\frac {x^2 d^x \log (d) \cos (x)}{\log ^2(d)+1}-2 \left (\frac {2 x d^x \log (d) \sin (x)}{\left (\log ^2(d)+1\right )^2}-\frac {3 d^x \log ^2(d) \sin (x)}{\left (\log ^2(d)+1\right )^3}+\frac {d^x \sin (x)}{\left (\log ^2(d)+1\right )^3}+\frac {x d^x \log ^2(d) \cos (x)}{\left (\log ^2(d)+1\right )^2}-\frac {x d^x \cos (x)}{\left (\log ^2(d)+1\right )^2}+\frac {3 d^x \log (d) \cos (x)}{\left (\log ^2(d)+1\right )^3}-\frac {d^x \log ^3(d) \cos (x)}{\left (\log ^2(d)+1\right )^3}\right )\) |
(d^x*x^2*Cos[x]*Log[d])/(1 + Log[d]^2) + (d^x*x^2*Sin[x])/(1 + Log[d]^2) - 2*((3*d^x*Cos[x]*Log[d])/(1 + Log[d]^2)^3 - (d^x*Cos[x]*Log[d]^3)/(1 + Lo g[d]^2)^3 - (d^x*x*Cos[x])/(1 + Log[d]^2)^2 + (d^x*x*Cos[x]*Log[d]^2)/(1 + Log[d]^2)^2 + (d^x*Sin[x])/(1 + Log[d]^2)^3 - (3*d^x*Log[d]^2*Sin[x])/(1 + Log[d]^2)^3 + (2*d^x*x*Log[d]*Sin[x])/(1 + Log[d]^2)^2)
3.2.39.3.1 Defintions of rubi rules used
Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x] , x] /; FreeQ[{c, m}, x] && SumQ[u] && !LinearQ[u, x] && !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]
Int[Cos[(d_.) + (e_.)*(x_)]^(n_.)*(F_)^((c_.)*((a_.) + (b_.)*(x_)))*((f_.)* (x_))^(m_.), x_Symbol] :> Module[{u = IntHide[F^(c*(a + b*x))*Cos[d + e*x]^ n, x]}, Simp[(f*x)^m u, x] - Simp[f*m Int[(f*x)^(m - 1)*u, x], x]] /; F reeQ[{F, a, b, c, d, e, f}, x] && IGtQ[n, 0] && GtQ[m, 0]
Result contains complex when optimal does not.
Time = 0.34 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.62
method | result | size |
risch | \(\frac {\left (2+\ln \left (d \right )^{2} x^{2}+2 i \ln \left (d \right ) x^{2}-x^{2}-2 x \ln \left (d \right )-2 i x \right ) d^{x} {\mathrm e}^{i x}}{2 \left (\ln \left (d \right )+i\right )^{3}}+\frac {\left (2-2 x \ln \left (d \right )+2 i x +\ln \left (d \right )^{2} x^{2}-2 i \ln \left (d \right ) x^{2}-x^{2}\right ) d^{x} {\mathrm e}^{-i x}}{2 \left (\ln \left (d \right )-i\right )^{3}}\) | \(100\) |
parallelrisch | \(\frac {d^{x} \left (\ln \left (d \right )^{5} x^{2} \cos \left (x \right )+x \left (-2 \cos \left (x \right )+x \sin \left (x \right )\right ) \ln \left (d \right )^{4}+\left (2 x^{2} \cos \left (x \right )-4 x \sin \left (x \right )+2 \cos \left (x \right )\right ) \ln \left (d \right )^{3}+\left (2 x^{2}+6\right ) \sin \left (x \right ) \ln \left (d \right )^{2}+\left (x^{2} \cos \left (x \right )-4 x \sin \left (x \right )-6 \cos \left (x \right )\right ) \ln \left (d \right )+x^{2} \sin \left (x \right )+2 x \cos \left (x \right )-2 \sin \left (x \right )\right )}{\left (1+\ln \left (d \right )^{2}\right )^{3}}\) | \(109\) |
norman | \(\frac {\frac {\ln \left (d \right ) x^{2} {\mathrm e}^{x \ln \left (d \right )}}{1+\ln \left (d \right )^{2}}+\frac {2 x^{2} {\mathrm e}^{x \ln \left (d \right )} \tan \left (\frac {x}{2}\right )}{1+\ln \left (d \right )^{2}}-\frac {2 \left (\ln \left (d \right )^{2}-1\right ) x \,{\mathrm e}^{x \ln \left (d \right )}}{\left (1+\ln \left (d \right )^{2}\right )^{2}}+\frac {4 \left (3 \ln \left (d \right )^{2}-1\right ) {\mathrm e}^{x \ln \left (d \right )} \tan \left (\frac {x}{2}\right )}{\left (1+\ln \left (d \right )^{2}\right )^{3}}+\frac {2 \ln \left (d \right ) \left (\ln \left (d \right )^{2}-3\right ) {\mathrm e}^{x \ln \left (d \right )}}{\left (1+\ln \left (d \right )^{2}\right )^{3}}-\frac {8 \ln \left (d \right ) x \,{\mathrm e}^{x \ln \left (d \right )} \tan \left (\frac {x}{2}\right )}{\left (1+\ln \left (d \right )^{2}\right )^{2}}+\frac {2 \left (\ln \left (d \right )^{2}-1\right ) x \,{\mathrm e}^{x \ln \left (d \right )} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{\left (1+\ln \left (d \right )^{2}\right )^{2}}-\frac {\ln \left (d \right ) x^{2} {\mathrm e}^{x \ln \left (d \right )} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{1+\ln \left (d \right )^{2}}-\frac {2 \ln \left (d \right ) \left (\ln \left (d \right )^{2}-3\right ) {\mathrm e}^{x \ln \left (d \right )} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{\left (1+\ln \left (d \right )^{2}\right )^{3}}}{1+\tan ^{2}\left (\frac {x}{2}\right )}\) | \(231\) |
1/2*(2+ln(d)^2*x^2+2*I*ln(d)*x^2-x^2-2*x*ln(d)-2*I*x)*d^x/(ln(d)+I)^3*exp( I*x)+1/2*(2-2*x*ln(d)+2*I*x+ln(d)^2*x^2-2*I*ln(d)*x^2-x^2)*d^x/(ln(d)-I)^3 *exp(-I*x)
Time = 0.26 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.69 \[ \int d^x x^2 \cos (x) \, dx=\frac {{\left (x^{2} \cos \left (x\right ) \log \left (d\right )^{5} - 2 \, x \cos \left (x\right ) \log \left (d\right )^{4} + 2 \, {\left (x^{2} + 1\right )} \cos \left (x\right ) \log \left (d\right )^{3} + {\left (x^{2} - 6\right )} \cos \left (x\right ) \log \left (d\right ) + 2 \, x \cos \left (x\right ) + {\left (x^{2} \log \left (d\right )^{4} - 4 \, x \log \left (d\right )^{3} + 2 \, {\left (x^{2} + 3\right )} \log \left (d\right )^{2} + x^{2} - 4 \, x \log \left (d\right ) - 2\right )} \sin \left (x\right )\right )} d^{x}}{\log \left (d\right )^{6} + 3 \, \log \left (d\right )^{4} + 3 \, \log \left (d\right )^{2} + 1} \]
(x^2*cos(x)*log(d)^5 - 2*x*cos(x)*log(d)^4 + 2*(x^2 + 1)*cos(x)*log(d)^3 + (x^2 - 6)*cos(x)*log(d) + 2*x*cos(x) + (x^2*log(d)^4 - 4*x*log(d)^3 + 2*( x^2 + 3)*log(d)^2 + x^2 - 4*x*log(d) - 2)*sin(x))*d^x/(log(d)^6 + 3*log(d) ^4 + 3*log(d)^2 + 1)
Result contains complex when optimal does not.
Time = 1.01 (sec) , antiderivative size = 668, normalized size of antiderivative = 4.15 \[ \int d^x x^2 \cos (x) \, dx =\text {Too large to display} \]
Piecewise((I*x**3*exp(-I*x)*sin(x)/6 + x**3*exp(-I*x)*cos(x)/6 + x**2*exp( -I*x)*sin(x)/4 + I*x**2*exp(-I*x)*cos(x)/4 - I*x*exp(-I*x)*sin(x)/4 + x*ex p(-I*x)*cos(x)/4 - I*exp(-I*x)*cos(x)/4, Eq(d, exp(-I))), (-I*x**3*exp(I*x )*sin(x)/6 + x**3*exp(I*x)*cos(x)/6 + x**2*exp(I*x)*sin(x)/4 - I*x**2*exp( I*x)*cos(x)/4 + I*x*exp(I*x)*sin(x)/4 + x*exp(I*x)*cos(x)/4 + I*exp(I*x)*c os(x)/4, Eq(d, exp(I))), (d**x*x**2*log(d)**5*cos(x)/(log(d)**6 + 3*log(d) **4 + 3*log(d)**2 + 1) + d**x*x**2*log(d)**4*sin(x)/(log(d)**6 + 3*log(d)* *4 + 3*log(d)**2 + 1) + 2*d**x*x**2*log(d)**3*cos(x)/(log(d)**6 + 3*log(d) **4 + 3*log(d)**2 + 1) + 2*d**x*x**2*log(d)**2*sin(x)/(log(d)**6 + 3*log(d )**4 + 3*log(d)**2 + 1) + d**x*x**2*log(d)*cos(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) + d**x*x**2*sin(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d) **2 + 1) - 2*d**x*x*log(d)**4*cos(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)** 2 + 1) - 4*d**x*x*log(d)**3*sin(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) - 4*d**x*x*log(d)*sin(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) + 2*d**x*x*cos(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) + 2*d**x*log (d)**3*cos(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) + 6*d**x*log(d)* *2*sin(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) - 6*d**x*log(d)*cos( x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1) - 2*d**x*sin(x)/(log(d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1), True))
Time = 0.21 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.65 \[ \int d^x x^2 \cos (x) \, dx=\frac {{\left ({\left (\log \left (d\right )^{5} + 2 \, \log \left (d\right )^{3} + \log \left (d\right )\right )} x^{2} + 2 \, \log \left (d\right )^{3} - 2 \, {\left (\log \left (d\right )^{4} - 1\right )} x - 6 \, \log \left (d\right )\right )} d^{x} \cos \left (x\right ) + {\left ({\left (\log \left (d\right )^{4} + 2 \, \log \left (d\right )^{2} + 1\right )} x^{2} - 4 \, {\left (\log \left (d\right )^{3} + \log \left (d\right )\right )} x + 6 \, \log \left (d\right )^{2} - 2\right )} d^{x} \sin \left (x\right )}{\log \left (d\right )^{6} + 3 \, \log \left (d\right )^{4} + 3 \, \log \left (d\right )^{2} + 1} \]
(((log(d)^5 + 2*log(d)^3 + log(d))*x^2 + 2*log(d)^3 - 2*(log(d)^4 - 1)*x - 6*log(d))*d^x*cos(x) + ((log(d)^4 + 2*log(d)^2 + 1)*x^2 - 4*(log(d)^3 + l og(d))*x + 6*log(d)^2 - 2)*d^x*sin(x))/(log(d)^6 + 3*log(d)^4 + 3*log(d)^2 + 1)
Result contains complex when optimal does not.
Time = 0.31 (sec) , antiderivative size = 2631, normalized size of antiderivative = 16.34 \[ \int d^x x^2 \cos (x) \, dx=\text {Too large to display} \]
1/2*((2*(3*pi - pi^3*sgn(d) + 3*pi*log(abs(d))^2*sgn(d) + pi^3 - 3*pi*log( abs(d))^2 + 3*pi^2*sgn(d) - 3*pi^2 + 6*log(abs(d))^2 - 3*pi*sgn(d) - 2)*(p i*x^2*log(abs(d))*sgn(d) - pi*x^2*log(abs(d)) + 2*x^2*log(abs(d)) - pi*x*s gn(d) + pi*x - 2*x)/((3*pi - pi^3*sgn(d) + 3*pi*log(abs(d))^2*sgn(d) + pi^ 3 - 3*pi*log(abs(d))^2 + 3*pi^2*sgn(d) - 3*pi^2 + 6*log(abs(d))^2 - 3*pi*s gn(d) - 2)^2 + (3*pi^2*log(abs(d))*sgn(d) - 3*pi^2*log(abs(d)) + 2*log(abs (d))^3 - 6*pi*log(abs(d))*sgn(d) + 6*pi*log(abs(d)) - 6*log(abs(d)))^2) + (pi^2*x^2*sgn(d) - pi^2*x^2 + 2*x^2*log(abs(d))^2 - 2*pi*x^2*sgn(d) + 2*pi *x^2 - 2*x^2 - 4*x*log(abs(d)) + 4)*(3*pi^2*log(abs(d))*sgn(d) - 3*pi^2*lo g(abs(d)) + 2*log(abs(d))^3 - 6*pi*log(abs(d))*sgn(d) + 6*pi*log(abs(d)) - 6*log(abs(d)))/((3*pi - pi^3*sgn(d) + 3*pi*log(abs(d))^2*sgn(d) + pi^3 - 3*pi*log(abs(d))^2 + 3*pi^2*sgn(d) - 3*pi^2 + 6*log(abs(d))^2 - 3*pi*sgn(d ) - 2)^2 + (3*pi^2*log(abs(d))*sgn(d) - 3*pi^2*log(abs(d)) + 2*log(abs(d)) ^3 - 6*pi*log(abs(d))*sgn(d) + 6*pi*log(abs(d)) - 6*log(abs(d)))^2))*cos(1 /2*pi*x*sgn(d) - 1/2*pi*x + x) + ((3*pi - pi^3*sgn(d) + 3*pi*log(abs(d))^2 *sgn(d) + pi^3 - 3*pi*log(abs(d))^2 + 3*pi^2*sgn(d) - 3*pi^2 + 6*log(abs(d ))^2 - 3*pi*sgn(d) - 2)*(pi^2*x^2*sgn(d) - pi^2*x^2 + 2*x^2*log(abs(d))^2 - 2*pi*x^2*sgn(d) + 2*pi*x^2 - 2*x^2 - 4*x*log(abs(d)) + 4)/((3*pi - pi^3* sgn(d) + 3*pi*log(abs(d))^2*sgn(d) + pi^3 - 3*pi*log(abs(d))^2 + 3*pi^2*sg n(d) - 3*pi^2 + 6*log(abs(d))^2 - 3*pi*sgn(d) - 2)^2 + (3*pi^2*log(abs(...
Time = 0.34 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.82 \[ \int d^x x^2 \cos (x) \, dx=\frac {d^x\,\left (x^2\,\sin \left (x\right )-2\,\sin \left (x\right )+2\,x\,\cos \left (x\right )\right )+d^x\,{\ln \left (d\right )}^3\,\left (2\,\cos \left (x\right )+2\,x^2\,\cos \left (x\right )-4\,x\,\sin \left (x\right )\right )+d^x\,{\ln \left (d\right )}^2\,\left (6\,\sin \left (x\right )+2\,x^2\,\sin \left (x\right )\right )-d^x\,\ln \left (d\right )\,\left (6\,\cos \left (x\right )-x^2\,\cos \left (x\right )+4\,x\,\sin \left (x\right )\right )+d^x\,{\ln \left (d\right )}^4\,\left (x^2\,\sin \left (x\right )-2\,x\,\cos \left (x\right )\right )+d^x\,x^2\,{\ln \left (d\right )}^5\,\cos \left (x\right )}{{\left ({\ln \left (d\right )}^2+1\right )}^3} \]
(d^x*(x^2*sin(x) - 2*sin(x) + 2*x*cos(x)) + d^x*log(d)^3*(2*cos(x) + 2*x^2 *cos(x) - 4*x*sin(x)) + d^x*log(d)^2*(6*sin(x) + 2*x^2*sin(x)) - d^x*log(d )*(6*cos(x) - x^2*cos(x) + 4*x*sin(x)) + d^x*log(d)^4*(x^2*sin(x) - 2*x*co s(x)) + d^x*x^2*log(d)^5*cos(x))/(log(d)^2 + 1)^3
Time = 0.00 (sec) , antiderivative size = 137, normalized size of antiderivative = 0.85 \[ \int d^x x^2 \cos (x) \, dx=\frac {d^{x} \left (\cos \left (x \right ) \mathrm {log}\left (d \right )^{5} x^{2}-2 \cos \left (x \right ) \mathrm {log}\left (d \right )^{4} x +2 \cos \left (x \right ) \mathrm {log}\left (d \right )^{3} x^{2}+2 \cos \left (x \right ) \mathrm {log}\left (d \right )^{3}+\cos \left (x \right ) \mathrm {log}\left (d \right ) x^{2}-6 \cos \left (x \right ) \mathrm {log}\left (d \right )+2 \cos \left (x \right ) x +\mathrm {log}\left (d \right )^{4} \sin \left (x \right ) x^{2}-4 \mathrm {log}\left (d \right )^{3} \sin \left (x \right ) x +2 \mathrm {log}\left (d \right )^{2} \sin \left (x \right ) x^{2}+6 \mathrm {log}\left (d \right )^{2} \sin \left (x \right )-4 \,\mathrm {log}\left (d \right ) \sin \left (x \right ) x +\sin \left (x \right ) x^{2}-2 \sin \left (x \right )\right )}{\mathrm {log}\left (d \right )^{6}+3 \mathrm {log}\left (d \right )^{4}+3 \mathrm {log}\left (d \right )^{2}+1} \]
(d**x*(cos(x)*log(d)**5*x**2 - 2*cos(x)*log(d)**4*x + 2*cos(x)*log(d)**3*x **2 + 2*cos(x)*log(d)**3 + cos(x)*log(d)*x**2 - 6*cos(x)*log(d) + 2*cos(x) *x + log(d)**4*sin(x)*x**2 - 4*log(d)**3*sin(x)*x + 2*log(d)**2*sin(x)*x** 2 + 6*log(d)**2*sin(x) - 4*log(d)*sin(x)*x + sin(x)*x**2 - 2*sin(x)))/(log (d)**6 + 3*log(d)**4 + 3*log(d)**2 + 1)