# Import: import sympy as sym # Defining symbols: x, a, b = sym.symbols('x, a, b') # Defining a symbolic expression, E1: E1 = a*x + b # Solving the equation E1 = 0 for x: E2 = sym.solve(E1, x) L = a*x H = -b E3 = sym.Eq(L, H) E4 = sym.solve(sym.Eq(L, H), x) # Displaying the symbolic solution of E1 = 0: print('E2:', E2) print('E4:', E4)