<s>[INST] Calculation of $\max$ and $\min$ value of $f(x) = \frac{x(x^2-1)}{x^4-x^2+1}.$ 
Calculation of $\max$ and $\min$ value of $$f(x) = \frac{x(x^2-1)}{x^4-x^2+1}$$

My try: We can write $$f(x) = \frac{\left(x-\frac{1}{x}\right)}{\left(x^2+\frac{1}{x^2}\right)-1} = \frac{\left(x-\frac{1}{x}\right)}{\left(x-\frac{1}{x}\right)^2+1}$$ 
Now put $\left(x-\frac{1}{x}\right)=t,x\ne0$. Then we get $$f(t) = \frac{t}{t^2+1} = \frac{1}{2}\left(\frac{2t}{1+t^2}\right)$$
Now put $t=\tan \theta$. Then $$f(\theta) = \frac{1}{2}\frac{2\tan \theta}{1+\tan^2 \theta} = \frac{1}{2}\sin 2\theta$$
So we get $$-\frac{1}{2}\leq f(\theta)\leq \frac{1}{2}\Rightarrow f(\theta)\in \left[-\frac{1}{2}\;,\frac{1}{2}\right]$$
My question is: Is my solution right? If not, then how can we solve it?
 [/INST] we have $x^4-x^2+1=(x^2-\frac 12)^2+\frac {3}{4}≥0$$$\frac{1}{2}-f(x)=1/2*{\frac { \left( {x}^{2}-x-1 \right) ^{2}}{{x}^{4}-{x}^{2}+1}}\geq 0$$
and $$f(x)+\frac{1}{2}=1/2*{\frac { \left( {x}^{2}+x-1 \right) ^{2}}{{x}^{4}-{x}^{2}+1}}\geq 0$$
thus $$|f(x)| \le \frac{1}{2}$$  
</s>