Integration by parts of $\cos(x)e^{-x}dx$ I do the integral but I end up getting the original $\cos(x)e^{-x}dx$ on both sides and canceling them out resulting in no solution.
Can I get a step by step break down of how to solve?

Letting $u = e^{-x}$ and $dv = \cos x \, dx$ so that $du = -e^{-x} \, dx$ and $v = \sin x$, we obtain:
\begin{align*}
\int e^{-x}\cos x  \, dx
&= (e^{-x})(\sin x) - \int (\sin x)(-e^{-x} \, dx) \\
&= e^{-x}\sin x + \int e^{-x}\sin x \, dx
\end{align*}
Letting $u = e^{-x}$ and $dv = \sin x \, dx$ so that $du = -e^{-x} \, dx$ and $v = -\cos x$, we obtain:
\begin{align*}
\int e^{-x}\cos x  \, dx
&= e^{-x}\sin x + (e^{-x})(-\cos x) - \int(-\cos x)(-e^{-x} \, dx)\\
&= e^{-x}(\sin x -\cos x) - \int e^{-x}\cos x  \, dx
\end{align*}
which contains the original integral! Collecting like terms and dividing by $2$, we conclude that:
$$
\int e^{-x}\cos x  \, dx = \frac{1}{2}e^{-x}(\sin x -\cos x) + C
$$
