- Last updated

- Save as PDF

- Page ID
- 22922

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}}}\) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

One of the central themes of calculus is the approximation of nonlinear functions by linear functions, with the fundamental concept being the derivative of a function. This section will introduce the linear and affine functions which will be key to understanding derivatives in the chapters ahead.

## Linear functions

In the following, we will use the notation \( f: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n} \) to indicate a function whose domain is a subset of \(\mathbb{R}^{m}\)* ^{ }*and whose range is a subset of \( \mathbb{R}^{n}\). In other words, \(f\)

*takes a vector with \(m\)*

*coordinates for input and returns a vector with \(n\)*

*coordinates. For example, the function*

\[ f(x, y, z)=\left(\sin (x+y), 2 x^{2}+z\right) \nonumber \]

is a function from \( \mathbb{R}^{3}\)^{ }to \(\mathbb{R}^{2}\).

Definition \(\PageIndex{1}\)

We say a function \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}^{m}\)* ^{ }*is

*linear*if (1) for any vectors \(\mathbf{x}\)

**and \(\mathbf{y}\)**

**in \(\mathbb{R}^{m}\),**

\[ L(\mathbf{x}+\mathbf{y})=L(\mathbf{x})+L(\mathbf{y}), \]

and (2) for any vector \(\mathbf{x}\)** **in \(\mathbb{R}^{m}\)* ^{ }*and scalar \(a\),

\[ L(a \mathbf{x})=a L(\mathbf{x}). \]

Example \(\PageIndex{1}\)

Suppose \(f: \mathbb{R} \rightarrow \mathbb{R}\) is defined by \(f(x)=3 x\). Then for any \(x\)* *and \(y\)* *in \(\mathbb{R}\),

\[ f(x+y)=3(x+y)=3 x+3 y=f(x)+f(y), \nonumber \]

and for any scalar \(a\),

\[ f(a x)=3 a x=a f(x). \nonumber \]

Thus \(f\) is linear.

Example \(\PageIndex{2}\)

Suppose \(L: \mathbb{R}^{2} \rightarrow \mathbb{R}^{3}\) is defined by

\[ L\left(x_{1}, x_{2}\right)=\left(2 x_{1}+3 x_{2}, x_{1}-x_{2}, 4 x_{2}\right). \nonumber \]

Then if \(\mathbf{x}=\left(x_{1}, x_{2}\right)\) and \(\mathbf{y}=\left(y_{1}, y_{2}\right)\) are vectors in \(\mathbb{R}^2\),

\[ \begin{aligned}

L(\mathbf{x}+\mathbf{y}) &=L\left(x_{1}+y_{1}, x_{2}+y_{2}\right) \\

&=\left(2\left(x_{1}+y_{1}\right)+3\left(x_{2}+y_{2}\right), x_{1}+y_{1}-\left(x_{2}+y_{2}\right), 4\left(x_{2}+y_{2}\right)\right) \\

&=\left(2 x_{1}+3 x_{2}, x_{1}-x_{2}, 4 x_{2}\right)+\left(2 y_{1}+3 y_{2}, y_{1}-y_{2}, 4 y_{2}\right) \\

&=L\left(x_{1}, x_{2}\right)+L\left(y_{1}, y_{2}\right) \\

&=L(\mathbf{x})+L(\mathbf{y}).

\end{aligned}\]

Also, for \( \mathbf{x}=\left(x_{1}, x_{2}\right)\) and any scalar \(a\), we have

\[ \begin{aligned}

L(a \mathbf{x}) &=L\left(a x_{1}, a x_{2}\right) \\

&=\left(2 a x_{1}+3 a x_{2}, a x_{1}-a x_{2}, 4 a x_{2}\right) \\

&=a\left(2 x_{2}+3 x_{2}, x_{1}-x_{2}, 4 x_{2}\right) \\

&=a L(\mathbf{x}).

\end{aligned} \]

Thus \(L\)* *is linear.

Now suppose \( L: \mathbb{R} \rightarrow \mathbb{R}\) is a linear function and let \(a=L(1)\). Then for any real number \(x\),

\[ L(x)=L(1 x)=x L(1)=a x. \]

Since any function \(L: \mathbb{R} \rightarrow \mathbb{R}\) defined by \(L(x)=a x\), where \(a\)* *is a scalar, is linear (see Exercise 1), it follows that the only functions \( L: \mathbb{R} \rightarrow \mathbb{R}\) which are linear are those of the form \(L(x)=a x\) for some real number \(a\). For example, \(f(x)=5 x\) is a linear function, but \(g(x)=\sin (x) \) is not.

Next, suppose \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}\) is linear and let \(a_{1}=L\left(\mathbf{e}_{1}\right), a_{2}=L\left(\mathbf{e}_{2}\right), \ldots, a_{m}=L\left(\mathbf{e}_{m}\right)\). If \(\mathbf{x}=\left(x_{1}, x_{2}, \ldots, x_{m}\right)\) is a vector in \(\mathbb{R}^{m}\), then we know that

\[ \mathbf{x}=x_{1} \mathbf{e}_{1}+x_{2} \mathbf{e}_{2}+\cdots+x_{m} \mathbf{e}_{m}. \nonumber \]

Thus

\begin{align}

L(\mathbf{x}) &=L\left(x_{1} \mathbf{e}_{1}+x_{2} \mathbf{e}_{2}+\cdots+x_{m} \mathbf{e}_{m}\right) \nonumber \\

&=L\left(x_{1} \mathbf{e}_{1}\right)+L\left(x_{2} \mathbf{e}_{2}\right)+\cdots+L\left(x_{m} \mathbf{e}_{m}\right) \nonumber\\

&=x_{1} L\left(\mathbf{e}_{1}\right)+x_{2} L\left(\mathbf{e}_{2}\right)+\cdots+x_{m} L\left(\mathbf{e}_{m}\right) \label{} \\

&=x_{1} a_{1}+x_{2} a_{2}+\cdots+x_{m} a_{m} \nonumber\\

&=\mathbf{a} \cdot \mathbf{x}, \nonumber

\end{align}

where \(a=\left(a_{1}, a_{2}, \ldots, a_{m}\right)\). Since for any vector \(\mathbf{a}\)** **in \(\mathbb{R}^m\), the function \(L(\mathbf{x})=\mathbf{a} \cdot \mathbf{x}\) is linear (see Exercise 1), it follows that the only functions \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}\) which are linear are those of the form \(L(\mathbf{x})=\mathbf{a} \cdot \mathbf{x}\) for some fixed vector \(\mathbf{a}\)** **in \(\mathbb{R}^m\). For example,

\[ f(x, y)=(2,-3) \cdot(x, y)=2 x-3 y \nonumber\]

is a linear function from \(\mathbb{R}^2\)^{ }to \(R\), but

\[f(x, y, z)=x^{2} y+\sin (z) \nonumber \]

is not a linear function from \(\mathbb{R}^3\)^{ }to \(R\).

Now consider the general case where \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\)* ^{ }*is a linear function. Given a vector \(\mathbf{x}\)

**in \(\mathbb{R}^{m}\), let \(L_{k}(\mathbf{x})\) be the \(k\)th coordinate of \(L(\mathbf{x}), k=1,2, \ldots, n\). That is,**

\[L(\mathbf{x})=\left(L_{1}(\mathbf{x}), L_{2}(\mathbf{x}), \ldots, L_{n}(\mathbf{x})\right). \nonumber \]

Since \(L\)* *is linear, for any \(\mathbf{x}\)** **and \(\mathbf{y}\)** **in \(\mathbb{R}^m\)* ^{ }*we have

\[ L(\mathbf{x}+\mathbf{y})=L(\mathbf{x})+L(\mathbf{y}), \nonumber \]

or, in terms of the coordinate functions,

\begin{aligned}

\left(L_{1}(\mathbf{x}+\mathbf{y}), L_{2}(\mathbf{x}+\mathbf{y}), \ldots, L_{n}(\mathbf{x}+\mathbf{y})\right)=\left(L_{1}(\mathbf{x}), L_{2}(\mathbf{x}), \ldots,\right.&\left.L_{n}(\mathbf{x})\right) \\

&+\left(L_{1}(\mathbf{y}), L_{2}(\mathbf{y}), \ldots, L_{n}(\mathbf{y})\right) \\

=\left(L_{1}(\mathbf{x})+L_{1}(\mathbf{y}), L_{2}\right.&(\mathbf{x})+L_{2}(\mathbf{y}) \\

&\left.\ldots, L_{n}(\mathbf{x})+L_{n}(\mathbf{y})\right).

\end{aligned}

Hence \(L_{k}(\mathbf{x}+\mathbf{y})=L_{k}(\mathbf{x})+L_{k}(\mathbf{y})\) for \(k=1,2, \ldots, n\). Similarly, if \(\mathbf{x}\)** **is in \(\mathbb{R}^{m}\)* ^{ }*and \(a\)

*is a scalar, then \(L(a \mathbf{x})=a L(\mathbf{x})\), so*

\begin{aligned}

\left(L_{1}(a \mathbf{x}), L_{2}(a \mathbf{x}), \ldots, L_{n}(a \mathbf{x})\right.&=a\left(L_{1}(\mathbf{x}), L_{2}(\mathbf{x}), \ldots, L_{n}(x)\right) \\

&=\left(a L_{1}(\mathbf{x}), a L_{2}(\mathbf{x}), \ldots, a L_{n}(x)\right) .

\end{aligned}

Hence \(L_{k}(a \mathbf{x})=a L_{k}(\mathbf{x})\) for \(k=1,2, \ldots, n\). Thus for each \(k=1,2, \ldots, n, L_{k}: \mathbb{R}^{m} \rightarrow \mathbb{R}\) is a linear function. It follows from our work above that, for each \(k=1,2, \ldots, n\), there is a fixed vector \(\mathbf{a}_{k}\)* _{ }*in \(\mathbb{R}^{m}\)

*such that \(L_{k}(x)=\mathbf{a}_{k} \cdot \mathbf{x}\)*

^{ }**for all \(\mathbf{x}\)**

**in \(\mathbb{R}^{m}\). Hence we have**

\[L(\mathbf{x})=\left(\mathbf{a}_{1} \cdot \mathbf{x}, \mathbf{a}_{2} \cdot \mathbf{x}, \ldots, \mathbf{a}_{n} \cdot \mathbf{x}\right) \label{1.5.5} \]

for all \(\mathbf{x}\)** **in \(\mathbb{R}^m\). Since any function defined as in (\(\ref{1.5.5}\)) is linear (see Exercise 1 again), it follows that the only linear functions from \(\mathbb{R}^m\)* ^{ }*to \(\mathbb{R}^n\)

*must be of this form.*

^{ }Theorem \(\PageIndex{1}\)

If \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\)* ^{ }*is linear, then there exist vectors \(\mathbf{a}_{1}, \mathbf{a}_{2}, \ldots, \mathbf{a}_{n}\)

*in \(\mathbb{R}^{m}\)*

_{ }*such that*

^{ }\[L(\mathbf{x})=\left(\mathbf{a}_{1} \cdot \mathbf{x}, \mathbf{a}_{2} \cdot \mathbf{x}, \ldots, \mathbf{a}_{n} \cdot \mathbf{x}\right) \label{1.5.6}\]

for all \(\mathbf{x}\) in \(\mathbb{R}^{m}\).

Example \(\PageIndex{3}\)

In a previous example, we showed that the function \(L: \mathbb{R}^{2} \rightarrow \mathbb{R}^{3}\)^{ }defined by

\[ L\left(x_{1}, x_{2}\right)=\left(2 x_{1}+3 x_{2}, x_{1}-x_{2}, 4 x_{2}\right) \nonumber \]

is linear. We can see this more easily now by noting that

\[ L\left(x_{1}, x_{2}\right)=\left((2,3) \cdot\left(x_{1}, x_{2}\right),(1,-1) \cdot\left(x_{1}, x_{2}\right),(0,4) \cdot\left(x_{1}, x_{2}\right)\right). \nonumber \]

Example \(\PageIndex{4}\)

The function

\[ f(x, y, z)=(x+y, \sin (x+y+z)) \nonumber \]

is not linear since it cannot be written in the form of (\(\ref{1.5.6}\)). In particular, the function \(f_{2}(x, y, z)=\sin (x+y+z)\) is not linear; from our work above, it follows that \(f\)* *is not linear.

## Matrix Notation

We will now develop some notation to simplify working with expressions such as (\(\ref{1.5.6}\)). First, we define an \(n \times m\)* *matrix to be to be an array of real numbers with \(n\)* *rows and \(m\)* *columns. For example,

\[ M=\left[\begin{array}{rr}

2 & 3 \\

1 & -1 \\

0 & 4

\end{array}\right] \nonumber \]

is a \(3 \times 2\) matrix. Next, we will identify a vector \(\mathbf{x}=\left(x_{1}, x_{2}, \ldots, x_{m}\right)\) in \(\mathbb{R}^{m}\)* ^{ }*with the \(m \times 1\) matrix

\[\mathbf{x}=\left[\begin{array}{c}

x_{1} \\

x_{2} \\

\vdots \\

x_{m}

\end{array}\right], \nonumber \]

which is called a *column vector*. Now define the product \(M \mathbf{x}\)** **of an \(n \times m\) matrix \(M\)* *with an \(m \times 1\) column vector \(\mathbf{x}\)** **to be the \(n \times 1\) column vector whose \(k\)th entry, \(k=1,2, \ldots, n\), is the dot product of the \(k\)th row of \(M\)* *with \(\mathbf{x}\). For example,

\[ \left[\begin{array}{rr}

2 & 3 \\

1 & -1 \\

0 & 4

\end{array}\right]\left[\begin{array}{l}

2 \\

1

\end{array}\right]=\left[\begin{array}{l}

4+3 \\

2-1 \\

0+4

\end{array}\right]=\left[\begin{array}{l}

7 \\

1 \\

4

\end{array}\right]. \nonumber \]

In fact, for any vector \(\mathbf{x}=\left(x_{1}, x_{2}\right)\) in \(\mathbb{R}^{2}\),

\[ \left[\begin{array}{rr}

2 & 3 \\

1 & -1 \\

0 & 4

\end{array}\right]\left[\begin{array}{l}

x_{1} \\

x_{2}

\end{array}\right]=\left[\begin{array}{c}

2 x_{1}+3 x_{2} \\

x_{1}-x_{2} \\

4 x_{2}

\end{array}\right]. \nonumber \]

In other words, if we let

\[ L\left(x_{1}, x_{2}\right)=\left(2 x_{1}+3 x_{2}, x_{1}-x_{2}, 4 x_{2}\right), \nonumber \]

as in a previous example, then, using column vectors, we could write

\[ L\left(x_{1}, x_{2}\right)=\left[\begin{array}{cc}

2 & 3 \\

1 & -1 \\

0 & 4

\end{array}\right]\left[\begin{array}{l}

x_{1} \\

x_{2}

\end{array}\right]. \nonumber \]

In general, consider a linear function \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\)* ^{ }*defined by

\[ L(\mathbf{x})=\left(\mathbf{a}_{1} \cdot \mathbf{x}, \mathbf{a}_{2} \cdot \mathbf{x}, \ldots, \mathbf{a}_{n} \cdot \mathbf{x}\right) \]

for some vectors \(\mathbf{a}_{1}, \mathbf{a}_{2}, \ldots, \mathbf{a}_{n}\)* _{ }*in \(\mathbb{R}^{m}\). If we let \(M\)

*be the \(n \times m\)*

*matrix whose \(k\)th row is \(\mathbf{a}_{k}, k=1,2, \ldots, n\), then*

\[ L(\mathbf{x})=M \mathbf{x} \]

for any \(\mathbf{x}\)** **in \(\mathbb{R}^m\). Now, from our work above,

\[ \mathbf{a}_{k}=\left(L_{k}\left(\mathbf{e}_{1}\right), L_{k}\left(\mathbf{e}_{2}\right), \ldots, L_{k}\left(\mathbf{e}_{m}\right)\right. ,\]

which means that the \(j\)th column of \(M\)* *is

\[ \left[\begin{array}{c}

L_{1}\left(\mathbf{e}_{j}\right) \\

L_{2}\left(\mathbf{e}_{j}\right) \\

\vdots \\

L_{n}\left(\mathbf{e}_{j}\right)

\end{array}\right], \label{1.5.10} \]

\(j=1,2, \ldots, m\). But (\(\ref{1.5.10}\)) is just \(L\left(\mathbf{e}_{j}\right)\) written as a column vector. Hence \(M\)* *is the matrix whose columns are given by the column vectors \(L\left(\mathbf{e}_{1}\right), L\left(\mathbf{e}_{2}\right), \ldots, L\left(\mathbf{e}_{m}\right)\).

Theorem \(\PageIndex{2}\)

Suppose \(L: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\)* ^{ }*is a linear function and \(M\)

*is the \(n \times m\)*

*matrix whose \(j\)th column is \(L\left(\mathbf{e}_{j}\right), j=1,2, \ldots, m\). Then for any vector \(\mathbf{x}\)*

**in \(\mathbb{R}^m\),**

\[ L(\mathbf{x})=M \mathbf{x}. \]

Example \(\PageIndex{5}\)

Suppose \(L: \mathbb{R}^{3} \rightarrow \mathbb{R}^{2}\)^{ }is defined by

\[ L(x, y, z)=(3 x-2 y+z, 4 x+y). \nonumber \]

Then

\[ \begin{aligned}

&L\left(\mathbf{e}_{1}\right)=L(1,0,0)=(3,4), \\

&L\left(\mathbf{e}_{2}\right)=L(0,1,0)=(-2,1),

\end{aligned} \]

and

\[ L\left(\mathbf{e}_{3}\right)=L(0,0,1)=(1,0). \nonumber \]

So if we let

\[ M=\left[\begin{array}{rrr}

3 & -2 & 1 \nonumber \\

4 & 1 & 0

\end{array}\right], \nonumber \]

then

\[ L(x, y, z)=\left[\begin{array}{lrl}

3 & -2 & 1 \\

4 & 1 & 0

\end{array}\right]\left[\begin{array}{l}

x \\

y \\

z

\end{array}\right]. \nonumber \]

For example,

\[ \begin{equation}

L(1,-1,3)=\left[\begin{array}{rrr}

3 & -2 & 1 \\

4 & 1 & 0

\end{array}\right]\left[\begin{array}{r}

1 \\

-1 \\

3

\end{array}\right]=\left[\begin{array}{l}

3+2+3 \\

4-1+0

\end{array}\right]=\left[\begin{array}{l}

8 \\

3

\end{array}\right].

\end{equation} \nonumber \]

Example \(\PageIndex{6}\)

Let \(\begin{equation} R_{\theta}: \mathbb{R}^{2} \rightarrow \mathbb{R}^{2} \end{equation}\)^{ }be the function that rotates a vector \(\mathbf{x}\)** **in \(\mathbb{R}^2\)^{ }counterclockwise through an angle *θ*, as shown in Figure 1.5.1. Geometrically, it seems reasonable that \(R_\theta\)* _{ }*is a linear function; that is, rotating the vector \(\mathbf{x}+\mathbf{y} \)

**through an angle**

*θ*should give the same result as first rotating \(\mathbf{x}\)

**and \(\mathbf{y}\)**

**separately through an angle**

*θ*and then adding, and rotating a vector \(a \mathbf{x}\)

**through an angle**

*θ*should give the same result as first rotating \( \mathbf{x}\)

**through an angle**

*θ*and then multiplying by \(a\). Now, from the definition of \(\cos(\theta)\) and \(\sin(\theta)\),

\[ R_{\theta}\left(\mathbf{e}_{1}\right)=R_{\theta}(1,0)=(\cos (\theta), \sin (\theta)) \nonumber \]

(see Figure 1.5.2), and, since \(\mathbf{e}_{2}\)_{ }is \(\mathbf{e}_{1}\)_{ }rotated, counterclockwise, through an angle \(\frac{\pi}{2}\),

\[ R_{\theta}\left(\mathbf{e}_{2}\right)=R_{\theta+\frac{\pi}{2}}\left(\mathbf{e}_{1}\right)=\left(\cos \left(\theta+\frac{\pi}{2}\right), \sin \left(\theta+\frac{\pi}{2}\right)\right)=(-\sin (\theta), \cos (\theta)). \nonumber \]

\[ R_{\theta}(x, y)=\left[\begin{array}{rr}

\cos (\theta) & -\sin (\theta) \\

\sin (\theta) & \cos (\theta)

\end{array}\right]\left[\begin{array}{l}

x \\

y

\end{array}\right]. \label{1.5.12} \]

You are asked in Exercise 9 to verify that the linear function defined in (\(\ref{1.5.12}\)) does in fact rotate vectors through an angle *θ *in the counterclockwise direction. Note that, for example, when \(\theta=\frac{\pi}{2}\), we have

\[ R_{\frac{\pi}{2}}(x, y)=\left[\begin{array}{rr}

0 & -1 \\

1 & 0

\end{array}\right]\left[\begin{array}{l}

x \\

y

\end{array}\right]. \nonumber \]

In particular, note that \(R_{\frac{\pi}{2}}(1,0)=(0,1)\) and \(R_{\frac{\pi}{2}}(0,1)=(-1,0)\); that is, \(R_{\frac{\pi}{2}}\) takes \(\mathbf{e}_{1}\)_{ }to \(\mathbf{e}_{2}\)_{ }and \(\mathbf{e}_{2}\)_{ }to \(-\mathbf{e}_{1}\). For another example, if \(\theta=\frac{\pi}{6}\), then

\[ R_{\frac{\pi}{6}}(x, y)=\left[\begin{array}{cc}

\frac{\sqrt{3}}{2} & -\frac{1}{2} \\

\frac{1}{2} & \frac{\sqrt{3}}{2}

\end{array}\right]\left[\begin{array}{l}

x \\

y

\end{array}\right]. \nonumber \]

In particular,

\[ \begin{equation}

R_{\frac{\pi}{6}}(1,2)=\left[\begin{array}{cc}

\frac{\sqrt{3}}{2} & -\frac{1}{2} \\

\frac{1}{2} & \frac{\sqrt{3}}{2}

\end{array}\right]\left[\begin{array}{l}

1 \\

2

\end{array}\right]=\left[\begin{array}{c}

\frac{\sqrt{3}}{2}-1 \\

\frac{1}{2}+\sqrt{3}

\end{array}\right]=\left[\begin{array}{c}

\frac{\sqrt{3}-2}{2} \\

\frac{1+2 \sqrt{3}}{2}

\end{array}\right]

\end{equation}. \nonumber \]

## Affine functions

Definition \(\PageIndex{2}\)

We say a function \(A: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\) is *affine *if there is a linear function \(L : \mathbb{R}^{m} \rightarrow \mathbb{R}^{n} \)* ^{ }*and a vector \(\mathbf{b}\)

**in \(\mathbb{R}^n\)**

*such that*

^{ }\[ A(\mathbf{x})=L(\mathbf{x})+\mathbf{b}\]

for all \(\mathbf{x}\) in \( \mathbb{R}^m\).

An affine function is just a linear function plus a translation. From our knowledge of linear functions, it follows that if \(A: \mathbb{R}^{m} \rightarrow \mathbb{R}^{n}\)* ^{ }*is affine, then there is an \(n \times m\)

*matrix \(M\)*

*and a vector \(\mathbf{b}\)*

**in \(\mathbb{R}^n\)**

*such that*

^{ }\[ A(\mathbf{x})=M \mathbf{x}+\mathbf{b}\]

for all \(\mathbf{x}\)** **in \(\mathbb{R}^m\). In particular, if \(f: \mathbb{R} \rightarrow \mathbb{R}\) is affine, then there are real numbers \(m\)* *and \(b\)* *such that

\[ f(x)=m x+b\]

for all real numbers \(x\).

Example \(\PageIndex{7}\)

The function

\[A(x, y)=(2 x+3, y-4 x+1) \nonumber \]

is an affine function from \(\mathbb{R}^{2}\)^{ }to \(\mathbb{R}^{2}\)^{ }since we may write it in the form

\[ A(x, y)=L(x, y)+(3,1), \nonumber \]

where \(L\) is the linear function

\[ L(x, y)=(2 x, y-4 x). \nonumber \]

Note that \(L(1,0)=(2,-4)\) and \(L(0,1)=(0,1)\), so we may also write \(A\)* *in the form

\[A(x, y)=\left[\begin{array}{rr}

2 & 0 \\

-4 & 1

\end{array}\right]\left[\begin{array}{l}

x \\

y

\end{array}\right]+\left[\begin{array}{l}

3 \\

1

\end{array}\right] . \nonumber \]

Example \(\PageIndex{8}\)

The affine function

\[A(x, y)=\left[\begin{array}{cc}

\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\

\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}

\end{array}\right]\left[\begin{array}{l}

x \\

y

\end{array}\right]+\left[\begin{array}{l}

1 \\

2

\end{array}\right] \nonumber \]

first rotates a vector, counterclockwise, in \(\mathbb{R}^{2}\)^{ }through an angle of \(\frac{\pi}{4}\) and then translates it by the vector \( (1,2) \).

## FAQs

### How do you tell if a function is linear or affine? ›

Definition 4 We say **a function A : <m → <n is affine if there is a linear function L : <m → <n and a vector b in <n such that A(x) = L(x) + b for all x in <m**. In other words, an affine function is just a linear function plus a translation.

**Are affine functions always linear? ›**

Linear must be affine, but **affine is not necessarily linear**. In this blog post, I would like to discuss the difference and relationship between linear and affine on functions, spaces, and transformations.

**Is affine the same as linear? ›**

So, no, an affine transformation is not a linear transformation as defined in linear algebra, but **all linear transformations are affine**. However, in machine learning, people often use the adjective linear to refer to straight-line models, which are generally represented by functions that are affine transformations.

**Why is an affine transformation not linear? ›**

Unlike a purely linear transformation, an affine transformation **need not preserve the origin of the affine space**. Thus, every linear transformation is affine, but not every affine transformation is linear.

**How do you know if it is not a linear function? ›**

The easiest way to know if a function is linear or not is to look at its graph. A linear function forms a straight line when it is plotted on a graph. **A nonlinear function does not form a straight line: it is curved in some way**.

**How do you know if a problem is a linear function? ›**

Note: To determine if an equation is a linear function, **it must have the form y=mx+b (in which m is the slope and b is the y-intercept)**.

**What is the rule for affine function? ›**

An affine function is a function composed of a linear function + a constant and its graph is a straight line. The general equation for an affine function in 1D is: **y = Ax + c**. An affine function demonstrates an affine transformation which is equivalent to a linear transformation followed by a translation.

**What is the difference between affine and linear logic? ›**

**Linear type systems have exchange only, so every variable must be used exactly once.** **Affine type systems have exchange and weakening, so every variable can be used at most once**. Relevant type systems have exchange and contraction, so every variable must be used at least once.

**Why would a function not be linear? ›**

The graph of a linear function is a line. Thus, the graph of a nonlinear function is not a line. **Linear functions have a constant slope, so nonlinear functions have a slope that varies between points**.

**What do you understand by linear and affine transformation? ›**

**Affine transformation is a linear mapping method that preserves points, straight lines, and planes**. Sets of parallel lines remain parallel after an affine transformation. The affine transformation technique is typically used to correct for geometric distortions or deformations that occur with non-ideal camera angles.

### What is the difference between affine and linear subspace? ›

The displacement vectors for that affine space are the solutions of the corresponding homogeneous linear system, which is a linear subspace. **Linear subspaces, in contrast, always contain the origin of the vector space**. The dimension of an affine space is defined as the dimension of the vector space of its translations.

**What is the opposite of affine transformation? ›**

The inverse of an affine transformation is also affine, assuming it exists. Proof: Let ¯q = A¯p+ t and assume A−1 exists, i.e. det(A) = 0. Then A¯p = ¯q− t, so **¯p = A−1 ¯q− A−1t**.

**What is the math behind affine transformation? ›**

The affine transforms scale, rotate and shear are actually linear transforms and can be represented by a matrix multiplication of a point represented as a vector, **[x y ] = [ax + by dx + ey ] = [a b d e ][x y ] ,** **or x = Mx, where M is the matrix**.

**Can affine transformations bend a straight line? ›**

A one-to-one point mapping of the plane or space into itself, where to three points lying on a straight line correspond three points also lying on a straight line. Thus, **by an affine transformation straight lines are transformed into straight lines**.

**How do you prove that T is not a linear transformation? ›**

To prove that a function is not a linear transformation --- unlike proving that it is --- **you must come up with specific, numerical vectors u and v and a number k for which the defining equation is false**.

**What are 4 types of non linear functions? ›**

We look at different types of nonlinear functions, including **quadratic functions, poly- nomials and rational, exponential and logarithmic functions**, as well as some applica- tions such as growth and decay and financial functions.

**Can a line be linear but not a function? ›**

Answer and Explanation: **The only time a linear equation is not a function is when it is a vertical line**, where vertical lines have equations of the form x = a, where a is any real number.

**What is an example of a linear function's real life situation? ›**

Here is a real-world example to show its usefulness. **Consider a bake sale committee that earns $150.00 a month in cost while incurring a one-time start-up cost of $200.00**. A linear function that represents this situation would be: y=150x−200 y = 150 x − 200 .

**What are the rules for linear functions? ›**

A linear function **must satisfy f(cx)=cf(x) for any number c**. The other requirement for a linear function is that applying f to the sum of two inputs x and y is the same thing as adding the results from being applied to the inputs individually, i.e., f(x+y)=f(x)+f(y).

**What is an example of a linear function problem? ›**

Application of problem involving linear functions. Example: **A cereal company finds that if it spends $40,000 on advertising, then 100,000 boxes of cereal will be sold, and of it spends $60,000, then 200,000 boxes will be sold**.

### How many matches do we need to solve an affine transformation? ›

In other words you need (at least) **6 points (= 3 pairs)** to compute your transformation. Note: you need at least 6 points in the sense that if you get more than that, then your system is overdetermined which means you can find an approximate solution e.g with least squares, which is the point of your article.

**Why is affine important? ›**

Affine spaces are important because **the space of solutions of a system of linear equations is an affine space**, although it is a vector space if and only if the system is homogeneous.

**How do you prove a set is affine? ›**

A set A is said to be an affine set **if for any two distinct points, the line passing through these points lie in the set A**. S is an affine set if and only if it contains every affine combination of its points. Empty and singleton sets are both affine and convex set.

**What is an example of affine set? ›**

**The empty set and the space R" itself** are extreme examples of affine sets. Also covered by the definition is the case where M consists of a solitary point. In general, an affine set has to contain, along with any two different points, the entire line through those points.

**What is an example of affine combination? ›**

To give a simple example of this, consider two points P0 and P1. Any point P on the line passing through these two points can be written as **P = α0P0 + α1P1** which is an affine combination of the two points.

**What is linear vs non linear logic? ›**

If you have ever sat down to complete a task from the beginning to end, one step after another, you've engaged in linear thinking. On the other hand, **if your mind resists thinking one step at a time, your thoughts jumping ahead or leaping back to make a connection, you're probably a non-linear thinker**.

**What is an example of a linear and non linear function? ›**

For example, **\(f(x) = 4x + 8\) is a linear function, whereas \(f(x) = 150 + x^3\) is a nonlinear function**. Linear functions have a constant slope for any two points on the line, whereas the slope of nonlinear functions is not constant.

**What does affine system mean? ›**

Affine systems are **nonlinear systems that are linear in the input**. They can be specified in multiple ways and can also be converted to other systems models. A system specified using an ODE.

**What are the types of affine? ›**

Types of affine transformations include **translation (moving a figure), scaling (increasing or decreasing the size of a figure), and rotation (turning a figure about a point)**.

**What is affine shape? ›**

Affine shape adaptation is a methodology for iteratively adapting the shape of the smoothing kernels in an affine group of smoothing kernels to the local image structure in neighbourhood region of a specific image point.

### Why is an affine transformation linear? ›

Affine transformation is a linear mapping method that **preserves points, straight lines, and planes**. Sets of parallel lines remain parallel after an affine transformation. The affine transformation technique is typically used to correct for geometric distortions or deformations that occur with non-ideal camera angles.

**Is an affine space a linear space? ›**

**The displacement vectors for that affine space are the solutions of the corresponding homogeneous linear system, which is a linear subspace**. Linear subspaces, in contrast, always contain the origin of the vector space. The dimension of an affine space is defined as the dimension of the vector space of its translations.

**Is a function always a linear equation? ›**

While all linear equations produce straight lines when graphed, **not all linear equations produce linear functions**. In order to be a linear function, a graph must be both linear (a straight line) and a function (matching each x-value to only one y-value).

**What is affine vs linear vs convex? ›**

**linear - plane connecting the two points**. **affine - infinite line connecting the two points**. **convex - triangle with vertices at origin and the two points**.