when x is 2 10 is the value returned and when x is -2 2 is the value returned what is the function of this
Plot your points (2, 10) and (-2, 2) on some graph paper and draw a curve that passes through both of them. You could have drawn a straight line, a parabola, a cubic, a quartic, ....., a circle, an ellipse, an exponential or logarithmic curve, or a whole stack of more exotic ones. Each one does what you ask, in that the equation of each returns your required values. So which one do you want ?