Reaction boundary layer with square-root thickness (source code)

= Reaction boundary layer with square-root thickness
{title2=$\epsilon y''=y-f(x),\qquad X=(1-x)/\sqrt\epsilon$}

For a positive small parameter $\epsilon$, an order-one mismatch between the reduced solution $y_0=f(x)$ and a prescribed right endpoint value $y(1)=b$ creates a right <boundary layer>. Balancing $\epsilon y''$ against the order-one reaction term gives width $\sqrt\epsilon$. In the <inner variable> $X=(1-x)/\sqrt\epsilon$, the leading equation is $Y_0''=Y_0-f(1)$. Its boundary and matching conditions are $Y_0(0)=b$ and $Y_0\to f(1)$ as $X\to\infty$, so
$$
Y_0(X)=f(1)+(b-f(1))e^{-X}.
$$
The leading <additive composite expansion> is $f(x)+(b-f(1))e^{-(1-x)/\sqrt\epsilon}$, obtained by subtracting the common overlap value. For the nonlinear perturbation $\epsilon y''=y-x^2+\epsilon(2+y^2)$ with zero endpoint values, the first two <outer expansion> terms are $x^2-\epsilon x^4$, and the leading right-layer term is $1-e^{-X}$.