Let $V$ be the vector space over the complex numbers of all functions from $\mathbb{R}$ into $\mathbb{C}$. Let $f_1(x)=1$, $f_2(x)=e^{ix}$, and $f_3(x)=e^{-ix}$. Let $g_1(x)=1$, $g_2(x)=\cos x$, and $g_3(x)=\sin x$. Find an invertible $3\times 3$ matrix $P$ such that $g_j=\sum\limits_{i=1}^3 P_{ij}f_i$.
I've shown that the $f_i$ are linearly independent in the previous part of the problem. All the previous examples I've done have involved vectors rather than functions, so this has caught me off guard. It looks like I should have a basis to form a change of basis matrix, but I'm not sure how to find that in this case.
You don't have do any linear algebra till the end. Since $\cos (x) = (e^{ix} +e^{-ix}) /2$ and $\sin (x) = (e^{ix} -e^{-ix}) /2i$ you get the desired relations with the rows of P being $(1,0,0), (0,1/2,1/2), (0,1/(2i),-1/(2i)$. Just check that this matrix is indeed invertible. ( Its determinant is $i/2) \neq 0$.