How do I solve this integral?

As stated the title, I get to a point which I can't do anything, and I'm sure I've made a mistake some where, here is my full working out:

$\int {e}^{ix}\mathrm{cos}(x)dx\phantom{\rule{0ex}{0ex}}u={e}^{ix}\text{|}{u}^{\prime}=i{e}^{ie}\phantom{\rule{0ex}{0ex}}v=\mathrm{sin}(x)\text{|}{v}^{\prime}=\mathrm{cos}(x)\phantom{\rule{0ex}{0ex}}{e}^{ix}\mathrm{sin}(x)-\int i{e}^{ix}\mathrm{sin}(x)dx+C\phantom{\rule{0ex}{0ex}}{e}^{ix}\mathrm{sin}(x)-i\int {e}^{ix}\mathrm{sin}(x)dx+C\phantom{\rule{0ex}{0ex}}u={e}^{ix}\text{|}{u}^{\prime}=i{e}^{ie}\phantom{\rule{0ex}{0ex}}v=-\mathrm{cos}(x)\text{|}{v}^{\prime}=\mathrm{sin}(x)\phantom{\rule{0ex}{0ex}}{e}^{ix}\mathrm{sin}(x)-i(-{e}^{ix}\mathrm{cos}(x)+i\int {e}^{ix}cos(x)dx)+C\phantom{\rule{0ex}{0ex}}Let\int {e}^{ix}\mathrm{cos}(x)dx=I\phantom{\rule{0ex}{0ex}}I={e}^{ix}(\mathrm{sin}(x)+i\mathrm{cos}(x))-{i}^{2}I+C$

But (${i}^{2}=-1$) so the equation should become:

$I={e}^{ix}(\mathrm{sin}(x)+i\mathrm{cos}(x))+I+C$

And this is where I'm stuck, I can't simply take $I$ away from both sides, that would make

${e}^{ix}(\mathrm{sin}(x)+i\mathrm{cos}(x))=0$

What have a messed up in the process? And just to make it clear someone in a previous question didn't under understand what ${v}^{\prime}$ was, it's the same as $\frac{dv}{dx}$, thank you in advance.