Solution (source code)

= Solution

Write $e,h,f$ for the standard generators of the <sl2 Lie algebra>. For the representation $\phi$, use the normalization
$$
\Omega=\phi(e)\phi(f)+\phi(f)\phi(e)+\frac12\phi(h)^2.
$$
This is the quadratic <Casimir element>, and by assumption it commutes with every $\phi(x)$.

<Schur lemma> says that an endomorphism of a finite-dimensional irreducible complex representation which commutes with the representation is a scalar. Hence $\Omega=cI_V$ when $V$ is irreducible.

Let $v$ be a <highest-weight representation>[highest-weight vector] of highest weight $m$, so $ev=0$ and $hv=mv$. Since $[e,f]=h$,
$$
efv=(fe+h)v=mv,
\qquad fev=0.
$$
Therefore
$$
\Omega v=\left(m+\frac12m^2\right)v
=\frac12m(m+2)v.
$$
It follows from scalarity that
$$
\boxed{\Omega=\frac12m(m+2)I_V}.
$$
This is the <Casimir eigenvalue for sl2> in the chosen normalization.