We have x2f'(x) + 2xf(x) – x + 1 = 0
Put y = f(x)
Thus, x2dy/dx + 2xy = x – 1
⇒ d/dx(x2y) = x – 1
On integration, we get,
x2y = x2/2 – x + c
when x = 1, y = 0 , then c = 1/2
Thus, x2y = x2/2 – x + 1/2
⇒ y = 1/2 – 1/x + 1/2x2
⇒ dy/dx = 1/x2 – 1/x3 = (x – 1)/x3
So, by the sign scheme, f(x) is increasing in x ∈(–∞, 0) ∪ (1, ∞) and decreasing in x ∈ (0, 1)