a_1x + b_1y = c_1, a_2x+b_2y = c_2. First calculate determinants. W = |a_1, b_1; a_2, b_2| = a_1b_2 - b_1a_2. W_x = |c_1, b_1; c_2, b_2| = c_1b_2 - b_1c_2. W_y = |a_1, c_1; a_2, c_2| = a_1c_2 - c_1a_2. For W≠0 system of equations is with one solution: x = W_x / W y = W_y / W. For W=0 and W_x=0 and W_y=0 system of equations is with infinite solutions. For W=0 and if W_x≠0 or W_y≠0 then system of equations is with no solutions. Above formulas wrong when all coefficients a_1, b_1, a_2, b_2 equal 0.