ODE approximation inside an interior layer This is taken from Chapter 20 of Nick Trefethen's book Exploring ODEs, available from the author as a free PDF. We are given the initial-value problem
$$\epsilon y'' + xy' + xy = 0, \;\; x \in [-2,2], \;\;  y(-2)=-4, \;\; y(2)=2.$$
With an $\epsilon = 0.001$, the solution displays an interior layer at $x=0$. There we can ignore the low-order terms so the ODE can be approximated by an inner equation
$$ \epsilon y'' + xy' = 0.$$
So far so good. A change of variables $s := \epsilon^{-1/2} x$ leads to the ODE
$$u'' + su' = 0, \;\; u(-\infty) = -4e^{-2}, \;\; u(\infty) = 2e^{2}. $$
Now to my question: how did the author come up with those boundary conditions (at "infinity") for the transformed inner equation (in $u$)?
 A: Taking the boundary conditions at infinity this is more a convenience as those integrals involved in that condition have a known value. For all practical purposes the inner solution is a constant for $|x|>\sqrt[3]ϵ$ as $\exp(-\frac1{2\sqrt[3]ϵ})$ is zero in all orders $O(ϵ^p)$ of approximation.
In general the inner solution has to be bounded with limits towards the relevant infinity, in this case both directions. Then it makes no great difference if the boundary condition is placed at $\pm 2/sqrtϵ$ or at $\pm\infty$, usually the difference is of the form $\exp(-1/ϵ)$ which is small against all powers of $ϵ$.
On the other hand, for the outer solution $Ce^{-x}$ in the first order of approximation the value at $x=\pm\sqrt[3]ϵ$ is equal to the value at $x=0$ of the respective branch. The branch of the outer solution for the left boundary condition is $-4e^{-x-2}$ and for the right boundary $2e^{-x+2}$. Thus the inner solution has to facilitate a jump from $-4e^{-2}$ to $2e^2$.

As the analysis for the inner solution shows, the jump is at zero and the "bandwidth power" is $1/2$, so that a general form for the solution is
$$
y(x)=u(x/\sqrtϵ)e^{-x}.
$$
Then $u' (x/\sqrtϵ)/\sqrtϵ=e^x(y'(x)+y(x))$ and $u''(x/\sqrtϵ)/ϵ = e^x(y''(x)+2y'(x)+y(x))$, so that with $x=\sqrtϵ s$
\begin{align}
u''(s)&=-xe^x(y'(x)+y(x))+ϵe^x(2y'(x)+y(x))\\
&=-su'(s)+2\sqrtϵu'(s)-ϵu(x)
\end{align}
so that in the leading terms
$$
u(s)=C\text{erf}(s/\sqrt2)+D
$$
and the constants have to be chosen to satisfy
$$
u(-2/\sqrtϵ)=4e^{-2}\text{ and }u(2/\sqrtϵ)=2e^{2}
$$
which to any order in $\sqrtϵ$ means $-4e^{-2}=-C+D$ and $2e^2=C+D$.
