Solution (source code)

= Solution

Here $M_y=2y$ whereas $N_x=0$, so the equation is not exact. The identity $M_y-N_x=N$ gives the <integrating factor for a differential one-form> $\mu(x)=e^x$. Multiplying makes the left-hand side the <exact differential> of $e^x(y^2-x+1)$. Thus
$$
\boxed{e^x(y^2-x+1)=C,\qquad\text{or}\qquad y^2=x-1+Ce^{-x}.}
$$
For real graph solutions, the right-hand side must be nonnegative; a smooth choice of square-root branch is made on the interval concerned. Finding the factor did not require dividing by $y$ at zero.