3.79 \(\int a^x \cos (x) \, dx\)

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

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.0219576, 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 \[ \frac{a^x \sin (x)}{\log ^2(a)+1}+\frac{a^x \log (a) \cos (x)}{\log ^2(a)+1} \]

Antiderivative was successfully verified.

[In]  Int[a^x*Cos[x],x]

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 1.5652, size = 29, normalized size = 0.94 \[ \frac{a^{x} \log{\left (a \right )} \cos{\left (x \right )}}{\log{\left (a \right )}^{2} + 1} + \frac{a^{x} \sin{\left (x \right )}}{\log{\left (a \right )}^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(a**x*cos(x),x)

[Out]

a**x*log(a)*cos(x)/(log(a)**2 + 1) + a**x*sin(x)/(log(a)**2 + 1)

_______________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]  Integrate[a^x*Cos[x],x]

[Out]

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

_______________________________________________________________________________________

Maple [B]  time = 0.03, size = 71, normalized size = 2.3 \[{1 \left ({\frac{\ln \left ( a \right ){{\rm e}^{x\ln \left ( a \right ) }}}{1+ \left ( \ln \left ( a \right ) \right ) ^{2}}}+2\,{\frac{{{\rm e}^{x\ln \left ( a \right ) }}\tan \left ( x/2 \right ) }{1+ \left ( \ln \left ( a \right ) \right ) ^{2}}}-{\frac{\ln \left ( a \right ){{\rm e}^{x\ln \left ( a \right ) }}}{1+ \left ( \ln \left ( a \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}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(a^x*cos(x),x)

[Out]

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

_______________________________________________________________________________________

Maxima [A]  time = 1.46046, size = 32, normalized size = 1.03 \[ \frac{a^{x} \cos \left (x\right ) \log \left (a\right ) + a^{x} \sin \left (x\right )}{\log \left (a\right )^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(a^x*cos(x),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.216685, size = 27, normalized size = 0.87 \[ \frac{{\left (\cos \left (x\right ) \log \left (a\right ) + \sin \left (x\right )\right )} a^{x}}{\log \left (a\right )^{2} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(a^x*cos(x),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 1.89758, size = 107, normalized size = 3.45 \[ \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}\: a = 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}\: a = e^{i} \\\frac{a^{x} \log{\left (a \right )} \cos{\left (x \right )}}{\log{\left (a \right )}^{2} + 1} + \frac{a^{x} \sin{\left (x \right )}}{\log{\left (a \right )}^{2} + 1} & \text{otherwise} \end{cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(a**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(a, 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(a, exp(I))), (a**x*log(a)*cos(x)/(log(a)**2 + 1) + a**x*sin(x)/(log(a)
**2 + 1), True))

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.23007, size = 455, normalized size = 14.68 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(a^x*cos(x),x, algorithm="giac")

[Out]

(2*cos(1/2*pi*x*sign(a) - 1/2*pi*x + x)*ln(abs(a))/((pi - pi*sign(a) - 2)^2 + 4*
ln(abs(a))^2) - (pi - pi*sign(a) - 2)*sin(1/2*pi*x*sign(a) - 1/2*pi*x + x)/((pi
- pi*sign(a) - 2)^2 + 4*ln(abs(a))^2))*e^(x*ln(abs(a))) + (2*cos(1/2*pi*x*sign(a
) - 1/2*pi*x - x)*ln(abs(a))/((pi - pi*sign(a) + 2)^2 + 4*ln(abs(a))^2) - (pi -
pi*sign(a) + 2)*sin(1/2*pi*x*sign(a) - 1/2*pi*x - x)/((pi - pi*sign(a) + 2)^2 +
4*ln(abs(a))^2))*e^(x*ln(abs(a))) - 1/2*I*(-2*I*e^(1/2*I*pi*x*sign(a) - 1/2*I*pi
*x + I*x)/(-2*I*pi + 2*I*pi*sign(a) + 4*ln(abs(a)) + 4*I) + 2*I*e^(-1/2*I*pi*x*s
ign(a) + 1/2*I*pi*x - I*x)/(2*I*pi - 2*I*pi*sign(a) + 4*ln(abs(a)) - 4*I))*e^(x*
ln(abs(a))) - 1/2*I*(-2*I*e^(1/2*I*pi*x*sign(a) - 1/2*I*pi*x - I*x)/(-2*I*pi + 2
*I*pi*sign(a) + 4*ln(abs(a)) - 4*I) + 2*I*e^(-1/2*I*pi*x*sign(a) + 1/2*I*pi*x +
I*x)/(2*I*pi - 2*I*pi*sign(a) + 4*ln(abs(a)) + 4*I))*e^(x*ln(abs(a)))