Compute $I=\int e^{it}\cos t\,dt$ Compute $I:=\int e^{it}\cos t\,dt$, where $i\in\mathbb{C}$.
Attempt: Let $u=e^{it}$, $dv=\cos t\,dt$. Then $du=ie^{it}\,dt$ and $v=\sin t$
Using  integration by parts, we have $I=u=e^{it}\sin t-i\int e^{it}\sin t\,dt$. Say $I_1:=\int e^{it}\sin t\,dt$. By the same method, we have $I_1=-e^{it}\cos t+i\cdot I$. So we get $ I=e^{it}\sin t-i(-e^{it}\cos t+i\cdot I)=e^{it}\sin t+ie^{it}\cos t+I$. 
Can anyone find my mistake?

$e^{it}\sin t+ie^{it}\cos t=ie^{it}(\cos t-i\sin t)=i$
so the two integrals differ by a constant.
I think you have no mistake - any integral has an undetermined constant; your two $I$ have different constants.
If you do it as a definite integral, then they differ by $i|_a^b=0$
