Official solution
\[\left( {{y^2} - x} \right){{dy} \over {dx}} = 1\]
\[ \Rightarrow \] \[{{dx} \over {dy}}\] + x = y2
I.F = \[{e^{\int {dy} }}\] = ey
Solution is given by
xey = \[{\int {{y^2}{e^y}dy} }\]
\[ \Rightarrow \] xey = (y2 -- 2y + 2)ey + C
y(0) = 1 means x = 0, y = 1
\[ \therefore \] C = -e
\[ \therefore \] xey = (y2 -- 2y + 2)ey - e
put y = 0
\[ \therefore \] x = 0 -- 0 + 2 -- e
\[ \Rightarrow \] x = 2 - e