How do I solve this integral? $\int e^{-t/2}\sin(3t) dt$? 
Possible Duplicate:
Name of this identity? $\int e^{\alpha x}\cos(\beta x)  \space dx = \frac{e^{\alpha x} (\alpha \cos(\beta x)+\beta \sin(\beta x))}{\alpha^2+\beta^2}$ 

I might have missed a technique from Calc 2, but this integral is holding me up.  When I checked with WolframAlpha, it used a formula I didn't recognise.

How do I solve $\int e^{-t/2}\sin(3t) dt$?

The formula WolframAlpha uses is this:
$$\int e^{\alpha t}\sin(\beta t)dt=\frac{e^{\alpha t}(-\beta \cos(\beta t)+\alpha \sin(\beta t)}{\alpha ^2+\beta ^2}$$
I don't know where this formula comes from.
 A: The trick is to integrate by parts twice, and note that you have "cycled" back to the start". Here's a simpler example, which you can mimic to solve your problem:
$$\int e^x\sin x\,dx=e^x\sin x-\int e^x\cos x\,dx=e^x\sin x-\left[e^x\cos x-\int e^x(-\sin x)dx\right]$$
Looking at the first part and the last part and solving for $\int e^x\sin x\,dx$ you get the answer:
$$
2\int e^x\sin x\,dx=e^x\sin x-e^x\cos x
$$
$$
\int e^x\sin x\,dx=e^x(\sin x-\cos x)/2
$$
Your problem will be slightly more difficult because it contains coefficients in the exponential and trig function. If you are careful and apply the chain rule correctly and carefully, you will have no problem.
A: In general, if you want to find $$ \int e^{ax}\cdot \sin{bx}\cdot dx$$ you can argue as follows:
Note that for any $\alpha$ or $\beta$, you have
$$\eqalign{
  & \frac{d}{{dx}}\left( {{e^{\alpha x}}\sin \beta x} \right) = \alpha {e^{\alpha x}}\sin \beta x + \beta {e^{\alpha x}}\cos \beta x  \cr 
  & \frac{d}{{dx}}\left( {{e^{\alpha x}}\cos \beta x} \right) = \alpha {e^{\alpha x}}\cos \beta x - \beta {e^{\alpha x}}\sin \beta x \cr} $$
so that any integral of the form 
$$ \int e^{\alpha x}\cdot \sin{\beta x}\cdot dx$$ 
is a linear combination of the former functions. Let's then find $c_1$ and $c_2$ such that
$$\frac{d}{{dx}}\left( {{c_1}{e^{\alpha x}}\sin \beta x + {c_2}{e^{\alpha x}}\cos \beta x} \right) = {e^{\alpha x}}\sin \beta x$$
$${c_1}\alpha {e^{\alpha x}}\sin \beta x + {c_1}\beta {e^{\alpha x}}\cos \beta x + {c_2}\alpha {e^{\alpha x}}\cos \beta x - {c_2}\beta {e^{\alpha x}}\sin \beta x = {e^{\alpha x}}\sin \beta x$$
This means we need
$$\eqalign{
  & {c_1}\alpha  - {c_2}\beta  = 1  \cr 
  & {c_1}\beta  + {c_2}\alpha  = 0 \cr} $$
This will yield with little work
$$\eqalign{
  & {c_1} = \frac{\alpha }{{{\alpha ^2} + {\beta ^2}}}  \cr 
  & {c_2} =  - \frac{\beta }{{{\alpha ^2} + {\beta ^2}}} \cr} $$
which means that, in general:
$$\int {{e^{\alpha x}}} \cdot\sin \beta x\cdot dx = {e^{\alpha x}}\frac{{\alpha \sin \beta x - \beta \cos \beta x}}{{{\alpha ^2} + {\beta ^2}}} + C$$
Analogously, you will get that
$$\int {{e^{\alpha x}}} \cdot\cos \beta x\cdot dx = {e^{\alpha x}}\frac{{\alpha \cos \beta x + \beta \sin \beta x}}{{{\alpha ^2} + {\beta ^2}}} + C$$
This is the same as here but the system won't let me link.
