For the linear equation dxdy+Py=Q, the integrating factor is I.F.=e∫Pdx and the solution is y⋅I.F.=∫Q⋅I.F.dx+C.
Given: xdxdy+(1+x)y=x2e−x, x>0, with y=0 when x=1. To find: the particular solution, and y at x=2.
Step 1 — Write it in standard form. Dividing by x,
dxdy+(1+x1)y=xe−x
so P=1+x1 and Q=xe−x.
Step 2 — Find the integrating factor. ∫Pdx=x+logx, so
I.F.=ex+logx=ex⋅elogx=xex
Note that the exponent is a sum, so the integrating factor is a product, xex, and not x+ex. To check: dxd(xexy)=xexdxdy+(1+x)exy=ex[xdxdy+(1+x)y], which is ex times the left side of the given equation.
Step 3 — Multiply and integrate.
y⋅xex=∫xe−x⋅xexdx=∫x2dx=3x3+C
Step 4 — Use the condition. Put x=1, y=0: 0=31+C, so C=−31 and xexy=3x3−1.
Step 5 — Write the particular solution.
y=3xexx3−1=3x(x3−1)e−x
Step 6 — Find y at x=2.
y=3×2(8−1)e−2=6e27≈0.158
Answer: The particular solution is y=3x(x3−1)e−x, and y=6e27 when x=2.