Evaluating the integral: $ I = \int e^{\frac xa} \sin x \, \mathrm dx$

HINT \begin{align*} \int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x = a\exp\left(\frac{x}{a}\right)\sin(x) - a\int\exp\left(\frac{x}{a}\right)\cos(x)\mathrm{d}x \end{align*}

Analogously, we have \begin{align*} \int\exp\left(\frac{x}{a}\right)\cos(x)\mathrm{d}x = a\exp\left(\frac{x}{a}\right)\cos(x) + a\int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x \end{align*}

Therefore we have \begin{align*} \int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x = a\exp\left(\frac{x}{a}\right)(\sin(x) - a\cos(x)) - a^{2}\int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x \end{align*}

Can you take it from here?


There are several issues here.

  1. Your $(\ast)$ should read $\int e^{x/a}u(x)dx=e^{x/a}(au-a^2u^\prime+a^3u^{\prime\prime}-\cdots)+C$.
  2. We have $\int e^{x/a}\sin xdx=e^{x/a}(a\sin x-a^2\cos x-a^3\sin x+\cdots)+C$. Thanks to the powers of $a$, you can use a geometric series, $\frac{a}{1+a^2}e^{x/a}(\sin x-a\cos x)+C$. You can verify by differentiation this is correct.
  3. There are certain convergence issues we have to either address or gloss over to use $(\ast)$, or the geometric series above. (You can understand the $a\to1^-$ limit with a careful understanding of this.) A safer approach is @user1337's or, if you're happy with complex methods, $$\int e^{x/a}\sin xdx=\Im\int e^{(1/a+i)x}dx=\Im\frac{1}{1/a+i}e^{(1/a+i)x}+C,$$which gets you to the above result fairly quickly. (For complex $a$, write the integrand as $\frac{e^{(1/a+i)x}-e^{(1/a-i)x}}{2i}$ instead.)