\(\Leftrightarrow12x^2-42x-\left(8x-28\right)+\left(3x-12x^2\right)-\left(5-20x\right)=-31\)
\(\Leftrightarrow12x^2-42x-8x+28+3x-12x^2-5+20x=-31\)
\(\Leftrightarrow\left(12x^2-12x^2\right)-x\left(42+8\right)+x\left(3+20\right)+28-5=-31\)
\(\Leftrightarrow0-50x+23x+23=-31\)
\(\Leftrightarrow-27x=-31-23\)
\(\Leftrightarrow-27x=-54\)
\(\Leftrightarrow x=\left(-54\right)\div\left(-27\right)\)
\(\Leftrightarrow x=2\)
Vậy x=2