# Solve the equation x^2+2*x+10=0 using sympy

this code not working

``````     from sympy import*
x= symbols('x')
quadraticExpression = x**2 + x*2 + 10

There is a missing closing parenthese on the last line. Apart from that, the code merely prints the expression. You want to use the `solveset` function described here:

https://docs.sympy.org/latest/tutorial/solvers.html

You can choose the complex or real domain. (In case you donâ€™t know what a complex number is, you want the real domain.)

``````Python 3.8.2+ (heads/3.8:3e72de9e08, Apr 16 2020, 12:25:15)
[GCC 9.3.0] on linux
Yes, it is the solution. The equation x**2 + 2x + 10 = 0 has exactly two complex solutions, which are -1 - 3i and -1 + 3i. If you are not aware of mathematiciansâ€™ clever and for beginners very confusing invention of the so-called â€śimaginaryâ€ť number i such that i**2 = -1, just pass `domain=S.Reals`. Complex numbers are a superset of real numbers: here, neither of the two complex solutions is a real number, so you get `EmptySet`, which means that the equation has no real solution.