How to check if functions are linear? I know that a function is linear if $f(ax+by) = af(x)+bf(y)$, but whilst doing some exercises I came across to this one where it says that I have to check if the following functions are linear. I don't really understand how should I proceed.
\begin{align*}
  f: \mathbb{K}^{3} &\to \operatorname{Mat}(2,1 ; \mathbb{K})\\
  (x, y, z) &\mapsto \begin{bmatrix}x-y\\ y-z\end{bmatrix}
\end{align*}
\begin{align*}
  g: \mathbb{K}[x] &\to \mathbb{K}[x]\\
  P(x) &\mapsto P'(x)+2P''(x)+1
\end{align*}

Conditions of linearity of function is $(1)f(x+y)=f(x)+f(y)$ and $f(cx)=cf(x)$ where $c$ is scalar. Alternatively we may write $f(cx+dy)=cf(x)+df(x)$, $c$, $d$ are scalars. If a function satisfy these properties we declared it as linear. As $f(x) = tx$  is linear.
