← Back to Blog

Linear functions

engineering > dynamics

2025-09-192 min read

#dynamics #modeling #engineering #vectors #gradient-method

This blog is based on Jong-han Kim's Linear Algebra

Superposition and linear functions

f:RnRf: \mathbf{R}^n \rightarrow \mathbf{R}
ff satisfies the superposition property if

f(αx+βy)=αf(x)+βf(y)f(\alpha x + \beta y) = \alpha f(x) + \beta f(y)

linear verus affine


The inner product function

With aa an nn-vector, the function

f(x)=aTx=a1x1+a2x2++anxnf(x) = a^Tx = a_1 x_1 + a_2 x_2 + \dots + a_n x_n

is the inner product function.

The inner product function is linear

f(αx+βy)=aT(αx+βy)=aT(αx)+aT(βy)=α(aTx)+β(aTy)=αf(x)+βf(y)\begin{align*} f(\alpha x + \beta y) &= a^T(\alpha x + \beta y) \\ &= a^T(\alpha x) + a^T(\beta y) \\ &= \alpha(a^T x) + \beta(a^T y) \\ &= \alpha f(x) + \beta f(y) \end{align*}

All linear functions are inner products

suppose f:RnRf: \mathbf{R}^n \rightarrow \mathbf{R} is linear
then it can be expressed as f(x)=aTxf(x) = a^T x for some aa
specifically: ai=f(ei)a_i = f(e_i)
follows from

f(x)=f(x1e1+x2e2++xnen)=x1f(e1)+x2f(e2)++xnf(en)\begin{align*} f(x) &= f(x_1e_1 + x_2e_2 + \dots + x_ne_n) \\ &= x_1f(e_1) + x_2f(e_2) + \dots + x_nf(e_n) \end{align*}

Affine functions

A function that is linear plus a constant is called affine.
General form is f(x)=aTx+bf(x) = a^T x + b, with aa an nn-vector and bb a scalar
a function f:RnRf: \mathbf{R}^n \rightarrow \mathbf{R} is affine if and only if

f(αx+βy)=αf(x)+βf(y)f(\alpha x + \beta y) = \alpha f(x) + \beta f(y)

holds for all α,β\alpha, \beta with α+β=1\alpha + \beta = 1, and all nn-vectors x,yx, y


First-order Taylor approximation

suppose f:RnRf: \mathbf{R}^n \rightarrow \mathbf{R}
first-order Taylor approximation of ff, near point zz:

f^(x)=f(z)+fx1(z)(x1z1)++fxn(z)(xnzn)\hat{f}(x) = f(z) + \frac{\partial f}{\partial x_1}(z)(x_1 - z_1) + \dots + \frac{\partial f}{\partial x_n}(z)(x_n - z_n)

f^(x)\hat{f}(x) is very close to f(x)f(x) when xix_i are all near ziz_i
f^\hat{f} is an affine function of xx can write using inner product as

f^(x)=f(z)+f(z)T(xz)\hat{f}(x) = f(z) + \nabla f(z)^T(x - z)

where nn-vector f(z)\nabla f(z) is the gradient of ff at zz,

f(z)=(fx1(z),,fxn(z))\nabla f(z) = \left( \frac{\partial f}{\partial x_1}(z), \dots, \frac{\partial f}{\partial x_n}(z) \right)

Regression Model

regression model is (the affine function of xx)

y^=xTβ+ν\hat{y} = x^T\beta + \nu