VerifySolutions¶
Status: Experimental
present and registered, but lightly documented and not yet covered by dedicated tests.
Description¶
VerifySolutions is an option for Solve. With VerifySolutions -> True every returned solution is back-substituted into the equation(s) and dropped when PossibleZeroQ proves the residual non-zero; solutions that verify or are undecidable (Root[], free parameters, ConditionalExpression) are kept. Default: Automatic (per-specialist verification, e.g. radicals).
Examples (4)¶
Every input below was run against the current Mathilda build and its output recorded.
Applications (4)¶
In[1]:= VerifySolutions
Out[1]= VerifySolutions
In[2]:= Solve[x^2 - 3 x + 2 == 0, x, VerifySolutions -> True]
Out[2]= {{x -> 1}, {x -> 2}}
In[3]:= Solve[Sqrt[x] == -2, x, VerifySolutions -> True]
Out[3]= {}
In[4]:= Solve[x^4 == 1, x, VerifySolutions -> True]
Out[4]= {{x -> -1}, {x -> 1}, {x -> -I}, {x -> I}}
Implementation notes¶
VerifySolutions is an option symbol for Solve, not a callable function. In src/solve.c it is listed in is_known_option_name, so VerifySolutions -> _ is peeled off the argument list as a valid option (is_option_arg) rather than treated as a variable. However apply_option currently does nothing with it ā the value is parsed and accepted but not yet wired into the polynomial solver (the docstring notes Default: Automatic. Reserved.). It exists so user code can pass the option without error.
Attributes: none registered.
References¶
- Source:
src/solve/solve.c - Specification:
docs/spec/builtins/solutions-of-equations.md
Notes & additional examples¶
Notes¶
VerifySolutions is a Solve option (default Automatic), not a function;
the bare symbol evaluates to itself. It controls whether each returned solution
is checked by back-substitution before being reported, discarding spurious
roots introduced during the solving process.