I have been looking for an algebraic way to solve for 2 squares when given a sum, but I got nothing so far.
For example:
$$y^2 + x^2 = 9797$$
I thought that the solution would have to do something like this, but I want a method which is certain to give me a solution without trial and error.
$$f(x) = \sqrt{(9797 - x^2)}$$
or this where I would just increase the variable a by one until x^2 is a perfect square.
$$9797 - y^2 = x^2$$
I came across the sum of two squares theorem, as well Fermat's theorem on sums of two squares. However, they state that a number can be written as $x^2 + y^2 = z$ but from my research, I believe they did not state a solution to solve the two squares.
Edit: I wanted to add that I know there can be multiple solutions to problem, as the example I gave has $4$ solutions.