I have a function for which I know:
$f(2) = 2x -3y \\ f(3) = 5x - 6y \\ f(4) = 9x - 10 y \\ f(5) = 14x - 15y$
Assuming that $f$ is a polynomial, how do I find the general expression for $f$? After many minutes of fiddling I eventually found that this general expression works:
$f(N) = \frac{N(N+1)-2}{2}x - \frac{N(N+1)}{2}y$.
It's easy to verify that the expression works, but I found this by trial-and-error and I don't know if it's either unique or the simplest solution.
You know : $f(2) = 2x -3y \\ f(3) = 5x - 6y \\ f(4) = 9x - 10 y \\ f(5) = 14x - 15y$
Which means you know the function is in the form of
$f(N) = Ax - By$
where A and B are expressions involving N.
You can find polynomial expressions for A and B by using polynomial interpolation.
For A, the data points you use are $(2,2),(3,5),(4,9),(5,14)$.
For B, the data points you use are $(2,3),(3,6),(4,10),(5,15)$.
Putting these into an online lagrange interpolation calculator, it finds that $A = N^2/2 + N/2 - 1$ and $B = N^2/2 + N^2$ which is the same solution you found.