Numerical Change of Variables

225 Views Asked by At

If I have $f(x)$ represented by 2 arrays. One array is the arrays of $x$ while the other is output from $f(x)$. So basically a numerical representation of the function. If I don't know what $f(x)$ is, can I still change the variable. For example can I calculate $f(\frac{1}{x})$ from what I know.

1

There are 1 best solutions below

1
On BEST ANSWER

Let's say that you know $f(x_i)=f_i$ for $i=1,\dots,n$. Consider the function $g(x)=f(1/x)$ and the points $y_i=1/x_i$. Then you know $g(y_i)=f_i$. Now you can use any quadrature rule (for instance the trapezoidal rule) to get an estimate of the integral of $g$.