The given differential equation is:
y′(x)+y(x)g′(x)=g(x)g′(x)
This is a first-order linear differential equation of the form:
dxdy+P(x)y=Q(x)
where P(x)=g′(x) and Q(x)=g(x)g′(x).
Step 1: Find the Integrating Factor (I.F.)
I.F.=e∫P(x)dx=e∫g′(x)dx=eg(x)
Step 2: Solve the differential equation
Multiplying the differential equation by the integrating factor gives:
dxd[y(x)eg(x)]=g(x)g′(x)eg(x)
Integrating both sides with respect to x:
y(x)eg(x)=∫g(x)g′(x)eg(x)dx
To compute the integral on the right-hand side, substitute u=g(x), which gives du=g′(x)dx:
∫ueudu=ueu−eu+C=(g(x)−1)eg(x)+C
Therefore, the general solution is:
y(x)eg(x)=(g(x)−1)eg(x)+C
Dividing both sides by eg(x):
y(x)=g(x)−1+Ce−g(x)
Step 3: Determine the constant C
We are given y(0)=0 and g(0)=0. Substituting x=0 into the general solution:
y(0)=g(0)−1+Ce−g(0)
0=0−1+Ce0
0=−1+C⟹C=1
Thus, the particular solution is:
y(x)=g(x)−1+e−g(x)
Step 4: Calculate y(2)
We are given g(2)=0. Substituting x=2:
y(2)=g(2)−1+e−g(2)
y(2)=0−1+e0
y(2)=−1+1=0
Hence, the value of y(2) is 0.