0

I first tried this command:

NSolve[(2 Cos[x] Sin[x])/x^2 - (2 Sin[x]^2)/x^3 == 0, x, Reals]

which yields "This system cannot be solved with the methods available to NSolve.". But when I change it to

NSolve[{(2 Cos[x] Sin[x])/x^2 - (2 Sin[x]^2)/x^3 == 0, Element[x, Interval[{0.5, 10}]]}, x, Reals]

I get all solutions of the given interval as long as the interval does not touch zero.

Even more puzzling, when using Solve without interval I get no solutions which was to expect but when I do

Solve[{(2 Cos[x] Sin[x])/x^2 - (2 Sin[x]^2)/x^3 == 0, Element[x, Interval[{1/2, 10}]]}, x, Reals]

(the above with solve) I get

{{x -> {\[Pi]}}, {x -> {2 \[Pi]}}, {x -> {3 \[Pi]}}, {x -> \ {Root[{-Sin[#1] + Cos[#1] #1 &, 4.4934094579090641753}]}}, {x -> {Root[{-Sin[#1] + Cos[#1] #1 &, 7.7252518369377071642}]}}}

which are pseudo solutions which are however often easier to work with.

So why do Solve and NSolve struggle with this kind of equation and how can I work with that when not expecting it?

chr
  • 175
  • 1
  • 6

0 Answers0