3.135 \(\int d^x \cos (x) \, dx\)

Optimal. Leaf size=31 \[ \frac{d^x \sin (x)}{\log ^2(d)+1}+\frac{d^x \log (d) \cos (x)}{\log ^2(d)+1} \]

[Out]

(d^x*Cos[x]*Log[d])/(1 + Log[d]^2) + (d^x*Sin[x])/(1 + Log[d]^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0082266, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {4433} \[ \frac{d^x \sin (x)}{\log ^2(d)+1}+\frac{d^x \log (d) \cos (x)}{\log ^2(d)+1} \]

Antiderivative was successfully verified.

[In]

Int[d^x*Cos[x],x]

[Out]

(d^x*Cos[x]*Log[d])/(1 + Log[d]^2) + (d^x*Sin[x])/(1 + Log[d]^2)

Rule 4433

Int[Cos[(d_.) + (e_.)*(x_)]*(F_)^((c_.)*((a_.) + (b_.)*(x_))), x_Symbol] :> Simp[(b*c*Log[F]*F^(c*(a + b*x))*C
os[d + e*x])/(e^2 + b^2*c^2*Log[F]^2), x] + Simp[(e*F^(c*(a + b*x))*Sin[d + e*x])/(e^2 + b^2*c^2*Log[F]^2), x]
 /; FreeQ[{F, a, b, c, d, e}, x] && NeQ[e^2 + b^2*c^2*Log[F]^2, 0]

Rubi steps

\begin{align*} \int d^x \cos (x) \, dx &=\frac{d^x \cos (x) \log (d)}{1+\log ^2(d)}+\frac{d^x \sin (x)}{1+\log ^2(d)}\\ \end{align*}

Mathematica [A]  time = 0.0162946, size = 20, normalized size = 0.65 \[ \frac{d^x (\log (d) \cos (x)+\sin (x))}{\log ^2(d)+1} \]

Antiderivative was successfully verified.

[In]

Integrate[d^x*Cos[x],x]

[Out]

(d^x*(Cos[x]*Log[d] + Sin[x]))/(1 + Log[d]^2)

________________________________________________________________________________________

Maple [B]  time = 0.016, size = 71, normalized size = 2.3 \begin{align*}{ \left ({\frac{\ln \left ( d \right ){{\rm e}^{x\ln \left ( d \right ) }}}{1+ \left ( \ln \left ( d \right ) \right ) ^{2}}}+2\,{\frac{{{\rm e}^{x\ln \left ( d \right ) }}\tan \left ( x/2 \right ) }{1+ \left ( \ln \left ( d \right ) \right ) ^{2}}}-{\frac{\ln \left ( d \right ){{\rm e}^{x\ln \left ( d \right ) }}}{1+ \left ( \ln \left ( d \right ) \right ) ^{2}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}} \right ) \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(d^x*cos(x),x)

[Out]

(1/(1+ln(d)^2)*ln(d)*exp(x*ln(d))+2/(1+ln(d)^2)*exp(x*ln(d))*tan(1/2*x)-1/(1+ln(d)^2)*ln(d)*exp(x*ln(d))*tan(1
/2*x)^2)/(tan(1/2*x)^2+1)

________________________________________________________________________________________

Maxima [A]  time = 0.958547, size = 32, normalized size = 1.03 \begin{align*} \frac{d^{x} \cos \left (x\right ) \log \left (d\right ) + d^{x} \sin \left (x\right )}{\log \left (d\right )^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d^x*cos(x),x, algorithm="maxima")

[Out]

(d^x*cos(x)*log(d) + d^x*sin(x))/(log(d)^2 + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.87864, size = 61, normalized size = 1.97 \begin{align*} \frac{{\left (\cos \left (x\right ) \log \left (d\right ) + \sin \left (x\right )\right )} d^{x}}{\log \left (d\right )^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d^x*cos(x),x, algorithm="fricas")

[Out]

(cos(x)*log(d) + sin(x))*d^x/(log(d)^2 + 1)

________________________________________________________________________________________

Sympy [A]  time = 1.08018, size = 107, normalized size = 3.45 \begin{align*} \begin{cases} \frac{i x e^{- i x} \sin{\left (x \right )}}{2} + \frac{x e^{- i x} \cos{\left (x \right )}}{2} + \frac{i e^{- i x} \cos{\left (x \right )}}{2} & \text{for}\: d = e^{- i} \\- \frac{i x e^{i x} \sin{\left (x \right )}}{2} + \frac{x e^{i x} \cos{\left (x \right )}}{2} - \frac{i e^{i x} \cos{\left (x \right )}}{2} & \text{for}\: d = e^{i} \\\frac{d^{x} \log{\left (d \right )} \cos{\left (x \right )}}{\log{\left (d \right )}^{2} + 1} + \frac{d^{x} \sin{\left (x \right )}}{\log{\left (d \right )}^{2} + 1} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d**x*cos(x),x)

[Out]

Piecewise((I*x*exp(-I*x)*sin(x)/2 + x*exp(-I*x)*cos(x)/2 + I*exp(-I*x)*cos(x)/2, Eq(d, exp(-I))), (-I*x*exp(I*
x)*sin(x)/2 + x*exp(I*x)*cos(x)/2 - I*exp(I*x)*cos(x)/2, Eq(d, exp(I))), (d**x*log(d)*cos(x)/(log(d)**2 + 1) +
 d**x*sin(x)/(log(d)**2 + 1), True))

________________________________________________________________________________________

Giac [C]  time = 1.12309, size = 444, normalized size = 14.32 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d^x*cos(x),x, algorithm="giac")

[Out]

abs(d)^x*(2*cos(1/2*pi*x*sgn(d) - 1/2*pi*x + x)*log(abs(d))/((pi - pi*sgn(d) - 2)^2 + 4*log(abs(d))^2) - (pi -
 pi*sgn(d) - 2)*sin(1/2*pi*x*sgn(d) - 1/2*pi*x + x)/((pi - pi*sgn(d) - 2)^2 + 4*log(abs(d))^2)) + abs(d)^x*(2*
cos(1/2*pi*x*sgn(d) - 1/2*pi*x - x)*log(abs(d))/((pi - pi*sgn(d) + 2)^2 + 4*log(abs(d))^2) - (pi - pi*sgn(d) +
 2)*sin(1/2*pi*x*sgn(d) - 1/2*pi*x - x)/((pi - pi*sgn(d) + 2)^2 + 4*log(abs(d))^2)) - 1/2*I*abs(d)^x*(-2*I*e^(
1/2*I*pi*x*sgn(d) - 1/2*I*pi*x + I*x)/(-2*I*pi + 2*I*pi*sgn(d) + 4*log(abs(d)) + 4*I) + 2*I*e^(-1/2*I*pi*x*sgn
(d) + 1/2*I*pi*x - I*x)/(2*I*pi - 2*I*pi*sgn(d) + 4*log(abs(d)) - 4*I)) - 1/2*I*abs(d)^x*(-2*I*e^(1/2*I*pi*x*s
gn(d) - 1/2*I*pi*x - I*x)/(-2*I*pi + 2*I*pi*sgn(d) + 4*log(abs(d)) - 4*I) + 2*I*e^(-1/2*I*pi*x*sgn(d) + 1/2*I*
pi*x + I*x)/(2*I*pi - 2*I*pi*sgn(d) + 4*log(abs(d)) + 4*I))