Evaluating $ \int {e^x \sin (k \pi x) } dx $ I'm trying to integrate $$ I = \int {e^x \sin (k \pi x)} dx. $$ I've used Matlab and Wolfram Alpha, which have both given me the result $$ I = \frac{e^x(\sin (k \pi x) - \cos (k \pi x))}{k^2 \pi^2 +1 }.$$
How did these programs get this result? 

$$I = \int e^x \sin (k \pi x) dx\\=\sin k\pi x\int e^xdx-\int k\pi\cos k\pi x \left(\int e^xdx \right)dx\\=e^x\sin k\pi x-k\pi\int e^x\cos k \pi x\\=e^x\sin k\pi x-k\pi\left(\cos k\pi x\int e^x dx-\int k\pi \sin k\pi x\left(\int e^x dx\right)dx\right) \\
I=e^x(\sin k \pi x -k\pi\cos k\pi x)+k^2\pi^2 I+c$$
$$I=\frac{e^x(\sin k\pi x-k\pi\cos k\pi x)}{1+k^2\pi^2}+c$$

In general:
$$I_{a,b}=\int e^{ax}\sin bx dx=\frac{e^{ax}(a\sin bx-b\cos bx)}{a^2+b^2}+c$$
