22

I always thought linear functions need to satisfy $$f(x+y)=f(x)+f(y).$$ I am a tad confused now, consider $f(x)=2x+3$. $f(1)=5$, $f(2)=7$, $f(1+2)=f(3)=9 \neq f(1)+f(2)$ which was what I thought linear functions should satisfy.

Could someone clarify?

rubik
  • 9,166
  • 5
  • 43
  • 76
guest
  • 253
  • 2
  • 4
  • 18
    You are right, linearity means $f(x+y)=f(x)+f(y)$. Functions on ${\mathbb R}$ which really are linear are of the form $f(x)=kx$ for some $k\in {\mathbb R}$. THose of form $f(x)kx+n$ with a nonzero $n$ should be called *affine*. – Janko Bracic Feb 07 '15 at 12:12
  • here f is not a linear function. – Harish Feb 07 '15 at 12:15
  • 4
    The [Wikipedia page on "linear function"](http://en.wikipedia.org/wiki/Linear_function) could have warned you that these are false friends. – Fizz Feb 07 '15 at 12:18
  • 1
    This looks related to [Why Rotations (in CG) are not linear?](http://math.stackexchange.com/q/1133790) – robjohn Feb 07 '15 at 14:35
  • @robjohn: that's a good answer to link here as an addendum: how to make affine functions actually linear (by increasing the dimension of the space). But the only real duplicate listed here insofar is the Wikipedia link (and that's not on-site). – Fizz Feb 07 '15 at 16:47
  • 4
    @RespawnedFluff: I wasn't saying it was a duplicate, just related. – robjohn Feb 07 '15 at 17:34
  • 1
    Related to [What is the difference between linear and affine function](http://math.stackexchange.com/questions/275310/what-is-the-difference-between-linear-and-affine-function). – nwellnhof Feb 08 '15 at 11:43

2 Answers2

33

You're confusing between two different notions.

In calculus, a linear function is a polynomial function of the form $f(x)=ax+b$.

In linear algebra and functional analysis, a linear function is a linear map. (one of the properties that it satisfies is $f(x+y)=f(x)+f(y)$, known as additivity)

The difference between the two is that the latter needs to have $f(0)=0$. Proof: $$f(0)=f(0+0)=f(0)+f(0)=2f(0)\iff f(0)=0.$$ I discuss this in more detail in my (not yet finished) note.

Workaholic
  • 6,633
  • 2
  • 22
  • 57
  • 8
    actually, $f(x) = a x + b$ is called *affine* in the general, and *linear* iff $b=0$ – TemplateRex Feb 07 '15 at 21:19
  • 8
    @TemplateRex In most standard calculus textbook, a linear function is defined as a function whose graph is a line. That's why I emphasized the distinction between a linear function in the context of calculus, and in the context of linear algebra and functional analysis. Although I do agree that calling it affine would have been much better. – Workaholic Feb 07 '15 at 21:26
  • 1
    Not only in calculus. If you look up the definition of a [splitting field](http://en.wikipedia.org/wiki/Splitting_field), it will probably talk about a polynomial splitting "into linear factors". The linear factors are not necessarily of the form $ax$. – bof Feb 09 '15 at 08:20
2

$f(x)$ = $2x$ + $3$ isn't a linear function (from and to the set of real numbers). You can easily see that $f(x+y)$ = $2x$ + $2y$ + $3$, and that $f(x)$ + $f(y)$ = $2x$ + $2y$ + $6$. Equality obviously fails.

A linear function (as a mapping from and to the set of real numbers) should be in the from $ax$, where $a$ is a constant real number.

  • 7
    You will find a large number of textbooks and [websites](https://www.google.com/search?q="linear+function") which would describe $f(x)=2x+3$ as a "linear function". Others may not, but that merely means that the term is ambiguous. – Henry Feb 08 '15 at 11:36