# Change of basis matrix for subspace of functions

$$W = \{1,\cosh x,\sinh x, \cosh 2x, \sinh 2x\}$$ is a subspace of the vector space of continuous functions on $$\mathbb{R}$$ with real values, and

$$\mathcal{B} = \{1,\cosh x,\sinh x, \cosh 2x, \sinh 2x\}$$

$$\mathcal{C} = \{\cosh^2x,\cosh x, \sinh x, \sinh 2x, \sinh^2x\}$$

are bases for $$W$$. Find the change of basis matrixes $$\underset{\mathcal{C}\leftarrow\mathcal{B}}{P}$$ and $$\underset{\mathcal{B}\leftarrow\mathcal{C}}{P}$$.

Finding a change of basis matrix from a "traditional" $$m\times n$$ matrix with scalars, I have no problem with. But with this problem i have no idea how to even begin to write down the unit vectors of these subspaces. And I think that I have to do this, if not, I'd have some nasty expressions in the reduces augmented matrix, trying to turn i.e. $$\cosh x$$ into $$1$$.

Note that $$\mathcal{B}$$ and $$\mathcal{C}$$ share three basis elements. For the other two basis elements, note that $$\cosh^2 x - \sinh^2 x = 1$$, and $$\cosh 2x = \cosh^2 x + \sinh^2 x$$ (And similarly, $$\cosh^2 x = \frac{1 + \cosh 2x}{2}$$ and $$\sinh^2 x = \frac{-1 + \cosh 2x}{2}$$). This shows that a transformation matrix from $$\mathcal{B}$$ to $$\mathcal{C}$$ is given by $$\left(\begin{matrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 1\\ -1 & 0 & 0 & 1 & 0\\ \end{matrix}\right).$$
A matrix from $$\mathcal{C}$$ to $$\mathcal{B}$$ can be found the same way.