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?
equation-solvingandtrigonometrytags. I guess this is almost a duplicate of Can Reduce really not solve for x here?. See also Solve symbolically a transcendental trigonometric equation and plot its solutions – Artes Jan 30 '18 at 18:43f[x_] = (2 Cos[x] Sin[x])/x^2 - (2 Sin[x]^2)/x^3;The problem with
x = 0is thatf[0]is only defined in the limit:
– Bob Hanlon Jan 30 '18 at 19:05f[0]isIndeterminatebutLimit[f[x], x -> 0]evaluates to0