In this article, we describe a function fitting method that has potential applications in machine learning and also prove relevant theorems. The described function fitting method is a convex minimization problem and can be solved using a gradient descent algorithm. We also provide qualitative analysis on fitness to data of this function fitting method. The function fitting problem is also shown to be a solution of a linear, weak partial differential equation(PDE). We describe a way to fit a Sobolev function by giving a method to choose the optimal $\lambda$ parameter. We describe a closed-form solution to the derived PDE, which enables the parametrization of the solution function. We describe a simple numerical solution using a gradient descent algorithm, that converges uniformly to the actual solution. As the functional of the minimization problem is a quadratic form, there also exists a numerical method using linear algebra. Lastly, we give some numerical examples and also numerically demonstrate its application to a binary classification problem.