# Problems with NSolve

In 12.2.0 for Microsoft Windows (64-bit) (December 12, 2020), once defined:

eqn1 = {Cos[t] == 0, 0 < t < Pi};
eqn2 = {TrigToExp[Cos[t]] == 0, 0 < t < Pi};


solving the respective equations:

sol1 = NSolve[eqn1, WorkingPrecision -> 5]
sol2 = NSolve[eqn2, WorkingPrecision -> 5]


we get:

{{t -> 1.5708}}

{}

therefore, through the checks:

Cos[t] == TrigToExp[Cos[t]] // Simplify
eqn1 /. sol1
eqn2 /. sol1


we get:

True

{{True, True}}

{{True, True}}

Am I missing something or is something wrong in NSolve?

I am not sure why you had to use WorkingPrecision -> 5 for.

But due to your use of TrigToExp, NSolve will now do it if you add the domain Complexes

eqn2={TrigToExp[Cos[t]]==0,0<t<Pi};
sol2=NSolve[eqn2,Complexes,WorkingPrecision->5]


Help on NSolve says

assumes by default that quantities appearing algebraically in inequalities are real

Compare to

 sol2=NSolve[eqn2,WorkingPrecision->5]
(*  {} *}

• I was missing this detail, thanks! WorkingPrecision I used it to get True everywhere in checks. Thanks again! – TeM May 12 at 9:35