Finding all pairs $(a,b)$ of positive integers such that $a^2+nab+b^2$ is a perfect square. When $n=2$, the question is trivial. Is there a general method to find all such pairs for $n\ge{3}$ and $n\in{\mathbb{N}}$?

Let $a^2+nab+b^2 = c^2$
Let $x = \dfrac ac$ and $y=\dfrac bc$.
Then we need to find rational soloutions $(x,y)$ to $x^2 + nxy + y^2 = 1$

We start with the particular solution $(x,y) = (-1,0)$ and "draw" the line 
$y = \dfrac uv(x+1)$, where $u,v$ are integers, through that point. It should intersect the hyperbola $x^2 + nxy + y^2 = 1$ at a rational point.
\begin{align}
   x^2 + nxy + y^2 &= 1 \\
   x^2 + \dfrac uvnx(x+1) + \dfrac{u^2}{v^2}(x+1)^2 &= 1 \\
   x &= \dfrac{v^2-u^2}{u^2+uvn+v^2} &\text{(We discarded $x=-1$.)} \\
   y &= u\dfrac{nu+2v}{u^2+nuv+v^2}
\end{align}
We get  $a^2+nab+b^2 = c^2$ where
\begin{align}
   a &= v^2-u^2 \\
   b &= nu^2+2uv \\
   c &= u^2+nuv+v^2
\end{align}
If $(a,b)$ is a solution, then so too is $(-a,-b)$, $(b,a)$, and $(-b,-a)$. So all solutions can be characterized as
$$\{a,b\} \in \{v^2-u^2, nu^2+2uv\}, \quad c = u^2+nuv+v^2$$
