I have this function for reals $0<x<\pi$. $$f(x)=(3 \pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-8 \pi x+5 \pi ^2}\right)-\frac{\pi x}{\pi -x}+\pi \right)\right)\\-(\pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-8 \pi x+5 \pi ^2}\right)+\frac{\pi ^2}{\pi -x}\right)\right)$$
I try NSolve to obtain all the roots of the function over the domain, but, it seems that Mathematica needs much time to produce all the roots.
Is there any alternative for NSolve or Solve to obtain all the roots? Any comments are appreciated.
f = -(\[Pi] - 2 x)^2 Sin[ 1/2 (\[Pi]^2/(\[Pi] - x) + ArcCsc[(4 \[Pi] (\[Pi] - x) Csc[\[Pi]^2/(\[Pi] - x)])/( 5 \[Pi]^2 - 8 \[Pi] x + 4 x^2)])] + (3 \[Pi] - 2 x)^2 Sin[ 1/2 (\[Pi] - (\[Pi] x)/(\[Pi] - x) + ArcCsc[(4 \[Pi] (\[Pi] - x) Csc[\[Pi]^2/(\[Pi] - x)])/( 5 \[Pi]^2 - 8 \[Pi] x + 4x^2)])];
x/.NSolve[f==0 && 0<x<[Pi]]


Is there any alternative for NSolve or Solve to obtain all the roots?You can look at these: find-all-roots-in-range and finding-all-roots-to-equation and find-all-roots-in-the-interval-of-nonlinear-equation – Nasser Oct 01 '21 at 20:26