Consider the following boundary problem $$\begin{cases} -x''(t)+q(t)x(t)=r(t),\, t \in[t_0,T]\\ \mu x(t_0)-x'(t_0) = \alpha\\ x(T)=\beta \end{cases}$$ where $q,r \in \mathcal{C}([t_0,T]), q(t)\geq 0, \mu \geq 0$. Deduce a Finite Difference method for the problem above that is of order two and show that the system obtained has exactly one solution.
I'd like to know if what I tried is okay (I've always been struggling for BVP's with mixed conditions).
Well, first, for the method to be of order two, assume all necessary regularity conditions for $x(t)$ (I believe $x \in \mathcal{C}^2([t_0,T])$ is enough), and by Taylor we get $$x(t+h) = x(t)+hx`(t)+\frac{h^2}{2}x''(\xi),\; \xi \in (t,t+h)$$ And therefore, for all $t \in (t_0,T)$, $$x'(t) = \frac{x(t+h)-x(t)}{h}-\frac{h}{2}x''(\xi)$$ Consider now, given $N \in \mathbb{N}$ and $h = \frac{T-t_0}{N+1}$ the nodes $t_i = t_0+ih$ for $i = 0, 1, \dots , N+1$. Using the approximation above for the first node $t_0$ and the boundary condition, we get
\begin{equation} \tag{1} \mu x(t_0)-\frac{x(t_1)-x(t_0)}{h}= \alpha+\frac{h}{2}x''(\xi_0), \; \xi \in (t_0,t_0+h) \end{equation} And using the finite difference approximation $$x''(t_i)=\frac{x(t_{i-1}-2x(t_i)+x(t_{i+1}}{h^2}+\frac{h^2}{12}x^{iv)}(\xi_i),\; \xi_i \in (t_{i-1},t_{i+1})$$ we get for $i= 1, \dots, N$ \begin{equation} \tag{2}-\frac{x(t_{i-1})-2x(t_i)+x(t_{i+1})}{h^2} + q(t_i)x(t_i)=r(t_i)-\frac{h^2}{12}x^{iv)}(\xi_i) \end{equation} And finally, for the node $t_N$ and using the other boundary condition, we get \begin{equation} \tag{3}-\frac{x(t_{N-1})-2x(t_N)+\beta}{h^2} + q(t_N)x(t_N)=r(t_N)-\frac{h^2}{12}x^{iv)}(\xi_N) \end{equation} so joining $(1), (2)$ and $(3)$, the system would be as follows $$\begin{cases} \mu x(t_0)-\frac{x(t_1)-x(t_0)}{h}= \alpha+\frac{h}{2}x''(\xi_0)\\ -\frac{x(t_{i-1})-2x(t_i)+x(t_{i+1})}{h^2} + q(t_i)x(t_i)=r(t_i)-\frac{h^2}{12}x^{iv)}(\xi_i)\\ -\frac{x(t_{N-1})-2x(t_N)+\beta}{h^2} + q(t_N)x(t_N)=r(t_N)-\frac{h^2}{12}x^{iv)}(\xi_N) \end{cases}$$
Is the method obtained correct?
I'm only interested in this part even though the problem asks for more, the rest is just tedious operations to convert the system in matrix form and then check if the resulting matrix is invertible. Thank you in advance.