How to measure non-linearity of a function? Suppose I have an arbitrary FINITE function from $f: \mathbb{R} \rightarrow \mathbb{R}$. What could be the possible ways to measure the non-linearity of this function?
By FINITE, I mean $f(x) < \infty, \, \forall x \in \mathbb{R}$
Link to relevant material is highly appreciated. Thanks.
 A: The graph of a linear function is, of course, a straight line. If it passes through $0$, the function is a linear map of the form $x\mapsto ax$. If the origin does not lie on a line, we have an affine function $x\mapsto ax+b$. Let me describe this case. Let $f$ be an affine function. If could be easily checked that the following equation is fulfilled: $$f\bigl(tx+(1-t)y\bigr)=tf(x)+(1-t)f(y)$$ for any $x,y\in \Bbb R$ and any $t\in\Bbb R$. If we consider $t\in [0,1]$, we describe the segment with endpoints $\bigl(x,f(x)\bigr)$, $\bigl(y,f(y)\bigr)$. On any such segment we could measure how much $f$ differs from this chord. So, fix $x<y$ and try to compute $$\sup\left\{\left|tf(x)+(1-t)f(y)-f\bigl(tx+(1-t)y\bigr)\right|\colon t\in[0,1]\right\}.$$ This approach measures linearity of a function restricted to the interval. Namely, if this supremum is $0$, then the fuction $f$ is affine on $[x,y]$.
What to do, if we consider the whole $\Bbb R$ as a domain? Maybe (possibly infinite) supremum taken over all $x,y\in\Bbb R$? I think about
$$
 \sup\left\{\left|tf(x)+(1-t)f(y)-f\bigl(tx+(1-t)y\bigr)\right|\colon t\in[0,1],x,y\in\Bbb R\right\}
$$
If it is infinite (as for parabola), the fuction is strongly nonlinear. If it is finite, then we have $$\left|tf(x)+(1-t)f(y)-f\bigl(tx+(1-t)y\bigr)\right|\le\varepsilon$$ for some $\varepsilon>0$, all $x,y\in\Bbb R$ and all $t\in[0,1]$. As I have proved in 1995 (together with Nikodem), in this case there is an affine function $\alpha(x)=ax+b$ close to $f$: $$|f(x)-(ax+b)|\le\frac{\varepsilon}{2}$$ for any $x\in\Bbb R$.
The reference to the paper: http://dx.doi.org/10.1007/BF01827935 It could be freely viewed at https://eudml.org/doc/182478
The 2nd named author is me.
