Solve and checkLesson 14 of 48 · 7 min
State the solution domain
Use solveset to distinguish real and complex solution sets.
Maths refresher: Real and complex numbers
Real numbers lie on a number line. Complex numbers include the imaginary unit i with .
Every real square is nonnegative, so has no real solution. The values i and -i both square to -1.
A solving question includes its domain: the set of permitted values. A polynomial can have no real solutions but still have complex ones. State the domain explicitly instead of inferring it from how a symbol is printed.
solveset returns a mathematical set, such as FiniteSet, EmptySet or a more general set description. An empty real solution set means no real value satisfies the equation; it does not mean that the equation is meaningless or that no other domain has solutions.
Solve x squared plus one equal to zero over both reals and complexes. The imaginary unit I satisfies I squared equal to minus one. Future solvers can return ConditionSet when a general symbolic answer is unresolved; that is not the same as EmptySet.
Will have the same solution set over reals and complexes?
Write a prediction (optional)
Exact symbolic investigation
Select Run Python with the code unchanged.
Your saved draft is open. To use the published code, select Restore example in Tools. Use Recover draft to bring back your code.
Tools
About Python
Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗
Ctrl+Enter or ⌘+Enter runs Python.
Execution error
Technical error details
Your result
Python text output
Compare with the worked example
Executed from the published Python during the site build. Your own run appears above. Build environment ↗
Worked text output
Real solutions: EmptySet
Complex solutions: {-I, I}
Complex candidate residuals: [0, 0]
Read the starter result
Compare Real solutions with Complex solutions. The solver reads the supplied expression as equal to zero in each chosen domain. The Complex candidate residuals evaluate the original expression.
Edit and compare
Replace expression = x**2+1 with expression = x**2-1. Select Run Python. Compare the Real solutions and Complex solutions sets and use Complex candidate residuals to check the revised roots.
Scope. Symbolic solvers do not have closed-form answers for every equation; inspect the returned set and verify its interpretation.
Try a fresh case
What does EmptySet from a real-domain solve establish?
Need a hint?
Hint 1
Read the domain argument alongside the answer.
Hint 2
Restrict the conclusion to the set you asked about.