I know that a magnetic dipole moment is given by $$\mu=\frac {-e}{2m}I$$ and that the z component of angular momentum is $$m_j\hbar.$$ However, I have also seen that angular momentum $I$ is given by $$I=\hbar\sqrt{l(l+1)}.$$ Is this also the component in the z direction or is it different? Are both expressions for angular momentum right? Which one do I use to answer the question?
(This question was asked in a problem sheet that I have been asked to do over the vacation. See below for context of question).