# Numerically solving the original 'function' given its second derivative

I have a data set whose second derivative I want to compute numerically, which can be obtained by $f''(x) \approx \displaystyle\frac{f(x+h) - 2f(x) + f(x-h)}{h^2}$.

My question is: given that I have values of the second derivative, can I solve for the original function and how many initial conditions do I need?

You solve a second order ODE with two initial conditions. I wonder how you would perform this operation numerically given $f''(x)$.

• Numerically integrate it twice. You will need two initial conditions. It's similar to solving an equation $f''(x) = g(x)$, whereby you get two unknown constant C's ... – Matti P. Jun 4 '18 at 8:11
• You could also consider this equations as a Laplace Equation (PDE), with boundary conditions. The defining equations for the $f''$ can be seen as a linear system for the values of $f(x_i)$ at certain points $x_i$. If you solve this system, you get a more stable approximation. – Steffen Plunder Jun 4 '18 at 8:17
You can take anti derivative of second order differentiation two times respectively with constants $C1 and c2$ to get original solution.