I'm using a cubic spline interpolation for given data points. The boundary condition for the spline is that f'(a)$f'(a)$ and f'(b)$f'(b)$ are given (I'm using a finite difference formula $\frac{y_1-y_0}{x_1-x_0}$ to calculate the first derivatives f'(a)$f'(a)$ and f'(b)$f'(b)$, so they are not really given). With a$a$ and b$b$ being the boundaries. I ran into the problem, that my second derivative becomes really inaccurate at the boundarieboundary, if f'(a)$f'(a)$ and f'(b)$f'(b)$ aren't good approximations. I can't use a natural spline, since I also need a value for the second derivative at the endpoints. I'm using the spline to solve a stiff PDE. Are there any other good methods to approximate the first derivative at the endpoints?