Since, in linear algebra, linear combination of vectors play an essential role, a function that preserves linearity must be of special importance also. Such functions are called linear functions.

Note that in single variable calculus, by a linear function, it is meant a function \( f\) from \( \mathbb{R} \) into \( \mathbb{R} \) defined as follows: $$ f(x) = ax + b,$$ where \(a\) and \(b\) are real numbers. However, in linear algebra, a function \( f : \mathbb{R}^2 \rightarrow \mathbb{R} \) is linear if it preserves linearly, i.e., the following condition, called linearity condition, holds:

- \( f (ru + sv) = r f(u) + s f(v) \) for all \( r,s \in \mathbb{R} \) and \( u, v \in \mathbb{R}^2 \).

**Examples**. In the following, we give some examples of linear functions:

- \( f(x,y) = x \)
- \( g(x,y) = x+y \)
- \( h(x,y) = 2x+3y \)

As an example, we show that \( g\) is really a linear function. Let \(u = (u_1, u_2) \) and \(v = (v_1, v_2) \) and \(r,s\) real numbers (scalars). Observe that

\( g(ru + sv) = \)

\(g(( ru_1 + sv_1 , ru_2 + sv_2)) =\)

\(ru_1 + sv_1 + ru_2 + sv_2 \)

which is the same as \( rg(u) + s g(v) \) because

\( rg(u) + s g(v) = \)

\(rg(u_1, u_2) + s g(v_1, v_2) =\)

\(r(u_1 + u_2) + s (v_1 + v_2). \)

The linearity condition holds for \( f : \mathbb{R}^2 \rightarrow \mathbb{R} \) if and only if the following conditions are satisfied:

- \( f(u + v) = f(u) + f(v) \), for all \( u, v \in \mathbb{R}^2 \).
- \( f(ru) = r f(u) \), for all \( r \in \mathbb{R} \) and \( u \in \mathbb{R}^2 \).

### The general form of linear functions

The general form of a linear function \( f : \mathbb{R}^2 \rightarrow \mathbb{R} \) is as follows:

**Exercise**. Prove that a function \( f : \mathbb{R} \rightarrow \mathbb{R} \) is linear in the sense of linear algebra if and only if there is a real number \(m\) such that \(f(x) = mx\).

**Solution**. It is clear that if \(f(x) = mx\), then \( f : \mathbb{R} \rightarrow \mathbb{R} \) is linear. Conversely, let \( f \) be linear. So, by definition, for all \( r,s \in \mathbb{R}\) and \(x, y \in \mathbb{R}\), we have $$ f (rx + sy) = r f(x) + s f(y).$$ Now, let \( r = m\) and \(s = 0\). Hence, the value of the function \(f\) is \( f(x) = mx \), as required.

An excellent exercise related to the previous exercise is as follows:

**Exercise (Cauchy’s functional equation)**. Let \( f : \mathbb{R} \rightarrow \mathbb{R} \) be a function satisfying $$f(x+y) = f(x) + f(y), $$ for all \( x,y \in \mathbb{R}.\) Prove that if \(f\) is continuous, then there is a real number \(m \) such that \(f(x) = mx. \)

Note that a functional equation is an equation in which functions are its unknowns. In this sense, any differential equation is also a functional equation.

**Exercise**. Let \(f(x,y) = \sqrt[3]{x^3 + y^3} \). Prove that \(f(r(x,y)) = r f(x,y)\), for all \(r,x,y \in \mathbb{R}.\) Is the function \(f\) linear?

**Terminological remark**. In some references, linear functions are called “linear maps”, and also, “linear transformations”. See transformation for a lexical discussion.