I'm having some issues finding how to series expand some complex functions that my professor gave past years in exams. For example, in this exercise, it is asked to find the first two terms of the Taylor series of the function $$f(z) = \frac{\sqrt{z}}{(z+i)^{2}}$$ considering that we take $\sqrt{z} = \sqrt{|z|} + e^{(i\operatorname{arg}z )/ 2}$. I tried by expanding $\sqrt{z+i}$ at $z=0$ and from this I got: $$ f(z) \simeq \frac{i + \frac{1}{2}z + \left(\frac{i}{2} - \frac{i}{2}\right)}{(z+i)^2}= \frac{\frac{i}{2} + \frac{1}{2}(z+i)}{(z+i)^2} = \frac{i}{2(z+i)^2} + \frac{1}{2(z+i)^2} $$ but from what wolfram alpha tells me, this is wrong.
Another example would be expanding the following: $$ g(z) = \frac{e-e^{iz}}{z+ia} $$ at $z=-ia$. To do this, he uses (I got solutions for this problem exactly) the following procedure:
$\begin{align*} g(z) &= \frac{e-e^{i(z+ia-ia)}}{z+ia} \\ &= \frac{e - e^a e^{i(z+ia)}}{z+ia} \\ &= \frac{e-e^a \sum_{n=0}^{+\infty}\frac{i^n}{n!}(z+ia)^n}{z+ia} \\ &= \frac{e-e^a}{z+ia} - e^a \sum_{n=1}^{+\infty} \frac{i^n}{n!}(z+ia) ^{n-1} \\ &= \frac{e-e^a}{z+ia} - e^a \sum_{p=0}^{+\infty} \frac{i^{p+1}}{(p+1)!} (z+ia)^p \end{align*}$
My question with this is: is there a way to alway compute this series expansions without having to think at tricks to achieve that like adding and subtracting $\pm ia$ on the exponential? I mean, when I see it, the procedure is obvious, but during a test I don't know if I would be capable of thinking of something like this. Thank you in advance and sorry for the stupid question.