(D2+2D+1)y=y"+2y'+y=(ex-1)-2.
y"+2y'+y=(y"+y')+(y'+y). Let z=y'+y then (D2+2D+1)y=z'+z=(ex-1)-2.
This reduces the 2nd order DE to a 1st order DE.
We can use the integrating factor ex to reduce this further:
d(exz)=ex(ex-1)-2, so exz=∫ex(ex-1)-2dx.
Let u=ex-1, then du=exdx, and:
exz=∫u-2du=C-u-1=C-(ex-1)-1, z=Ce-x-e-x(ex-1)-1, where C is the arbitrary constant of integration.
z=y'+y=Ce-x-e-x(ex-1)-1.
Using the same integrating factor ex:
d(exy)=C-(ex-1)-1, exy=∫(C-(ex-1)-1)dx=Cx-∫(ex-1)-1dx.
du=exdx=(u+1)dx, exy=Cx-∫u-1(u+1)-1du.
u-1(u+1)-1≡A/(u+1)+B/u where A and B are constants to be found (to create partial fractions).
Au+Bu+B=1, so B=1 and A=-1.
exy=Cx-∫(-1/(u+1)+1/u)du=Cx+ln|u+1|-ln|u|+D, where D is another constant of integration.
u+1=ex, so ln|u+1|=ln|ex|=x.
exy=Cx+x-ln|ex-1|+D, y=C1xe-x-e-xln|ex-1|+De-x. Cx+x has been replaced by C1=C+1.
This result needs to be checked...
To simplify the checking process we use the fact that (D2+2D+1)y=0 has the characteristic solution yc=ae-x+bxe-x where a and b are constants. In the solution D=a, C1=b. The particular solution is the term -e-xln|ex-1|, so we only need to apply the DE to this term to prove the solution.
yp=-e-xln|ex-1|, yp'=e-xln|ex-1|-(ex-1)-1,
+2yp'=2e-xln|ex-1|-2(ex-1)-1,
+yp"=-e-xln|ex-1|+(ex-1)-1+ex(ex-1)-2. The red terms cancel out.
Add the terms together:
(ex-1)-1+ex(ex-1)-2-2(ex-1)-1=ex(ex-1)-2-(ex-1)-1=
(ex-1)-1(ex(ex-1)-1-1)=(ex-1)-1(ex-ex+1)(ex-1)-1=(ex-1)-2.
This confirms the general solution yc+yp=y=ae-x+bxe-x-e-xln|ex-1|.