Given that the triangle CDE is similar to triangle CML, it means that the ratio of their corresponding sides are equal. It means that
CD/CM = DE/ML = CE/CL
CD = 20 + 12x + 2 = 12x + 22
CE = 30 + 12 = 42
20/12x + 22 = 12/42
By cross multipying, it becomes
12(12x + 22) = 20 * 42
144x + 264 = 840
144x = 840 - 264 = 576
x = 576/144
x = 4