solving $\cos z + \sin z = i$ I found a solution but when testing it, it does not work....?  
$$\cos z + \sin z = i \\ \frac{e^{iz} + e^{-iz}}{2} + \frac{e^{iz} - e^{-iz}}{2i} = i \\ e^{2iz}(1+i) + 2e^{iz} + i - 1 = 0 \\ e^{iz} = \frac{-1 \pm \sqrt{2-i}}{1+i} \\ z = -i \mathrm{Log}\left(\frac{-1\pm\sqrt{2-i}}{1+i}\right) + k2\pi$$  
Upon testing it in W|A with $k=0$, I don't get the required result $(=i)$. I'm not sure where I went wrong and I did this a few times already.
 A: I get
$$\sqrt2\cos\left(z-\frac\pi4\right)=i,$$
$$\sin\left(z+\frac{\pi}4\right)=\frac{i}{\sqrt2},$$
$$e^{iw}-e^{-iw}=-\sqrt2\qquad(w=z+\pi/4)$$
$$e^{iw}=\frac{\sqrt2\pm\sqrt{6}}2$$
$$w=\pm i\ln\left(\frac{1+\sqrt3}{\sqrt2}\right)+2k\pi$$
$$z=\pm i\ln\left(\frac{1+\sqrt3}{\sqrt2}\right)+2k\pi-\frac\pi4.$$
A: You may have applied the quadratic form incorrectly as I can see.
You have:
$$e^{2iz}(1+i)+2e^{iz}-1+i=0$$
with $a=1+i,b=2,c=-1+i$.
$$\implies e^{iz}=\frac{-2\pm \sqrt{2^2-4(i+1)(i-1)}}{2(1+i)}=\frac{-2\pm\sqrt{4-4(i^2-1)}}{2(i+1)}=\frac{-2\pm\sqrt{4-4(-2)}}{2(i+1)}$$
$$=\frac{-2\pm\sqrt{4+8}}{2(i+1)}=\frac{-2\pm\sqrt{12}}{2(i+1)}=\frac{-2\pm2\sqrt{3}}{2(i+1)}=\frac{-1\pm\sqrt{3}}{1+i}$$.
$$\therefore iz=\ln\left(\frac{-1\pm\sqrt{3}}{1+i}\right)\Rightarrow z=-i\ln\left(\frac{-1\pm\sqrt{3}}{1+i}\right)+2k\pi$$
which I believe can be further simplified with complex algebra.
A: To solve $\sin z+\cos z=i$
I'll use the following formulas
$\sin z=\dfrac{2 t}{t^2+1},\cos z=\dfrac{1-t^2}{t^2+1}$ where $t=\tan\dfrac{z}{2}$
I get the equation
$(1+i) t^2-2 t+(-1+i)=0$ 
$t=\dfrac{1\pm \sqrt{3}}{1+i}$
$\tan \dfrac{z}{2}=\dfrac{1\pm \sqrt{3}}{1+i}$
$z=2\arctan \dfrac{1\pm \sqrt{3}}{1+i} +k\pi,\;\forall k\in\mathbb{Z}$
