<s>[INST] Find all values of $a$ for which the maximum value of $f(x)=\frac{ax-1}{x^4-x^2+1}$equals $1$. Find all values of $a$ for which the maximum value of $$f(x)=\frac{ax-1}{x^4-x^2+1}$$equals $1$.
I equated $f(x)$ equal to $1$ to obtain a polynomial $x^4-x^2-ax+2=0$. Now this must have at least one repeated root.But I could not get any further.
Is there a calculus way to do it
 [/INST] $$f(x)=\frac{ax-1}{x^4-x^2+1}\implies f'(x)=\frac{a \left(-3 x^4+x^2+1\right)+4 x^3-2 x}{\left(x^4-x^2+1\right)^2}$$
So, we need
$$a \left(-3 x^4+x^2+1\right)+4 x^3-2 x=0\tag 1$$ for an extremum and $$a x-x^4+x^2-2=0\tag 2$$ to have the maximum value of $1$.
From $(2)$,we can get $a=\frac{x^4-x^2+2}{x}$. Plug it in $(1)$ to have
$$3 x^8-4 x^6+2 x^4+x^2-2=(1-x) (x+1) \left(3 x^2+2\right) \left(x^4-x^2+1\right)=0$$ So, the only real roots are $x=\pm 1$ to which correspond $a=\pm 2$.
These are the only solutions.
</s>