The given differential equation is
y'(x) + y(x)g'(x) = g(x)g'(x)
(dy/dx) + g'(x)y = g(x)g'(x)
which is a linear differential equation.
Thus. IF = e∫g'(x) dx = eg(x)
Therefore, the solution is
y.eg(x) = ∫(g(x) ∫g'(x)) eg(x) dx
y.eg(x) = eg(x) (g(x) – 1) + c
When x = 0, y = 0, then c = 1
Thus, the curve is
y.eg(x) = eg(x) (g(x) – 1) + 1
When x = 2, then y = (0 – 1) + 1 = 0.