# Finding the derivative of a piecewise function of a complex variable

I am working on an assignment that involves finding the derivative evaluated at zero of this piecewise function of a complex variable:

Let $g:\mathbb{C}\rightarrow\mathbb{C}$ be defined by:

$g(z)=\begin{cases} \frac{z}{e^{z}-1} & \,\,\, z\neq0\\ 1 & \,\,\, z=0 \end{cases}$

I have shown these things about $g$ (the assignment asks for this):

• $g$ is continuous on the disk $|z|<2\pi$
• $g(z)=\frac{z}{2i}\cot (\frac{z}{2i})- \frac{z}{2i}$

Now the assignment asks me to find $g'(0)$ and to show that $g$ is analytic for $|z|<2\pi$. I am given a hint, which is "Use L'Hopital's rule."

I am unsure of which approach to use in this case, and I'm unsure of what makes sense theoretically.

My questions:

1. With a function like this, can I in general just take $\frac{d}{dz}\,\lbrack\frac{z}{e^{z}-1}\rbrack$ and take the limit to whatever point that causes trouble? In this case, $\frac{d}{dz}\,\lbrack\frac{z}{e^{z}-1}\rbrack$ gives a $\frac{0}{0}$-expression, where I can use L'Hopital as suggested in the hint. $\lim_{z\rightarrow 0}\frac{d}{dz}\,\lbrack\frac{z}{e^{z}-1}\rbrack$ = $-\frac{1}{2}$.

2. Using the definition of the derivative, $\lim_{z\rightarrow o}\frac{g(z)-g(0)}{z-0}$ (using L'Hopital's rule) also yields $-\frac{1}{2}$. Is this equivalent to 1.?

3. With the approach in 1. and 2., are we taking into account the many ways in which $z$ can approach $0$ in the complex plane? I would like to say that since $\frac{z}{e^{z}-1}$ is made up of such nice functions, nothing too crazy can happen, but I'm not sure.

When I think about $g(z)$, I think that is just the function $\frac{z}{e^{z}-1}$ that happens to be undefined around zero, but by taking the limits to $z=0$, we're checking the behavior of $\frac{z}{e^{z}-1}$ close to $z=0$. Oh, the limit exists there? Well then the behavior of $\frac{z}{e^{z}-1}$ checks out arbitrarily close to $z=0$, so let's just define it to be the its limit value there: 1.

I would like to think about $g'(z)$ in the same way; find out where $\frac{d}{dz}\,\lbrack\frac{z}{e^{z}-1}\rbrack$ is undefined and check its behavior there. Are these sensible intuitions? Or are there some nice, clean ways to think about this that I don't know about?

-