The function \(f\from \RNr\to \RNr\), \(f(x)=x^3\), satisfies \(f(0)=0\). Still \(f\) is not linear: the following computation shows that \(f\) fails to commute with addition
| \(f(1+1)=f(2)\) | \(=\) | \(8\) |
| \(f(1) + f(1) = 1 + 1\) | \(=\) | \(2\) |
If \(f\) would commute with addition, we would have \(f(1+1) = f(1) + f(1)\). Visibly, this is not the case. So \(f\) is not linear.
Here is a more complicated function which sends \(\Vect{0}\) to \(\Vect{0}\) but is not linear. Consider
\[ f\from \RNrSpc{2} \longrightarrow \RNrSpc{2},\quad f(x,y) = \left\{ \begin{array}{cl} 0 & \quad \text{if $x=y=0$} \\ \sin \dfrac{\pi\cdot x}{2\sqrt{x^2+y^2}} \cdot (x,y) & \quad \text{else} \end{array} \right. \]By design, \(f(\Vect{0}) = \Vect{0}\). However, to conclude that \(f\) is linear, we must still show that it commutes with vector addition and with scalar multiplication. In the absence of a general strategy of how to go about this, we can only carry out some experiments. For example, we can test for ‘commutes with vector addition’; e.g. with
| \(f(3,0)\) | \(=\) | \(f((1,0) + (2,0)) = f(3,0) = (3,0)\) |
| \(f(1,0) + f(2,0)\) | \(=\) | \((1,0) + (2,0) = (3,0)\) |
In this particular case, the two answers agree; i.e. \(f\) commutes with addition in this particular case. Does this mean that \(f\) commutes with addition always? – Not necessarily. For example, the following experiment reveals:
| \(f((1,0) + (0,1))\) | \(=\) | \(f(1,1) = \sin \tfrac{\pi}{2\sqrt{2}}\cdot (1,1) \) |
| \(f(1,0) + f(0,1)\) | \(=\) | \((1,0) + (0,0) = (1,0)\) |
In this case \(f\) does not preserve vector addition. Therefore \(f\) is not linear.