# What does Automatic mean in the context of VerifySolutions for NSolve?

A quick check for the options of NSolve yields:

 Options[NSolve]

 {Method -> Automatic, RandomSeed -> 0,
VerifySolutions -> Automatic, WorkingPrecision -> Automatic}


Does anyone know what VerifySolutions -> Automatic means in this case? Automatic to me usually means 'make reasonable guess', as in PlotRange -> Automatic, but I don't know what Mathematica thinks is reasonable, and I don't know how to dig any deeper into the underlying code in Mathematica.

I should add that I know how to verify solutions by hand by feeding them back into the original equations. I also know that I can force the option by setting VerifySolutions -> True. I have found that this typically takes a bit longer for the equations I am solving which makes me think Automatic means False in my case. But in either case, I am none-the-less still curious about my original question.

• Have you looked at the documentation for VerifySolutions? – J. M. is in limbo Nov 9 '17 at 15:17
• @ J.M. I did... it says automatic means it 'automatically determine whether to verify'...which seems a bit tautological unless I am missing something... – DJBunk Nov 9 '17 at 15:31
• The docs for NSolve[] also give a short demo. – J. M. is in limbo Nov 9 '17 at 15:34
• @ J.M. I saw that too. It says 'NSolve verifies solutions obtained using non-equivalent transformations...' I wasn't sure if I should interpret that as 'NSolve will verify under certain unstated conditions ' or 'NSolve will always verify under any conditions '. I suppose I could restate my question as, 'if NSolve always verifies the solutions, why isn't VerifySolutions->True the default? – DJBunk Nov 9 '17 at 15:51
• Typical cases that get the attention of the verifier include presence of denominators or radicals in the original equations. – Daniel Lichtblau Nov 9 '17 at 16:08

From the documentation of VerifySolutions:

VerifySolutions controls whether the solutions obtained using non-equivalent transformations or numerical methods should be verified.

One example of a non-equivalent transformation is when inverse functions are being used. Here is an example. First the default case with VerifySolutions->Automatic:

TracePrint[
NSolve[Sin[x] == .5, x],
Sin[_Real],
TraceInternal->True
]


Sin[0.52359877559830]

NSolve::ifun: Inverse functions are being used by NSolve, so some solutions may not be found; use Reduce for complete solution information.

{{x -> 0.523599}}

Now, repeat with VerifySolutions->False:

TracePrint[
NSolve[Sin[x] == .5, x, VerifySolutions->False],
Sin[_Real],
TraceInternal->True
]


NSolve::ifun: Inverse functions are being used by NSolve, so some solutions may not be found; use Reduce for complete solution information.

{{x -> 0.523599}}

Notice that this time the solution isn't verified (i.e., this time Sin[0.52359877559830] is not evaluated to check whether it's zero).