# Second Order ODE Problem

I'm trying to solve a boundary layer problem but I've ran into some trouble when it comes to solving the second order ODE's that have come up. I've been attempting to apply the method of undetermined coefficients, but I suspect I'm doing something wrong when it comes to finding the particular solution.

Here's an example of the problem I'm having,

$y_{1}''+y_{1}'=xe^{-x}-1+A_{0}(1-e^{-x}),\hspace{10mm} y_{1}(0)=0$

where the right hand side has come from me solving the homogeneous case and plugging it in, where

$y_{0}=1+A_{0}(e^{-x})$

and the RHS is $-xy_{0}'-y_{0}$

Apparently the answer I should be getting is

$y(x)=-x+A_{0}(x-\frac12 x^{2}e^{-x})+A_{1}(e^{-x}-1)$

but after trying a few different particular solutions I can't seem to see how it comes out.

Any help would be appreciated.


$\ds{a}$ and $\ds{b}$ are constants.

• Thanks, that's massively useful. I'm a little unclear about how you've obtained the first line, I can see you've multiplied both sides by $e^{x}$ but I'm not too sure about how you've obtained the left hand side. Would you mind clarifying? – M.Lyons May 7 '18 at 21:07
• @M.Lyons Thanks. $\displaystyle{\mathrm{d}\left[\mathrm{e}^{x}y'\right] \over \mathrm{d}x} = \mathrm{e}^{x}y' + \mathrm{e}^{x}y'' = \mathrm{e}^{x}\left(y'' + y'\right)$. – Felix Marin May 8 '18 at 0:17

You can use undetermined coefficients to solve it. First, rewrite

$$y_1'' + y_1' = xe^{-x} -A_0e^{-x} + (A_0-1)$$

Observe that the homogeneous solution has the form $c_0 + c_1e^{-x}$, so we guess a particular solution $$y_{p1} = Cx^2e^{-x} + Dxe^{-x} + Ex$$

Differentiating gives

\begin{align} y_{p1}' &= C(2x-x^2)e^{-x} + D(1-x)e^{-x} + E \\ &= -Cx^2e^{-x} + (2C-D)xe^{-x} + De^{-x} + E \end{align}

\begin{align} y_{p1}'' &= -C(2x-x^2)e^{-x} + (2C-D)(1-x)e^{-x} - De^{-x} \\ &= Cx^2e^{-x} + (D-4C)xe^{-x} + (2C-2D)e^{-x} \end{align}

Plugging in, we find $$y_{p1}'' + y_{p1}' = -2Cxe^{-x} + (2C-D)e^{-x} + E$$

which gives $$C = -\frac12, \ D = A_0 - 1, \ E = A_0-1$$

The final solution, including the initial condition is

$$y_1(x) = c_0(1-e^{-x}) - \frac12x^2e^{-x} + (A_0-1)x(e^{-x} + 1)$$