Hi so I need to find the leading order approximation to the solution for $$ \varepsilon y'' + (1-2x)y' + x^2y = 0 $$ $$ y(0)=-1, y(1)=1 $$
by doing the lead term setting $\varepsilon = 0$ we can find that $$ (1-2x)y' + x^2y = 0 \implies \dfrac{y'}{y} = \dfrac{x^2}{2x-1} $$
which via integration we can find $$ \log(y)=\dfrac{x^2}{4} + \dfrac{x}{4} + \dfrac{\log(2x-1)}{8} + \hat{C} \implies y = Ce^{\frac{x^2+x}{4}}\sqrt[8]{2x-1} $$
This is garbage and doesn't even provide a full domain approximation so we say $C=0$ and now look at the boundary layers
Set $x = \varepsilon X$, $Y = y(X)$. Making this substitution we find that $$ \dfrac{1}{\varepsilon}Y'' + \dfrac{1-2\varepsilon X}{\varepsilon} Y' + \varepsilon ^ 2X^2 y = 0 \implies Y'' + (1-2\varepsilon X) Y' + \varepsilon^3X^2y =0 $$ setting $\varepsilon = 0 $
$$ Y'' + Y' = 0 \implies D_1 e^{-X} + D_2 $$
solve for the boundary as $\varepsilon \rightarrow 0 \implies x = 0, X=\infty$
$$ -1 = D_1 e ^ {-\infty} + D_2 \implies D_2 = -1 $$
Now we try scaling a second time $x = 1-\varepsilon X$ and find that
$$ Y'' - Y' = 0 \implies Y = E_1e^X +E_2 $$
solving for the other boundary we find that $$ 1 = E_1 e^0 + E_2 \implies E_2 = 1-E_1 \implies Y = E_1(e^X - 1) + 1 $$
but now I have two unknowns but need to make sure the two equations are equivalent as $\varepsilon \rightarrow 0$
$$ y_{left} = De^{-\frac{x}{\varepsilon}} - 1 $$ $$ y_{right} = E(e^{\frac{1-x}{\varepsilon}} - 1) + 1 $$
I am very lost please any help in a misunderstanding that I may have would be very helpful. Thank you so much
You found as outer solution $y_o(x)=0$. For the inner solution $y_{i1}$ on the left you need $Y(0)=-1$, $Y(+\infty)=0$, giving $y_{i1}(x)=-e^{-x/ε}$. Similarly, getting the chain rule right in the first derivative, you get on the right side at $x=1$ likewise $Y''+Y'=0$ with $Y(0)=1$ and $Y(\infty)=0$ giving the inner solution $y_{i2}(x)=e^{(x-1)/ε}$.
Let's test this, the approximation $y(x)=-e^{-x/ε}+e^{(x-1)/ε}$ against the numerical solution of the boundary problem.
This is well within the expected behavior for a first order approximation. For larger values of $ε$ the numerical solution may switch to another mode.