I read about the Casimir element just recently and I found it a bit difficult to wrap my mind around the definition(s). In fact, I have seen two different definitions. For concreteness, let $\mathfrak{g}$ be the Lie algebra of a connected (semi-simple) Lie group $G$, and $\pi\colon G\to GL(V)$ a group representation of $G$ on an $n$-dimensional vector space $V$. (I assume for simplicity that an orthonormal basis relative to the Killing form exists.)
(Definition as a matrix using the derived representation) For an orthonormal basis $\{X_i\}$ of $\mathfrak{g}$, the Casimir element is defined to be the matrix $\Omega=\sum d\pi(X_i)^2$ in $\text{Mat}(n\times n)$.
(Definition as an element in the center of enveloping Lie algebra) For an orthonormal basis $\{X_i\}$ of $\mathfrak{g}$ the Casimir element is defined by $\Omega=\sum X_i^2$ in $\mathfrak{U}(\mathfrak{g})$.
My question is how are these two definitions related? For instance, if $\pi$ is irreducible, it is obvious to me from Schur's Lemma that $\Omega$ in the first definition is a scalar matrix. Can this result be somehow transferred to the $\Omega$ in the second definition? More generally, is any of these closer to `the right way' of thinking about the Casimir element?
Any explanation is appreciated!
The second way is closer to rigth understanding of the Casimir elements. This approаch can be extended to define a generalized Casimir elements: Let $\{u_i \}$ and $\{u_i^* \}$ be basis of two dual representations of Lie algebra $g$ in its universal enveloping agebra $\mathfrak{g}$. Then the element $$ \sum_i u_i u^*_i, $$ lies in the center $Z(g)$ and called the generalised Casimir element.