TITLE: How can I solve this linear differential equation $y^{\prime\prime}-4y^{\prime}+3y=\frac{1}{1+e^{-x}}$?
QUESTION [5 upvotes]: My problem is to solve this linear differential equation: $$y^{\prime\prime}-4y^{\prime}+3y=\frac{1}{1+e^{-x}}$$
My approach was: i can see this must be an ordinary differential equation of second-order. If i let $y^{\prime} = z$ i would get:
$$z^{\prime}-4z+3y=\frac{1}{1+e^{-x}}$$ ... at this point i get a problem in substitute y. So i cannot use this method. Another try was:
$$3y=-y^{\prime\prime}+4y^{\prime}+\frac{1}{1+e^{-x}}$$
$$y=-\frac{y^{\prime\prime}}{3}+\frac{4y^{\prime}}{3}+\frac{\frac{1}{1+e^{-x}}}{3}$$ But this seems to lead me to nowhere.

REPLY [2 votes]: This equation may be solved using Laplace transforms.  Defining
$$Y(s) = \int_0^{\infty} dx \, y(x) \, e^{-s x}$$
The LT of $y'$ is $s Y(s) - y(0)$; that of $y''$ is $s^2 Y(s) - s y(0)-y'(0)$.  You may then derive an equation for $Y(s)$:
$$Y(s) = \frac{y(0) s-(y'(0)-4 y(0))}{(s-3) (s-1)} + \frac{F(s)}{(s-3) (s-1)}$$
where
$$F(s) = \sum_{n=0}^{\infty} \frac{(-1)^n}{n+s}$$
is the LT of the RHS.  The inverse LT $y(x)$ is found using the residue theorem - the ILT is the sum of the residues of the poles of $Y(s) e^{s x}$.  Because the poles are all simple, we may write the ILT as
$$f(x) = \left ( \frac{3}{2} y(0) - \frac12 y'(0) + \log{2}\right) e^x + \left (\frac{y'(0)}{2} - \frac{y(0)}{2} + \log{2} - \frac12 \right ) e^{3 x} + \\\sum_{k=0}^{\infty} (-1)^k \frac{e^{-k x}}{(k+1) (k+3)} $$
The sum is straightforward when you use a partial fraction decomposition and remember the Maclurin series for $\log{(1+z)}$.  I get
$$\sum_{k=0}^{\infty} (-1)^k \frac{e^{-k x}}{(k+1) (k+3)} = \frac12 e^{2 x} - \frac14 e^x - \frac12 e^x (e^{2 x}-1) \, \log{(1+e^{-x})}  $$