Let's say I have a quadratic equation, $x^2+kx+a-kb=0$, with $a$ and $b$ as known constants (e.g. $a=25$ and $b=86$), and $k$ a parameter that I wanna tune. The solution is $x=\frac{-k \pm \sqrt{k^2-4(a-kb)}}{2}$.
Let's say I wanna find the smallest $k$ such that $\sqrt{k^2-4(a-kb)}$ is an integer. In other words, I want $k^2-4(a-kb)$ to be a square number. In the example of $a=25$ and $b=86$, then $k=50$ and $\sqrt{k^2-4(a-kb)}=140$.
Is there an algorithm to find such $k$, better than brute force?