Given a general Lie algebra, is there a general procedure to find all its Casimir operator?

2$\begingroup$ If the Lie algebra is semisimple, then the center of its universal enveloping algebra is polynomial, and lists of good generators (often "good" means "homogeneous with respect to some grading") are known. In general, I think there is the Duflo theorem that $Z(U(\mathfrak g)) = \operatorname{Sym}(\mathfrak g)^{\mathfrak g}$ as rings, but the map is somewhat nontrivial. And anyway, this just moves the problem: certainly I don't know how, for a general Lie algebra, to compute the ring structure on $\operatorname{Sym}(\mathfrak g)^{\mathfrak g}$ (GIT quotient of adjoint action). $\endgroup$ – Theo JohnsonFreyd Aug 27 '11 at 14:08
I'm assuming you're thinking of some specific matrix representation $X_i \in \mathfrak{g}$ (let's assume it's the defining representation). Compute the Killing form, $\kappa_{ij} \doteq Tr (X_i\cdot X_j)$ (actually usually this is defined in the adjoint representation, but any faithful rep will do). The quadratic Casimir is then simply $ X_i \kappa_{ij} X_j$ (Einstein convention).
Other Casimirs can be obtained from the characteristic (secular) equation: define $X(\omega) = \omega^i X_i$. The characteristic equation is $\det\left( X(\omega)  \lambda I \right) = \sum\limits_{j} (\lambda)^{Nj} \phi_j(\omega) \equiv 0 $ ($N$ is the matrix dimension, and/or the dimension of the Lie algebra if you're using the adjoint representation). If you now perform the substitution $\omega^i \to X_i$ in the coefficients $\phi_j (\omega)$, you get Casimir invariants $\phi_j (X)$!
It might seem like the higher the representation, the more invariants you get, but in fact all the invariants can be expressed in terms of the fundamental invariants of the defining representation. I can't think of many references right at the moment, but e.g. Gilmore: Lie groups, physics and geometry pp. 140 has a nice explanation. Also, google the boldface texts above.

1$\begingroup$ I've opened a new post regarding a concrete application of the recipe that you've explained. I hope that you will take a look. Thanks in advance. mathoverflow.net/questions/312768/… $\endgroup$ – AndreaPaco Oct 14 '18 at 9:17

1$\begingroup$ wow blast from the past! Sorry but I haven't dealt with this stuff in a long time... anyway the answer by Vit Tucek in the post you linked seems pretty good at a glance $\endgroup$ – H. Arponen Oct 20 '18 at 19:41

$\begingroup$ Ah ok! I saw that the post was put 7 years ago and I imagined that in the meanwhile maybe you've changed field. Anyway thanks for your comment! $\endgroup$ – AndreaPaco Oct 21 '18 at 9:57
http://www.imath.kiev.ua/~ivanova/symmetry/Talks08/Boyko.pdf
Computation of Invariants of Lie Algebras by Means of Moving Frames Vyacheslav Boyko

$\begingroup$ The method in this paper is particularly suited for solvable Lie algebras, though, as it requires an explicit parametrisation of the adjoint group. Of course, the OP asks about "a general Lie algebra" so this goes some way towards answering the question. +1 $\endgroup$ – José FigueroaO'Farrill Aug 27 '11 at 17:12

4$\begingroup$ Due to "link rot", this answer is now useless :( Could anyone reproduce the author(s) & title of the linked article? $\endgroup$ – Danu Feb 10 '16 at 11:14