Solution of ODE using piecewise functions For a fixed $i$, let $\psi_i$ is piecewise exponential function for the mesh point $x_i$ such that for all $j$, $0\leq j\leq N$, $\psi_i$ is the solution of $$\epsilon\psi_i^{''}+(\bar a(x)\psi_i)^{'}=0, \;\;\; \psi_i(x_j)=\delta_{ij}.$$ The variable $\bar a(x)$ is approximated by a constant $$\bar a(x)=\bar a_i, \forall x\in (x_{i-1},x_i].$$ Letting $\rho_j=\bar a_jh/\epsilon$, where $h=x_i-x_{i-1}$ and assuming a uniform mesh. 
I want to show that the solution of this ODE is given by $$\psi_j(x)= \left\{
     \begin{array}{ll}
       \dfrac{1-e^{-\rho_j(x-x_{j-1})/h}}{1-e^{-\rho_j}}, & x_{j-1}\leq x\leq x_j\\
       1- \dfrac{1-e^{-\rho_{j+1}(x-x_{j})/h}}{1-e^{-\rho_{j+1}}},& x_{j}\leq x\leq x_{j+1}\\
0 & \mbox{elsewhere.}
     \end{array}
   \right.
$$
I have been able to do: \begin{align}
\psi_j(x)&=A_1+A_2e^{-\bar a(x)x/\epsilon}\\
&=A_1+A_2e^{-\bar a_jhx/(h\epsilon)}, \;\;x_{i-1}\leq x\leq x_i\\
&=A_1+A_2e^{-\rho_{j}x/h}
\end{align}
I am stuck with the constants now. I am trying to follow this book http://www.amazon.com/Numerical-Methods-Singular-Perturbation-Problems/dp/9814390739 page 27.
 A: So consider $\psi_j$ on $[x_{j-1},x_{j+1}]$, because $\psi_i(x_j)$ is the Kronecker delta, it is $1$ at $x_j$, and $0$ at two boundary points $x_{j-1}$ and $x_{j+1}$.
On $[x_{j-1},x_j]$, $a= a_{j-1}$ is a constant, and equation becomes: denote $\psi|_{x\in [x_{j-1},x_j]} = \psi_j(x)$
$$
\epsilon \psi'' + a \psi' = 0,\; \text{with }\;\psi(x_{j-1}) = 0, \;\psi(x_{j}) = 1. \tag{1}
$$
This is a constant coefficient ODE, solving the equation gives:
$$
\psi(x) = c_1 + c_2 e^{-ax/\epsilon}.\tag{2}
$$
This is basically what you have done so far. Plugging the boundary conditions in (1) yields:
$$
c_1 = \frac{e^{-ax_{j-1}/\epsilon}}{e^{-ax_{j-1}/\epsilon}-e^{-ax_j/\epsilon}},\quad c_2 = \frac{1}{e^{-ax_j/\epsilon} - e^{-ax_{j-1}/\epsilon}}.
$$
Simplifying:
$$
c_1 = \frac{1}{1-e^{-a(x_j-x_{j-1})/\epsilon}} = \frac{1}{1-e^{-\rho_j}},
$$
and
$$
c_2 = \frac{1}{ e^{-ax_{j-1}/\epsilon}(e^{-a(x_j-x_{j-1})/\epsilon} -1)} = \frac{e^{ax_{j-1}/\epsilon}}{ e^{-\rho_j} -1 }.
$$
Plugging back to (2) gives you:
$$
\psi(x) = \frac{1}{1-e^{-\rho_j}} - \frac{e^{ax_{j-1}/\epsilon}}{1- e^{-\rho_j}} e^{-ax/\epsilon} =  \frac{1-e^{-\rho_j(x-x_{j-1})/h}}{1-e^{-\rho_j}}.
$$
This is $\psi(x)$ on $[x_{j-1},x_j]$, on the right interval $[x_{j},x_{j+1}]$, the equation is still like the one in (1), just $a = a_{j}$, and boundary conditions changes to $\psi(x_{j}) = 1, \;\psi(x_{j+1}) = 0$, and you will get the other part of the formula you wrote.
For $\psi_j(x)$'s value on intervals $[x_{k},x_{k+1}]$ other than the interval $[x_{j-1},x_j]$ or $[x_{j},x_{j+1}]$, both boundary points we will have $\psi_j(x_{k}) = 0$ and $\psi_j(x_{k+1}) = 0$. The $c_1$ and $c_2$ will be zero.
Last remark: the solution set $\{\psi_j\}$ is essentially the set of locally supported hat function bases for the finite element space on this mesh.
