Example 1.
We test if certain subalgebras of are Cartan subalgebras. First define the standard matrix representation for as the space of trace-free matrices.
Calculate the structure equations for these matrices and initialize the resulting Lie algebra.
Let's check that is semi-simple.
Test to see if a list of vectors defines a Cartan subalgebra.
Since has 2 elements, this implies that the rank of is 2. We can use this information to simplify checking that other subalgebras are Cartan subalgebras
Here is a 2-dimensional Abelian subalgebra which is not self-normalizing and therefore not a Cartan subalgebra.
Example 2.
The notion of a Cartan subalgebra is not restricted to semi-simple Lie algebras. We define a solvable Lie algebra and test to see if some subalgebras are Cartan subalgebras.
Any subalgebra which is an ideal cannot be a Cartan subalgebra.