Group delay `grpdelay` help text is confusing

Hi DSP experts,

Can someone please explain to me why it makes sense to calculate group delay using the second equation below. It is under “help grpdelay”

Theory: group delay, g(w) = -d/dw [arg{H(e^jw)}], is the rate of
change of phase with respect to frequency. It can be computed as:

d/dw H(e^-jw)
g(w) = -------------

Also, I could not figure out why d/dw B(e^-jw) = sum(k b_k e^-jwk)
Is a “-j” missing?

Note that,

d/dw B(e^-jw) = sum(k b_k e^-jwk)
d/dw A(e^-jw) = sum(k a_k e^-jwk)

Ntsanderh C. Azenui, PhD