Find the leading order solution to $\epsilon y'' + e^{x}y' + \epsilon y = 1, \; 0<x<1, \; y(0) = 0, y(1) =1 $
Newest attempt below. However, I am not sure how to deal with the $\overline{x}$ term in the inner solution. The below has error for the inner solution. It should be written as $Y_0 = c_1 + c_2 e^{-\overline{x}} + \overline{x}$
Solution: Outer solution: $\epsilon = 0 \implies e^{x}y_0' = 1 \implies y_0 = -e^{-x}+c$.
B.L at $x = 0$? Write the stretched variable $\overline{x} = \frac{x}{\epsilon^{\alpha}}$. Then we obtain $$\epsilon^{1 - 2\alpha}(Y_0'' + \epsilon Y_1'' + \cdots) + e^{\epsilon^{\alpha}\overline{x}}\epsilon^{-\alpha}(Y_0' + \epsilon Y_1' + \cdots) + \epsilon(Y_0 + \epsilon Y_1 + \cdots) = 1$$ Balancing: $\alpha = 1$ is the only value yielding a good balance.
We may write $e^{\epsilon \overline{x}}$ as its Maclaurian series: $$e^{\epsilon \overline{x}} \sim 1 + \epsilon \overline{x} + \cdots $$
Considering the leading order terms we write
$$O\left (\frac{1}{\epsilon}\right ): \; Y_0'' + Y_0' = 1 \implies Y_0 = c_1 + c_2 e^{-\overline{x}} + c_3 \overline{x}$$ Require $c_3 = 0$ to remove the secular term which then yields $$Y_0 = c_1 + c_2 e^{-\overline{x}}$$ We see matching can occur and so we proceed to applying the boundary conditions.
$Y_0(0) = 0 \implies c_1 = -c_2 \; \implies Y_0 = c_1(1- e^{-\overline{x}})$
$y_0(1)=1 \implies \; -e^{-1}+c = 1 \implies c = 1+e^{-1}$
Matching: $$Y_0(+\infty) = y_0(0^{+}) \implies \underbrace{c_1 = c}_{\text{common part}} \implies y_0 = -e^{-x} + c_1$$
and so: $y_0 = -e^{-x} + 1 + e^{-1}$ and $Y_0 = (1+e^{-1})(1 - e^{-\frac{x}{\epsilon}})$
Composite expansion: $$\boxed{y \sim -e^{-x} + 1 + e^{-1} - e^{-\frac{x}{\epsilon}}}$$
Subscript[\[Epsilon], 1] = 0.1;
Subscript[\[Epsilon], 2] = 0.05;
Subscript[eqn, 1] =
NDSolve[{Subscript[\[Epsilon], 1]*y''[x] + Exp[x]*y'[x] +
Subscript[\[Epsilon], 1]*y[x] == 1, y[0] == 0, y[1] == 1},
y, {x, 0, 1}];
Subscript[eqn, 2] =
NDSolve[{Subscript[\[Epsilon], 2]*y''[x] + Exp[x]*y'[x] +
Subscript[\[Epsilon], 2]*y[x] == 1, y[0] == 0, y[1] == 1},
y, {x, 0, 1}];
Subscript[leadingOrder,
1] = -Exp[-x] + 1 + Exp[-1] - Exp[-(x/Subscript[\[Epsilon], 1])];
Subscript[leadingOrder,
2] = -Exp[-x] + 1 + Exp[-1] - Exp[-(x/Subscript[\[Epsilon], 2])];
Plot[{First[y[x] /. Subscript[eqn, 1]],
First[y[x] /. Subscript[eqn, 2]], Subscript[leadingOrder, 1],
Subscript[leadingOrder, 2]}, {x, 0, 1},
PlotStyle -> {{Blue}, {Black}, {Red, Dashed}, {Orange, Dashed}},
PlotLegends -> {"Explicit - \!\(\*SubscriptBox[\(\[Epsilon]\), \
\(1\)]\)", "Explicit - \!\(\*SubscriptBox[\(\[Epsilon]\), \(2\)]\)",
"Leading order - \!\(\*SubscriptBox[\(\[Epsilon]\), \(1\)]\)",
"Leading order - \!\(\*SubscriptBox[\(\[Epsilon]\), \(2\)]\)"},
PlotLabel -> "Explicit (solid) and leading order (dashed) solutions"]
