I have the following boundary-value problem (BVP): \begin{align*} -a(x)u''+b(x)u'+c(x)u = f(x) && \text{for $0 \leq x \leq L$,}\\ \alpha_0u'+\beta_0u=\gamma_0 && \text{at x = 0,}\\ \alpha_Lu'+\beta_Lu=\gamma_L && \text{at x = L.} \end{align*} with grid points $$x_p = p\Delta x \text{ for $0 \leq p \leq P $ where $\Delta x = \frac{L}{P}$} $$ It is given $\alpha_0 = 0, \beta_0=1$ and $\alpha_L \neq 0$. Using central difference approximations at $x = L$ we have: $$\alpha_L \frac{U_{P+1}-U_{P-1}}{2\Delta x} + \beta_LU_p = \gamma_L,$$ with $$x_{P+1} = (P+1)\Delta x = L + \Delta x.$$ The question asks to construct a $P \times P$ linear system for the unknowns $$U = \begin{bmatrix} U_1 & U_2 & ... & U_P\end{bmatrix}^{T}$$ by eliminating $U_{P+1}$.
So far I've used the central approximations of $$u'(x_p) \approx \frac{u(x_p+\Delta x) - u(x_p - \Delta x)}{2\Delta x} \approx \frac{U_{p+1}-U_{p-1}}{2\Delta x}$$ and $$u''(x_p) \approx \frac{U_{p+1}-2U_p+U_{p-1}}{\Delta x^2}$$ to substitute into the original BVP which gives me $$\frac{a(x_{p-1})}{\Delta x^2}(-U_{P-2}+2U_{P-1}) - \frac{b(x_{P-1})}{2\Delta x}U_{P-2}+c(x_{P-1})U_{P-1} = f(x_{P-1}) + (\frac{a(x_{P-1})}{\Delta x^2}-\frac{b(x_{P-1})}{2\Delta x})U_p$$The problem is I'm not sure how to use the fact about $x_{P+1}$ to get my linear system - I have the initial boundary conditions as constant, but the conditions at $x=L$ seem to make everything a mess. Any help would be much appreciated.
$$x_{P+1} = (P+1)\Delta x = L + \Delta x.\alpha_L $$
is needed to apply
$$ \frac{U_{P+1}-U_{P-1}}{2\Delta x} + \beta_LU_p = \gamma_L$$
Note that U_{P+1}=u(x_{P+1})