# Fitting a function in mathematica

1. May 22, 2012

### elionix

Say I have a function:

f(x,y)

I have values for f and y such that I can make a plot of f vs y... however, from the values of f and y, I am interested in finding what x is. The x value should be a constant that is optimized to fit the f vs y graph.

Is there a way I can do this in mathematica?

you mean, taking a specific example, for instance $f(x,y)=(xy)^3$? Then, if you know for instance f(x,y)=14 and y=pi/2, that x should be $\frac{14^{1/3}}{pi/2}$. Using that you can then see that $f(x,y)=f(y)=(\frac{14^{1/3}}{pi/2} y)^3$. Trying the mathematica functions Solve and Plot should get you on your way.