If a solution exists, how can I construct another solution with coprime integers? Suppose , $n$ is an odd positive integer and positive integers $a,b$ not being coprime satisfy the equation $$a^2-2b^2=n$$


  Can I always find a solution of $$c^2-2d^2=n$$ with coprime integers $c,d$ ?


I know that I can construct infinite many solutions from one solution of this pell-like equation, but the problem is that the usual procedure gives integers not being coprime , if I start with a solution with integers not being coprime. What can I do ?
No. Consider $n=9$.

There are non-coprime solutions
gotten by taking solutions to
$x^2-2y^2=1$
and multiplying them by $3$.

Suppose
$c^2-2d^2 = 9$.
Mod 3,
$d^2 = 0$ or $1$.
Therefore
$2d^2 = 0$
or $2$,
so $c^2 = 0$ or $2$.
This can only hold
if $c^2 = 0$,
so $c = 0$
mod 3.
Therefore
$d = 0$ mod 3
so $c$ and $d$
are not relatively prime.
Knowing the first solution $(x_0 ; y_0)$ for the equation. $$x^2-qy^2=n$$

It is necessary to use any solution of the Pell equation.  $$p^2-qs^2=1$$

Then knowing what some solution $(x_0 ; y_0)$ we can find the following for equation $x^2-qy^2=n$

$$x=px_0+qsy_0$$

$$y=sx_0+py_0$$