3
$\begingroup$

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?

$\endgroup$
4
$\begingroup$

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]

Mathematica graphics

Help on NSolve says

assumes by default that quantities appearing algebraically in inequalities are real

Compare to

 sol2=NSolve[eqn2,WorkingPrecision->5]
 (*  {} *}
$\endgroup$
1
  • $\begingroup$ I was missing this detail, thanks! WorkingPrecision I used it to get True everywhere in checks. Thanks again! $\endgroup$ – TeM May 12 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.