The given initial value problem is
[tex]\frac{\mathrm{d} y}{\mathrm{d} x}+ 2xy=f(x)[/tex]
It is given that
y(0) = 6, where f(x) = x, 0 ≤ x < 1 0, x ≥ 1
Now the equation reduces to
[tex]\frac{\mathrm{d} y}{\mathrm{d} x}+ 2xy=x[/tex] -------------(1)
Integrating factor=[tex]e^{\int{2x}dx}=e^{x^{2}}[/tex]
Multiplying equation (1), both sides by integrating factor i.e[tex]e^{x^{2}[/tex]
The equation reduces to
[tex]e^{x^{2}}[\frac{\mathrm{d} y}{\mathrm{d} x}+ 2xy]=x\times e^{x^{2}}[/tex]
Integrating both sides, the equation reduces to
[tex]e^{x^{2}}\times y=\int x\times e^{x^{2}}dx[/tex]
Now integrating the function which is on right hand side, we get
put [tex]x^{2} =t[/tex] and then differentiating,we get
2 x dx = dt
⇒x dx = dt/2
[tex]e^{x^{2}}\times y=\int\frac{e^t}{2}dt[/tex]
= [tex]\frac{e^t}{2}[/tex]
Replacing t by x², we get
[tex]e^{x^{2}}\times y=\frac {e^{x^{2}}}{2} + C[/tex] ---------------(2)
It is given that when x=0,y=6.
Putting these value in equation (2),we get
6=1/2 + C
⇒C= 6-1/2
⇒ C =11/2
The solution of the initial value problem is
[tex]e^{x^{2}}\times y=\frac {e^{x^{2}}}{2} + \frac{11}{2}[/tex]