Two Dimensional Lie Algebra

In $2$ dimensional case, we have $[x,y]=0$ or $[x,y]=z=ax+by$ if $a$ is zero then by changing the variables you get what you looking for but if $a$ was not zero then divide both sides by $a$ so that it becomes $$[x,y/a]=x+by/a$$ now change the $x+by/a$ variable to $z$. $$[ z-by/a,y/a]=[z,y/a]=z$$ then change $y/a$ to $u$ so that you get $[z,u]=z$


By linearity, it is enough to check the Jacobi identity on the basis elements. When there are repetitions on the Jacobi identity it is satisfied automatically. Therefore you have to check nothing!