If $(a,b)\in\mathbb N^2$ is a solution of $(x^2-dy^2)^2=1$ with minimal $x$ then $a^2-db^2=-1$. I need help with the following question:

If $d\in\mathbb N$ such as the equation $x^2-dy^2=-1$ has an integer solution. If $(a,b)\in\mathbb N^2$ is a solution of $(x^2-dy^2)^2=1$ with minimal $x$ (for any other solution $(x,y)$, $a\le x$). Prove that $a^2-db^2=-1$.

I proved that if $(e,f),(g,h) \in \mathbb N$ are solution of $(x^2-dy^2)^2=1$ then $e+f\sqrt d<g+h\sqrt d$ iff $e<g$.
It is pretty obvious to see that if $a^2-db^2\neq-1$ then $a^2-db^2=1$.
I know it can help with the question but I can't understand how.
 A: let the smallest solution to positive Pell be $u^2 - d v^2 = 1,$ with integers $u,v > 0.$
This defines an automorphism of the quadratic form, if $p^2 - d q^2 = T$ with $p,q>0$ integers, there is a larger expression for $T$ using
$$ (p,q)  \mapsto (up + dvq, vp + u q).  $$
In turn, when $p,q>0$ are not too small, there is a smaller positive expression using
$$ (p,q)  \mapsto (up - dvq, -vp + u q).  $$
Next, take $r^2 - d s^2 = -1$  with positive $r,s.$   Keep reducing by $ (r,s)  \mapsto (ur - dvs, -vr + u s)  $  until you arrive at a final
$$ x^2 - d y^2 = -1  $$
with $x,y > 0$  BUT
$$ \color{red}{ ux-dvy \leq 0 \; \; \; \mbox{OR} \;\;\; -vx +uy \leq 0.}  $$
Now, the conditions $$ \frac{x}{y} < \sqrt d < \frac{u}{v} $$
tell us that $vx< uy$ always, so the second condition is false. It must be the first condition that holds for our "fundamental negative Pell" solution $(x,y).$
That is,
$$ ux \leq dvy. $$
All quantities are positive, we are allowed to square both sides.
$$ u^2 x^2 \leq d^2 v^2 y^2 = (dv^2)(dy^2) $$
$$ u^2 x^2 \leq (u^2-1)(x^2 + 1)  $$
$$  u^2 x^2 \leq u^2 x^2 - x^2 + u^2 - 1  $$
$$  0 \leq -x^2 + u^2 - 1  $$
$$  x^2 \leq u^2 - 1 < u^2  $$
$$ x^2 < u^2 $$
Both are positive,
$$   x < u  $$
The smallest $x$ value for negative Pell (when such a thing exists) is smaller than the smallest $x$ value for positive Pell.
Who Knew?
