# Subspace Spanned By Cosine and Sine Functions

## Problem 435

Let $\calF[0, 2\pi]$ be the vector space of all real valued functions defined on the interval $[0, 2\pi]$.
Define the map $f:\R^2 \to \calF[0, 2\pi]$ by
$\left(\, f\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix} \,\right) \,\right)(x):=\alpha \cos x + \beta \sin x.$ We put
$V:=\im f=\{\alpha \cos x + \beta \sin x \in \calF[0, 2\pi] \mid \alpha, \beta \in \R\}.$

(a) Prove that the map $f$ is a linear transformation.

(b) Prove that the set $\{\cos x, \sin x\}$ is a basis of the vector space $V$.

(c) Prove that the kernel is trivial, that is, $\ker f=\{\mathbf{0}\}$.
(This yields an isomorphism of $\R^2$ and $V$.)

(d) Define a map $g:V \to V$ by
$g(\alpha \cos x + \beta \sin x):=\frac{d}{dx}(\alpha \cos x+ \beta \sin x)=\beta \cos x -\alpha \sin x.$ Prove that the map $g$ is a linear transformation.

(e) Find the matrix representation of the linear transformation $g$ with respect to the basis $\{\cos x, \sin x\}$.

(Kyoto University, Linear Algebra exam problem)

## Terminology (image=range, kernel=null space)

We remark that the image is also called the range, and the kernel is also called the null space.

## Proof.

### (a) Prove that the map $f$ is a linear transformation.

To prove that $f:\R^2 \to \calF[0, 2\pi]$ is a linear transformation, we check the following two properties:

1. $f\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix}+\begin{bmatrix} \alpha’ \\ \beta’ \end{bmatrix} \,\right)=f\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix}\,\right)+f\left(\, \begin{bmatrix} \alpha’ \\ \beta’ \end{bmatrix} \,\right)$ for any vectors $\begin{bmatrix} \alpha\\ \beta \end{bmatrix}, \begin{bmatrix} \alpha’ \\ \beta’ \end{bmatrix} \in \R^2$.
2. $f\left(\, r\begin{bmatrix} \alpha \\ \beta \end{bmatrix} \,\right)=rf\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix}\,\right)$ for any vector $\begin{bmatrix} \alpha\\ \beta \end{bmatrix} \in \R^2$ and any scalar $r\in \R$.

For any vectors $\begin{bmatrix} \alpha\\ \beta \end{bmatrix}, \begin{bmatrix} \alpha’ \\ \beta’ \end{bmatrix} \in \R^2$, we have
\begin{align*}
\left(\, f\left(\, \begin{bmatrix}
\alpha \\
\beta
\end{bmatrix}+\begin{bmatrix}
\alpha’ \\
\beta’
\end{bmatrix} \,\right) \,\right)(x)&=
\left(\, f\left(\, \begin{bmatrix}
\alpha+\alpha’ \\
\beta+\beta’
\end{bmatrix} \,\right) \,\right)(x)\6pt] &=(\alpha+\alpha’) \cos x + (\beta+\beta’) \sin x\\ &=(\alpha \cos x + \beta \sin x)+(\alpha’\cos x + \beta’ \sin x)\\ &=\left(\, f\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix} \,\right) \,\right)(x)+\left(\, f\left(\, \begin{bmatrix} \alpha’ \\ \beta’ \end{bmatrix} \,\right) \,\right)(x), \end{align*} and hence the first property is proved. For the second one, let \begin{bmatrix} \alpha\\ \beta \end{bmatrix} \in \R^2 and r\in \R. We have \begin{align*} \left(\, f\left(\, r\begin{bmatrix} \alpha \\ \beta \end{bmatrix} \,\right) \,\right)(x)&= \left(\, f\left(\, \begin{bmatrix} r\alpha \\ r\beta \end{bmatrix} \,\right) \,\right)(x)\\ &=(r\alpha) \cos x + (r\beta) \sin x\\ &=r(\alpha \cos x + \beta \sin x)\\ &=r\left(\, f\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix}\,\right) \,\right)(x). \end{align*} This proves the property 2, and hence the map f is a linear transformation. ### (b) Prove that the set \{\cos x, \sin x\} is a basis of the vector space V. It is clear that the set \{\cos x, \sin x\} spans the vector space V by definition. Thus, it suffices to prove that \{\cos x, \sin x\} is a linearly independent set. Suppose that we have \[\alpha \cos x + \beta \sin x=0 for some $\alpha, \beta \in \R$.
This is an equality as vectors in $V$, that is, this equality holds for all $x\in [0, 2\pi]$.

In particular, we substitute $x=0$ and obtain $\alpha=0$.
Also, we substitute $x=\pi/2$ and obtain $\beta=0$.
It follows that $\{\cos x, \sin x\}$ is linearly independent, and hence it is a basis of $V$.

### (c) Prove that the kernel $\ker f=\{\mathbf{0}\}$.

If $\begin{bmatrix} \alpha \\ \beta \end{bmatrix}\in \ker f$, then we have
$\left(\, f\left(\, \begin{bmatrix} \alpha \\ \beta \end{bmatrix} \,\right) \,\right)(x)=\alpha \cos x + \beta \sin x=0$ for all $x\in [0, 2\pi]$.
As in part (b) this implies that $\alpha=\beta=0$.
Hence we have
$\begin{bmatrix} \alpha \\ \beta \end{bmatrix}=\begin{bmatrix} 0 \\ 0 \end{bmatrix}=\mathbf{0},$ and thus we obtain $\ker f=\{\mathbf{0}\}$.

By the isomorphism theorem, we obtain
$\R^2=\R^2/\{0\}=\R^2/\ker f \cong \im f =V.$

### (d) Prove that the map $g$ is a linear transformation.

Let $\alpha \cos x + \beta \sin x, \alpha’ \cos x + \beta’ \sin x$ be arbitrary vectors in $V$. Then we have
\begin{align*}
&g\left(\, (\alpha \cos x + \beta \sin x)+(\alpha’ \cos x + \beta’ \sin x) \,\right)\\
&=g\left(\, (\alpha+\alpha’) \cos x + (\beta+\beta’) \sin x)\,\right)\\
&=(\beta+\beta’)\cos x-(\alpha+\alpha’) \sin x\\
&=(\beta \cos x -\alpha \sin x)+(\beta’ \cos x -\alpha’ \sin x)\\
&=g(\alpha \cos x + \beta \sin x)+g(\alpha’ \cos x + \beta’ \sin x).
\end{align*}

We also have for any vector $\alpha \cos x + \beta \sin x \in V$ and any scalar $r\in \R$
\begin{align*}
&g\left(\, r(\alpha \cos x + \beta \sin x) \,\right)\\
&=g\left(\, (r\alpha) \cos x + (r\beta) \sin x) \,\right)\\
&=(r\beta)\cos x – (r\alpha)\sin x\\
&=r(\beta\cos x – \alpha\sin x)\\
&=rg(\alpha \cos x + \beta \sin x).
\end{align*}
Therefore $g$ is a linear transformation.

### (e) Find the matrix representation of the linear transformation $g$ with respect to the basis $\{\cos x, \sin x\}$.

We have
\begin{align*}
g(\cos x)=-\sin x \text{ and } g(\sin x)=\cos x.
\end{align*}
Thus, the coordinate vectors with respect to the basis $B:=\{\cos x, \sin x\}$ are
$[g(\cos x)]_B=\begin{bmatrix} 0 \\ -1 \end{bmatrix} \text{ and } [g(\sin x)]_B=\begin{bmatrix} 1 \\ 0 \end{bmatrix}.$ It follows that the matrix representation of $g$ is
$[\,[g(\cos x)]_B, [g(\sin x)]_B\,]=\begin{bmatrix} 0 & 1\\ -1& 0 \end{bmatrix}.$

Alternatively, we can write
$g[\cos x, \sin x]=[\cos x, \sin x] \begin{bmatrix} 0 & 1\\ -1& 0 \end{bmatrix}.$

• Idempotent Matrices are Diagonalizable Let $A$ be an $n\times n$ idempotent matrix, that is, $A^2=A$. Then prove that $A$ is diagonalizable.   We give three proofs of this problem. The first one proves that $\R^n$ is a direct sum of eigenspaces of $A$, hence $A$ is diagonalizable. The second proof proves […]
• Null Space, Nullity, Range, Rank of a Projection Linear Transformation Let $\mathbf{u}=\begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix}$ and $T:\R^3 \to \R^3$ be the linear transformation $T(\mathbf{x})=\proj_{\mathbf{u}}\mathbf{x}=\left(\, \frac{\mathbf{u}\cdot \mathbf{x}}{\mathbf{u}\cdot \mathbf{u}} \,\right)\mathbf{u}.$ (a) […]
• Find a Linear Transformation Whose Image (Range) is a Given Subspace Let $V$ be the subspace of $\R^4$ defined by the equation $x_1-x_2+2x_3+6x_4=0.$ Find a linear transformation $T$ from $\R^3$ to $\R^4$ such that the null space $\calN(T)=\{\mathbf{0}\}$ and the range $\calR(T)=V$. Describe $T$ by its matrix […]
• Show the Subset of the Vector Space of Polynomials is a Subspace and Find its Basis Let $P_3$ be the vector space over $\R$ of all degree three or less polynomial with real number coefficient. Let $W$ be the following subset of $P_3$. $W=\{p(x) \in P_3 \mid p'(-1)=0 \text{ and } p^{\prime\prime}(1)=0\}.$ Here $p'(x)$ is the first derivative of $p(x)$ and […]