Primitives: analytical distribution function $G(x), g(x)$ defined on $[x_0,\infty)$
I have vectors $\{x_0, ... , x_n\}$ and $\{y_0, ... , y_n\}$ defining my numerical function $y(x)$ (as a solution of an ODE). Then I get a distribution of $y$ as $F(y) = G(x(y))$, that is, $\{F(y_0) =G(x_0), ... , F(y_n)=G(x_n) \}$. $x_n$ is large enough, so that $F(y_0) = 0$, $F(y_n)=1$.
Then I need to compute $\int V(y) dF(y)$, for a numerical function $V(y)$ i.e. $\{V_0 = V(y_0), ... , V_n = V(y_n) \}$. I'm trying to find a correct way to do this. I'm using MATLAB.
My idea is to use trapz(y,V.*f), but then the question is: what is the correct $f$.
$f(y)=g(x(y))$
Derive $f$ using finite difference method on $\{F(y_0), ... , F(y_n) \}$
I would really appreciate any suggestion!