What are the common solutions of $x^2+y=31$ and $y^2+x=41$? A friend asked me if I have a certain algorithm to solve $x^2+y = 31$ and $y^2+x=41$ simultanously. We found the solutions but we didn't find a way to solve both equations.
Any ideas?
 A: As Srivatsan commented we can eliminate one of the variables from the system
$$\left\{ 
\begin{array}{c}
x^{2}+y=31 \\ 
y^{2}+x=41.
\end{array}
\right. $$
It is equivalent to
$$\left\{ 
\begin{array}{c}
y=31-x^{2} \\ 
x^{4}-62x^{2}+x+920=0.
\end{array}
\right. $$
A rational solution of the quartic equation has to be a divisor of $
920=2^{3}\times 5\times 23$. If we check $x=5$, we conclude that it is a
root, which we call $x_{0}$. Now we can easily factor the quartic 
$$
x^{4}-62x^{2}+x+920=\left( x-5\right) \left( x^{3}+5x^{2}-37x-184\right) $$
remaining to solve the cubic equation
$$
x^{3}+bx^{2}+cx+d=0
$$
with coefficients $b=5,c=-37,d=-184$. To get the correspondent depressed cubic equation
$$
t^{3}+pt+q=0
$$
we need to make the change of variables $x=t-b/3$ thus finding the coefficients $p=-136/3$ and $q=-3053/27$. Now we can apply the Cardano's method. Since
the discriminant $q^{2}+4p^{3}/27<0$ all  roots are real. One of
the roots is
$$
\begin{eqnarray*}
t_{1} &=&\left( -\frac{q}{2}+\frac{1}{2}\sqrt{q^{2}+\frac{4p^{3}}{27}}
\right) ^{1/3} +\left( -\frac{q}{2}-\frac{1}{2}\sqrt{q^{2}+\frac{4p^{3}}{27}}\right) ^{1/3}
\\
&\approx &7.742\qquad\text{(numerical evaluation in SWP)},
\end{eqnarray*}$$
which corresponds to $x_{1}=t_{1}-5/3\approx 6.075$. The radicals are chosen
in such a way that their product is 
$$\left( -\frac{q}{2}+\frac{1}{2}\sqrt{q^{2}+\frac{4p^{3}}{27}}\right)
^{1/3}\left( -\frac{q}{2}-\frac{1}{2}\sqrt{q^{2}+\frac{4p^{3}}{27}}\right)
^{1/3}=-\frac{p}{3}.$$
The remaining roots could also be found by factoring the cubic. Numerically we
have got $t_{2}\approx -4.487,t_{3}\approx -3.255$ and $x_{2}\approx
-6.154,x_{3}\approx -4.922$. The equation $y=31-x^{2}$ yields the values 
$y_{0}=6, y_{1}\approx -5.910$, $y_{2}\approx -6.867$, $y_{3}\approx 6.776$ (Note: rounding error of $0.001$ in comparison with bgins's evaluation).
A: Rearranging gives $y^2 - x^2 = 10 + y-x,$ so that $(y-x) (y+x-1) = 10.$ You don't say you are looking for integer solutions, but if you are, then you are left with finitely many possibilities for the pair $(y-x,y+x-1),$ which can be individually solved by Gaussian elimination: for example, one possibility is $y-x = 2, y+x-1 =5,$ leading to $y = 4, x = 2.$ But this pair does not satisy the original equations. However, another possibility is $y-x = 1$ and $y+x-1 = 10,$ which leads to $y=6$ and $x=5,$ which does satisfy the original system. The other cases can be handled similarly.
A: Another approach (Graphical approach) is to sketch the two graphs (must be drawn to scale) as found here http://www.wolframalpha.com/input/?i=Graph+x%5E2%2By%3D31+and+y%5E2%2Bx%3D41. Then determine the points of intersections of the two graphs which will give you the same set of solutions in the other approaches.
A: Another way, is the combination of Srivatsan's comment and Smanoos' answer:
$\begin{cases} y=31-x^2 \\ y^2+x=41 \end{cases}$
And for $(31-x^2)^2 + x = 41 $:

A: As a general algorithm for this kind of problem, you can compute a Gröbner basis of the ideal generated by your polynomials, using lexicographic ordering of monomials. 
The result will be a "triangular system": first a polynomial in x, then a polynomial in xy... you can solve in x, then plug the values in the second polynomial and solve in y. (cf this paragraph in the WP article).
Solving Systems of Polynomial Equations (pdf) by Bernd Sturmfels gives an introduction to the topic. If you have access to the collective book Some Tapas of Computer Algebra (Springer), the two first chapters will give you a very complete and clear overview of the topic.
