3.2.34 \(\int d^x \sin (x) \, dx\) [134]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 32, normalized size of antiderivative = 1.00, 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 = {4517} \begin {gather*} \frac {d^x \log (d) \sin (x)}{\log ^2(d)+1}-\frac {d^x \cos (x)}{\log ^2(d)+1} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 4517

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Sin[(d_.) + (e_.)*(x_)], x_Symbol] :> Simp[b*c*Log[F]*F^(c*(a + b*x))*(S
in[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x] - Simp[e*F^(c*(a + b*x))*(Cos[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 \sin (x) \, dx &=-\frac {d^x \cos (x)}{1+\log ^2(d)}+\frac {d^x \log (d) \sin (x)}{1+\log ^2(d)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 22, normalized size = 0.69 \begin {gather*} \frac {d^x (-\cos (x)+\log (d) \sin (x))}{1+\log ^2(d)} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 2.83, size = 88, normalized size = 2.75 \begin {gather*} \text {Piecewise}\left [\left \{\left \{\frac {\left (-I x \text {Cos}\left [x\right ]+x \text {Sin}\left [x\right ]-\text {Cos}\left [x\right ]\right ) E^{-I x}}{2},d\text {==}E^{-I}\right \},\left \{\frac {\left (I x \text {Cos}\left [x\right ]+x \text {Sin}\left [x\right ]-\text {Cos}\left [x\right ]\right ) E^{I x}}{2},d\text {==}E^I\right \}\right \},-\frac {\text {Cos}\left [x\right ] d^x}{1+\text {Log}\left [d\right ]^2}+\frac {\text {Log}\left [d\right ] d^x \text {Sin}\left [x\right ]}{1+\text {Log}\left [d\right ]^2}\right ] \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[d^x*Sin[x],x]')

[Out]

Piecewise[{{(-I x Cos[x] + x Sin[x] - Cos[x]) E ^ (-I x) / 2, d == E ^ (-I)}, {(I x Cos[x] + x Sin[x] - Cos[x]
) E ^ (I x) / 2, d == E ^ I}}, -Cos[x] d ^ x / (1 + Log[d] ^ 2) + Log[d] d ^ x Sin[x] / (1 + Log[d] ^ 2)]

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 33, normalized size = 1.03

method result size
risch \(-\frac {d^{x} \cos \left (x \right )}{1+\ln \left (d \right )^{2}}+\frac {d^{x} \ln \left (d \right ) \sin \left (x \right )}{1+\ln \left (d \right )^{2}}\) \(33\)
norman \(\frac {\frac {{\mathrm e}^{x \ln \left (d \right )} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{1+\ln \left (d \right )^{2}}-\frac {{\mathrm e}^{x \ln \left (d \right )}}{1+\ln \left (d \right )^{2}}+\frac {2 \ln \left (d \right ) {\mathrm e}^{x \ln \left (d \right )} \tan \left (\frac {x}{2}\right )}{1+\ln \left (d \right )^{2}}}{1+\tan ^{2}\left (\frac {x}{2}\right )}\) \(69\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(d^x*sin(x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 25, normalized size = 0.78 \begin {gather*} \frac {d^{x} \log \left (d\right ) \sin \left (x\right ) - d^{x} \cos \left (x\right )}{\log \left (d\right )^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.31, size = 22, normalized size = 0.69 \begin {gather*} \frac {{\left (\log \left (d\right ) \sin \left (x\right ) - \cos \left (x\right )\right )} d^{x}}{\log \left (d\right )^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d**x*sin(x),x)

[Out]

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

________________________________________________________________________________________

Giac [C] Result contains complex when optimal does not.
time = 0.00, size = 381, normalized size = 11.91 \begin {gather*} \mathrm {e}^{\ln \left |d\right |\cdot x} \left (-\frac {2 \left (-2 \pi \mathrm {sign}\left (d\right )+2 \pi +4\right ) \cos \left (\frac {\pi x \mathrm {sign}\left (d\right )-\pi x-2 x}{2}\right )}{\left (4 \ln \left |d\right |\right )^{2}+\left (2 \pi \mathrm {sign}\left (d\right )-2 \pi -4\right )^{2}}-\frac {4\cdot 2 \ln \left |d\right |\cdot \sin \left (\frac {\pi x \mathrm {sign}\left (d\right )-\pi x-2 x}{2}\right )}{\left (4 \ln \left |d\right |\right )^{2}+\left (2 \pi \mathrm {sign}\left (d\right )-2 \pi -4\right )^{2}}\right )+\mathrm {e}^{\ln \left |d\right |\cdot x} \left (\frac {2 \left (-2 \pi \mathrm {sign}\left (d\right )+2 \pi -4\right ) \cos \left (\frac {\pi x \mathrm {sign}\left (d\right )-\pi x+2 x}{2}\right )}{\left (4 \ln \left |d\right |\right )^{2}+\left (2 \pi \mathrm {sign}\left (d\right )-2 \pi +4\right )^{2}}+\frac {4\cdot 2 \ln \left |d\right |\cdot \sin \left (\frac {\pi x \mathrm {sign}\left (d\right )-\pi x+2 x}{2}\right )}{\left (4 \ln \left |d\right |\right )^{2}+\left (2 \pi \mathrm {sign}\left (d\right )-2 \pi +4\right )^{2}}\right )+\frac {1}{2} \mathrm {e}^{\ln \left |d\right |\cdot x} \left (\frac {2 \mathrm {i} \mathrm {e}^{\frac {1}{2} \mathrm {i} \left (\pi x \mathrm {sign}\left (d\right )-\pi x+2 x\right )}}{4 \ln \left |d\right |+\pi \cdot 2 \mathrm {i} \mathrm {sign}\left (d\right )-\pi \cdot 2 \mathrm {i}+4 \mathrm {i}}+\frac {2 \mathrm {i} \mathrm {e}^{-\frac {1}{2} \mathrm {i} \left (\pi x \mathrm {sign}\left (d\right )-\pi x+2 x\right )}}{4 \ln \left |d\right |-\pi \cdot 2 \mathrm {i} \mathrm {sign}\left (d\right )+\pi \cdot 2 \mathrm {i}-4 \mathrm {i}}\right )+\frac {1}{2} \mathrm {e}^{\ln \left |d\right |\cdot x} \left (-\frac {2 \mathrm {i} \mathrm {e}^{\frac {1}{2} \mathrm {i} \left (\pi x \mathrm {sign}\left (d\right )-\pi x-2 x\right )}}{4 \ln \left |d\right |+\pi \cdot 2 \mathrm {i} \mathrm {sign}\left (d\right )-\pi \cdot 2 \mathrm {i}-4 \mathrm {i}}-\frac {2 \mathrm {i} \mathrm {e}^{-\frac {1}{2} \mathrm {i} \left (\pi x \mathrm {sign}\left (d\right )-\pi x-2 x\right )}}{4 \ln \left |d\right |-\pi \cdot 2 \mathrm {i} \mathrm {sign}\left (d\right )+\pi \cdot 2 \mathrm {i}+4 \mathrm {i}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(d^x*sin(x),x)

[Out]

abs(d)^x*((pi - pi*sgn(d) - 2)*cos(1/2*pi*x*sgn(d) - 1/2*pi*x + x)/((pi - pi*sgn(d) - 2)^2 + 4*log(abs(d))^2)
+ 2*log(abs(d))*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*((p
i - pi*sgn(d) + 2)*cos(1/2*pi*x*sgn(d) - 1/2*pi*x - x)/((pi - pi*sgn(d) + 2)^2 + 4*log(abs(d))^2) + 2*log(abs(
d))*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*(-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) - 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)) - abs(d)^x*(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) + 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))

________________________________________________________________________________________

Mupad [B]
time = 0.02, size = 22, normalized size = 0.69 \begin {gather*} -\frac {d^x\,\left (\cos \left (x\right )-\ln \left (d\right )\,\sin \left (x\right )\right )}{{\ln \left (d\right )}^2+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________