Complex functions and residues I know that, since the complex function
$$f(z)=\frac{1}{z(e^z-1)}$$
have a pole of 2nd order in z=0, I should be able to represent it as:
$$f(z)=\frac{g(z)}{(z-0)^2}$$
Being g(z) a function that is both analytic and different from zero when z=0.

But the only expression for g(z) that I was able to get to was
$$g(z)=\frac{z}{e^z-1}$$
wich doesn't meets the criteria explained before.

Can anyone say what am I getting wrong?
Does f(z) really have a pole of 2nd order in zero?
I'm just taking my first complex analysis but from my understanding you are correct in the fact that pole z= 0 is of second order.

Using the formula for higher order poles.

$$Res_{z \rightarrow x} = \frac{1}{(n-1)!} lim_{z\rightarrow x} \frac{d^{n-1}}{dz^{n-1}}(z-x)^n f(z)$$

Where x is the pole 0 and n is the order.

Using this formula:

$$Res_{z \rightarrow 0} = \frac{1}{(2-1)!} lim_{z\rightarrow 0} \frac{d^{2-1}}{dz^{2-1}}(z-0)^2 f(z)$$

$$Res_{z \rightarrow 0} = \frac{1}{(1)!} lim_{z\rightarrow x} \frac{d}{dz}(z-0)^2 \frac{1}{z(e^z - 1)}$$

$$  lim_{z\rightarrow 0} \frac{d}{dz}(z)^2 \frac{1}{z(e^z - 1)}$$
 $$  lim_{z\rightarrow 0} \frac{d}{dz}\frac{z }{(e^z - 1)}$$
 $$  lim_{z\rightarrow 0} \frac{(e^z - 1) - (e^z)z}{(e^z - 1)^2}$$

Now just do a couple L'Hopitals and you should get:
Res at z=0:
$$= - \frac{1}{2}$$
I'm just taking my first complex analysis but from my understanding you are correct in the fact that pole z= 0 is of second order.

Using the formula for higher order poles.

$$Res_{z \rightarrow x} = \frac{1}{(n-1)!} lim_{z\rightarrow x} \frac{d^{n-1}}{dz^{n-1}}(z-x)^n f(z)$$

Where x is the pole 0 and n is the order.

Using this formula:

$$Res_{z \rightarrow 0} = \frac{1}{(2-1)!} lim_{z\rightarrow 0} \frac{d^{2-1}}{dz^{2-1}}(z-0)^2 f(z)$$

$$Res_{z \rightarrow 0} = \frac{1}{(1)!} lim_{z\rightarrow x} \frac{d}{dz}(z-0)^2 \frac{1}{z(e^z - 1)}$$

$$  lim_{z\rightarrow 0} \frac{d}{dz}(z)^2 \frac{1}{z(e^z - 1)}$$
 $$  lim_{z\rightarrow 0} \frac{d}{dz}\frac{z }{(e^z - 1)}$$
 $$  lim_{z\rightarrow 0} \frac{(e^z - 1) - (e^z)z}{(e^z - 1)^2}$$

Now just do a couple L'Hopitals and you should get:
Res at z=0:
$$= - \frac{1}{2}$$