singular perturbation to find a composite expansion Determine the first two terms in the inner and outer expansions for the following problem on the interval $0\leq x\leq1$,
$(1+\epsilon)x^2\frac{du}{dx}=\epsilon[(1-\epsilon)xu^2-(1+\epsilon)x+u^3+2\epsilon u^2]$, $u(1)=1$
where $0<\epsilon \ll 1.$ Construct the composite expansion.
 A: We will proceed as follows: compute the outer solution, from that determine the scaling for the inner solution, rescale $x$ appropriately, determine the inner solution, then match (may also do so along the way). Then write down composite expansion.
For the outer expansion, we simply insert $u(x)=u_0(x)+\epsilon u_1(x)+o(\epsilon)$. Then we find $u_0 = cst. = 1$ by $u(1)=1$. At order epsilon, we find  $\frac{\mathrm{d}u_1}{\mathrm{d}x}=1/x^2$. Hence 
$$u(x)=1+\epsilon (1-1/x) + o(\epsilon)$$,
Inner expansion:
EDIT - There was a mistake in the original scaling. In fact it is $u \sim \epsilon/x$, as can be read off from the outer solution. The two dominant terms are still the LHS and $\epsilon u^3$ (try out other dominant balances, it will lead to contradictions because terms you neglected are actually larger than the ones you kept). But now the resulting scaling for $x$ is $x\sim \epsilon$ and $u\sim 1$. Define $x=\epsilon y$. We do not need to rescale $u$ now. Plugging this into the equation and dividing by $\epsilon$ gives the equation in the inner region:
$$
(1+\epsilon) y^2 \frac{\mathrm{d}u}{\mathrm{d}y} = (1-\epsilon) \epsilon y u^2 - (1+\epsilon)\epsilon y + u^3 + 2\epsilon u^2
$$
Now, to find the inner solution, expand again $u=u_o+\epsilon u_1+o(\epsilon)$. Then, as it has to be by virtue of our rescaling, the zeroth order equation is 
$$y^2\frac{\mathrm{d}u_o}{\mathrm{d}y} = u_o^3,$$
 whose solution is $u_o(y)=\frac{1}{\sqrt{B+2/y}}$, where $B$ is a constant. In the limit of $y\to \infty$, matching this with the outer solution, this means that $B=1$, i.e. 
$$u_o(y)=\sqrt{y}/\sqrt{2+y}$$.
 At the next order, there is a nice cancellation and the ODE reads: 
$$\frac{\mathrm{d}u_1}{\mathrm{d}y} = \frac{3}{y(2+y)}u_1-\frac{1}{\sqrt{y(2+y)^3}},$$ 
which can be solved using an integrating factor as follows. Multiply by $\exp(-\int_y 3/(y(2+y))\mathrm{d}y)=\left(\frac{2+y}{y}\right)^{3/2} = u_o^{-3} $
Then the derivative term and the $u_1$ term become a total derivative which can be integrated to give 
$$u_1(y)=u_o(y)^3\left(C+\frac{1}{y}\right) = \left(\frac{y}{2+y}\right)^{3/2} \left(C+\frac{1}{y}\right),$$
where $C$ is a constant.
Matching:
In case you haven't seen it done, I sketch how to do asymptotic matching. To match inner and outer solution, we need to take the limit $x\to 0$ and $y\to \infty$, such that $\epsilon \ll x \ll 1$. This is conveniently done by letting $x= \epsilon^\alpha \eta$, $y=\epsilon^{1-\alpha} \eta$, where $\alpha \in (0,1)$ and $\eta = \mathrm{ord}(1)$. Then one gets
$$u_{outer} = 1+ \epsilon - \epsilon^{1-\alpha} \frac{1}{\eta} + \dots,$$
while
$$ u_{inner} = \frac{1}{\sqrt{1+2/y}} + \epsilon \frac{1}{(1+2/y)^{3/2}} (C+1/y) \\ \, \, = 1- \frac{1}{\eta} \epsilon^{1-\alpha} + \epsilon C + (1-3C) \epsilon^{2-\alpha} \frac{1}{\eta} +\dots   $$
The $\mathrm{ord}(1)$ and $\mathrm{ord}(\epsilon^{1-\alpha})$ terms agree automatically because we matched $B$ along the way and because of the scaling we used to find the inner solution. This is an important consistency check. Then order $\epsilon$ tells us that $C=1$. So finally, 
$$ u_{outer}(x) = 1+\epsilon\left(1-\frac{1}{x}\right)+o(\epsilon) $$
and
$$ u_{inner}(y) = \frac{\sqrt{y}}{\sqrt{2+y}} + \left(\frac{y}{2+y}\right)^{3/2} \left(1+\frac{1}{y}\right) + o(\epsilon) $$
Composite expansion:
A uniformly valid composite expansion (meaning one which is valid in the whole domain to some order) is obtained by adding inner and outer solutions and substracting the inner limit of the outer solution (or the outer limit of the inner solution). In our case, this is particularly simple and we find: 
$$ u_c(x) = u_o(x) + u_i(x/\epsilon) - \underbrace{u_{i,o}(x)}_{u_o(x)} = u_i(x/\epsilon) =  \frac{1}{\sqrt{1+\frac{2\epsilon}{x}}} + \epsilon \frac{1}{\left(1+\frac{2\epsilon}{x}\right)^{3/2}} \left(1+\frac{\epsilon}{x}\right) + o(\epsilon)$$
If you don't agree with a result or you don't understand a step, please just ask.
