$$ y'' + 3y' + 2y = \frac{e^x}{1+e^x} $$
My attempt to this problem was finding $y_h$ as usual and let $y_p$ of the form: $$ y_p = \frac{Ae^x}{B+De^x}$$
I then go ahead and differentiate $y_p$ and substitute into the first equation to get the following:
$$ \frac{AB^3e^x-ABD^2e^{3x}}{(B+De^x)^4} + 3\frac{ABe^x(B+De^x)^2}{(B+De^x)^4}+2\frac{Ae^x(B+De^x)}{(B+De^x)^4} = \frac{e^x}{1+e^x}$$
From there I got the following: For the $$6AB^3=1$$ $$12AB^2D=0$$ $$8ABD^2=0$$ $$2AD^3=0$$
and
$$B^4=1$$ $$4B^3D=1$$ $$6B^2D^2=0$$ $$4BD^3=0$$ $$D^4=0$$
which yields an invalid result.
Can someone point out my mistakes? Thanks :).
You can use variation of parameters here. Note that the homogeneous solutions are $y_1 = e^{-x}$ and $y_2 = e^{-2x}$, so we look for a particular solution of the form $$ y_p(x) = v_1(x)y_1(x) + v_2(x)y_2(x) $$
The Wronskian is $$ W(x) = y_1{y_2}' - y_2{y_1}' = -e^{-3x} $$
so the solution is $$ {v_1}' = -\frac{y_2(x)f(x)}{W(x)} = \frac{e^{2x}}{1+e^x} $$ $$ {v_2}' = \frac{y_1(x)f(x)}{W(x)} = -\frac{e^{3x}}{1+e^x} $$
You can integrate by substituting $u=1+e^x$
\begin{align} v_1 &= \int \frac{e^{2x}}{1+e^x} dx = \int\frac{u-1}{u}\ du = \frac13 \big(u - \ln u\big) \\ v_2 &= -\int \frac{e^{3x}}{1+e^x} dx = -\int \frac{(u-1)^2}{u}\ du = -\frac13 \left(\frac{u^2}{2} - 2u + \ln u\right) \end{align}
The final solution is
\begin{align} y(x) &= \bar{c_1} e^{-x} + \bar{c_2}e^{-2x} \\ &\quad - e^{-x}\big[\ln(1+e^x) - (1+e^x)\big] \\ &\quad - e^{-2x}\left[\ln(1+e^x) + \frac{(1+e^x)^2}{2} - 2(1+e^x)\right] \\ &\equiv c_1e^{-x} + c_2e^{-2x} + \frac12 - \big(e^{-x}+e^{-2x}\big)\ln(1+e^x) \\ \end{align}