TITLE: Find a Solution using Green's Function
QUESTION [5 upvotes]: Find a solution to the given initial-value problem using Green's functions
$$y"+3y'+2y= \frac{1}{1+e^x}; y(0)=0,y'(0)=1$$
So I have figured out that 
$$y_c=e^{-x}-e^{-2x}$$
Now I am having issues figuring out what $y_p$ is. This is what I have so far:
$$y_1=e^{-x}, y_2=e^{-2x},$$
so 
$$W(y_1, y_2)=-e^{-3x}.$$
$$G(x,t)=\frac{e^{-t}e^{-2x}-e^{-x}e^{-2t}}{-e^{-3x}} = -e^{-t}e^{x}+e^{-2t}e^{2x}$$
$$y_p=\int^x_0 G(x,t)f(t)dt$$
$$y_p=-e^x \int^x_0 \frac{e^{-t}}{1+e^t}dt+e^{2x} \int^x_0 \frac{e^{-2t}}{1+e^t}dt$$
So 
$$y_p=-\ln(e^{-x}+1)(e^x+e^{2x})-\frac{e^{2x}}{2}+\frac{1}{2}+(e^{x}+e^{2x})\ln(2)$$
Is this correct?

REPLY [5 votes]: We are given:
$$y''+3y'+2y= \dfrac{1}{1+e^x}, ~ y(0)=0, ~y'(0)=1$$
The homogeneous (complementary) solution is given by: $y_c=e^{-x}-e^{-2x}$
For variation of parameters, we take: $y_1=e^{-x}, ~~y_2= -e^{-2x}$
Thus, the Wronskian $= W(y1, y2) = W(e^{-x},-e^{-2x}) = e^{-3x}$, so
$\displaystyle G(x,t)= \frac{y_1(t)y_2(x) - y_1(x)y_2(t)}{W(x)} = \frac{e^{-t}(-e^{-2x}) - e^{-x}(-e^{-2t})}{e^{-3x}} = e^{2x}e^{-2t} - e^xe^{-t}$, thus:
$\displaystyle y_p=\int^x_0 G(x,t)f(t)dt = -e^x \int^x_0 \frac{e^{-t}}{1+e^t}dt+e^{2x} \int^x_0 \frac{e^{-2t}}{1+e^t}dt$
We have:

$\displaystyle -e^x \int^x_0 \frac{e^{-t}}{1+e^t}dt = -e^{-x}\left[\ln(e^{-t}+1)-e^{-t}\right]$ evaluated over $(t, 0, x)$, yields: $\displaystyle-e^{-x}\left[\left(\ln(e^{-x} + 1)-e^{-x}\right) - \left(\ln(2) - 1\right)\right]$
$\displaystyle e^{2x} \int^x_0 \frac{e^{-2t}}{1+e^t}dt = e^{2x}\left[-\frac{e^{-2t}}{2}+e^{-t}-\ln(e^{-t} +1) \right]$, evaluated over $(t, 0, x)$, yields: $\displaystyle e^{2x}\left[\left(-\frac{e^{-2x}}{2} + e^{-x} - \ln(e^{-x}+1)\right) - \left(-\frac{1}{2} + 1 - \ln 2\right) \right]$

Do you see the issues now over those limits? Can you now do the algebra to combine all like terms and find:
$$y = y_c + y_p?$$
The final answer should be (after simplifications) and you can compare to the other answer:
$$y(x) =  \left(e^{-x}+e^{-2 x}\right) \ln\left(\dfrac{1}{2} (e^x+1)\right)$$