Answer
$$\int e^{-y}\cos ydy=\frac{e^{-y}}{2}(\sin y-\cos y)+C$$
Work Step by Step
$$A=\int e^{-y}\cos ydy$$
Set $u=\cos y$ and $dv=e^{-y}dy$
Then we have $du=-\sin ydy$ and $v=-e^{-y}$
Using the formula $\int udv= uv-\int vdu$:
$$A=-e^{-y}\cos y-\int(-e^{-y})(-\sin y)dy$$ $$A=-e^{-y}\cos y-\int e^{-y}\sin ydy$$
Set $u=\sin y$ and $dv=e^{-y}dy$
Then we have $du=\cos ydy$ and $v=-e^{-y}$
Using the formula $\int udv= uv-\int vdu$:
$$A=-e^{-y}\cos y-\Big(-e^{-y}\sin y-\int(-e^{-y})\cos ydy\Big)$$ $$A=-e^{-y}\cos y-\Big(-e^{-y}\sin y+\int e^{-y}\cos ydy\Big)$$
We notice that above, $\int e^{-y}\cos ydy$ is exactly the given integral to solve, meaning it equals $A$.
Therefore, $$A=-e^{-y}\cos y-\Big(-e^{-y}\sin y+A\Big)+C$$ $$A=-e^{-y}\cos y+e^{-y}\sin y-A+C$$ $$2A=-e^{-y}\cos y+e^{-y}\sin y+C$$ $$A=\frac{-e^{-y}\cos y+e^{-y}\sin y}{2}+C=\frac{e^{-y}}{2}(\sin y-\cos y)+C$$