How to solve this 2nd order ODE Consider $$\epsilon y''+yy'-y=0$$
with boundary conditions $y(0)=0$ and $y(1)=3$.
I showed that the outer solution is $y_{in}(x)=x+2+O(\epsilon)$.
Than for the inner solution, I wish to solve the follow ODE
$$Y''(X)+Y(X) \cdot Y'(X) = 0$$
with only one boundary condition $y(0)=0$ and $X={x \over \epsilon}$.
Can anyone show me how to do it?
 A: Here's an approach:
$$y'' + yy' = 0 \\
y'' + \frac{1}{2} \frac{d}{dx} y^2 = 0 \\
\frac{d}{dx} \left ( y' + \frac{1}{2} y^2 \right ) = 0 \\
y' + \frac{1}{2} y^2 = C_1 \\$$
This is a Riccati type equation. Apparently, by a standard technique which is specific to Riccati equations (cf. http://mathworld.wolfram.com/RiccatiDifferentialEquation.html), we can let $y=\frac{2z'}{z}$, so that 
$$y'=\frac{2zz''-2z'^2}{z^2}=\frac{2z''}{z}-\frac{2z'^2}{z^2}.$$
Hence $y'+\frac{1}{2} y^2 = \frac{2z''}{z}$, so we have
$$\frac{2z''}{z} = C_1.$$
This is not hard to solve; then you back-substitute to find $y$. The process is a little bit easier if you write $z$ in terms of $\sinh$ and $\cosh$, because given $y(0)=0$ you have $z'(0)=0$, so actually $z$ is a $\cosh$ function, and so $y$ is a $\tanh$ function.
A: *

*The outer expansion: Let $y=y_0+O(\epsilon)$. Then we have
$$
\epsilon(y_0''+O(\epsilon))+(y_0+O(\epsilon))(y_0'+O(\epsilon))-(y_0+O(\epsilon))=0.
$$
Then $O(1)$ term gives
$$ y_0y_0'-y_0=0,y_0(1)=3 $$
which has the solution $y_0=x+2$. 

*The inner expansion: Let $X=\frac{x}{\epsilon}$ and $Y(X)=y(\epsilon X)$. The equation becomes
$$ Y''+YY'-\epsilon Y=0.$$
Let $Y=Y_0+O(\epsilon)$. Then we have
$$
(Y_0''+O(\epsilon))+(Y_0+O(\epsilon))(Y_0'+O(\epsilon))-\epsilon(Y_0+O(\epsilon))=0, Y_0(0)=0.
$$
Then $O(1)$ term gives
$$ Y_0''+Y_0Y_0'=0,Y_0(0)=0 $$
which has the solution $Y_0=2c\tanh(cX)$ (suppose $Y'(0)=2c^2$). Here $c$ is a constant to be determined.

*Matching: we require that the inner solution matches the outer solution, namely,
$$ \lim_{x\to0^+}y_0(x)=\lim_{X\to\infty}Y_0(X) $$ 
from which we have $2c=2$ or $c=1$.
In summery, the asymptotic solution as $\epsilon\to0^+$ is given by
$$ 
y(x,\epsilon)=y_0(x)+Y_0(\frac{x}{\epsilon})-Y_{overlap}=(x+2)+\tanh(\frac{x}{\epsilon})-2.
$$
