The coordinates \((x, y)\) of a general point on a curve satisfy the differential equation
$$x\frac{dy}{dx} = (2 - x^2)y.$$
The curve passes through the point \((1, 1)\). Find the equation of the curve, obtaining an expression for \(y\) in terms of \(x\). [7]