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

Compute the polynomial GCD of your polynomial and its derivative.
A repeated root of a polynomial is a root of its derivative.  So we want to find $a$ such that $g = \gcd(x^4 - x^2 - a x+2, 4 x^3 - 2x - a) \neq 1$.
Taking $4$ of the left and $-x$ of the right, as well as the right, we have
$$ g = \gcd(-2x^2-3ax+8, 4 x^3 - 2x - a )  \text{.}  $$
Taking $2x$ of the left and $1$ of the right, as well as the left, we have
$$ g = \gcd(-6ax^2+14x-a, -2x^2-3ax+8)  \text{.}  $$
Taking $1$ of the left and $-3a$ of the right, as well as the right, we have
$$ g = \gcd(9a^2x+14x-25a, -2x^2-3ax+8)  \text{.}  $$
We started with two polynomials equal to zero and have constructed sums of multiples of them.  Since sums of multiples of zeroes are zero, we solve the left of these:  from $9a^2x+14x-25a = 0$, $x = \frac{25a}{9a^2 + 14}$.  Notice this new denominator is always positive.  We substitute this into the right member of our most recent pair of polynomials to find
$$  \frac{27a^4 + 284a^2 - 1568}{9a^2 + 14} = 0  \text{.}  $$
Since the denominator is always positive, this is zero only when the numerator is zero.  By applying the quadratic formula, we find $a^2 = 4$, so $a = \pm 2$ or $a^2 = \frac{-392}{27}$, so $a = \pm \frac{14 \mathrm{i} \sqrt{2}}{3\sqrt{3}}$.  There is no sensible meaning of "maximum" if we allow $a$ to be non-real, so we restrict to $a = \pm 2$.
Continuing our GCDs,
\begin{align*}
g_{a = 2} &= \gcd(50x-50,-2x^2-6x+8)  \\
    &= \gcd(50x-50, x(50x-50) + 25(-2x^2-6x+8))  \\
    &= \gcd(50x-50, -200x+200)  \\
    &= \gcd(50(x-1), -200(x-1))  \\
    &= 50(x-1)  \text{.}
\end{align*}
So when $a = 2$, the double root occurs at $x = 1$.  Here, $f''(1) = -10$, so this is a local maximum.  The first derivative has one other zero at the real root of $3x^3+x^2+1$ (the factor of the numerator of $f'$ left after the factors $-2$ and $x-1$), but the second derivative is positive there, so this corresponds to a local minimum.  The only other potential critical point is any zero of $x^4 - x^2 + 1$, but this has no real roots, so there are two critical points, we have characterized them, there is one local maximum, and it is necessarily the global maximum, $\left.f(1)\right|_{a = 2} = 1$.
The analysis for $a = -2$ parallels the above, with maximum $1$ occurring at the critical point $x = -1$.
