# Math Help - Linear Algebra question I'm stuck on

1. ## Linear Algebra question I'm stuck on

Give an example of a function from R^2→R such that

f(av)=af(v)

for all a in R and all v in R^2 but f is not linear

2. Originally Posted by alexmin
Give an example of a function from R^2→R such that

f(av)=af(v)

for all a in R and all v in R^2 but f is not linear
For $\bold{v} = (x,y)\in \mathbb{R}^2$ define $f(\bold{v})= x$. -- This is a mistake.

3. Originally Posted by ThePerfectHacker
For $\bold{v} = (x,y)\in \mathbb{R}^2$ define $f(\bold{v})= x$.
Sorry, that one doesn't work. The map given by $f(\bold{v})= x$ is linear, and we're looking for a nonlinear map.

The simplest one I can come up with is the map given by $f(x,y) = \left\{\begin{array}{ll}x&\text{if y\ne0,}\\ 0&\text{if y=0.}\end{array}\right.$

This preserves scalar multiplication: if y≠0 then f(ax,ay)=ax=af(x,y), and if y=0 then f(ax,ay)=f(x,y)=0.
It is not additive, however, because for example f(1,1) + f(1,–1) = 1+1=2, but (1,1)+(1,–1)=(2,0) and f(2,0) = 0.