Expression simplification for linear equations