Solve a system of non-linear equations in Python (scipy.optimize.fsolve)
<p>I am trying to solve the following simple system of non-linear equations (<a href="http://www.mathsisfun.com/algebra/systems-linear-quadratic-equations.html" rel="nofollow noreferrer">Source(second example)</a>):</p>

<pre><code>(I) y - x^2 = 7 - 5x
(II) 4y - 8x = -21
</code></pre>

<p>which should have only one solution (x=3.5, y=1.75).</p>

<p>My current approach using the <a href="https://docs.scipy.org/doc/scipy-0.18.0/reference/generated/scipy.optimize.fsolve.html#scipy.optimize.fsolve" rel="nofollow noreferrer">scipy</a> stack is the following:</p>

<pre><code>from scipy.optimize import fsolve

def equations(p):
    x, y = p
    return (y - x**2 -7 + 5*x, 4*y - 8*x + 21)

x, y =  fsolve(equations, (5, 5))

print(equations((x, y)))
</code></pre>

<p>and yields the following (which is not the result):</p>

<pre><code>(0.0, 0.0)
</code></pre>

<p>I have already tried different starting estimates but it doesn't deliver the right  solution.</p>

<p>What's wrong with my approach? Am I missing something?</p>

<p>Thanks in advance!</p>