The function $10\cos(5t) + 8\sin(5t)$ lies in the complex vector space with basis $e^{5it}$ and $e^{-5it}$. Find the vector with respect to that basis.
Using matrices, I got that
$$10\cos(5t) + 8\sin(5t) = \begin{pmatrix} e^{5it} & e^{-5it} \end{pmatrix} \begin{pmatrix} A \\ B \end{pmatrix}.$$
Now, letting $LHS = \begin{pmatrix} 10\cos(5t) + 8\sin(5t) \end{pmatrix}$, $Emat = \begin{pmatrix} e^{5it} & e^{-5it} \end{pmatrix}$, and $C = \begin{pmatrix} A \\ B \end{pmatrix}$, I have $$ LHS = Emat * C.$$
Since the matrices need to be square to be invertible, I thought I could do $$C^{-1} = LHS^{-1}*Emat,$$ then take the inverse of $C^{-1}$. However, the answer I got (using matlab) was wrong, and I'm wondering where I went wrong, or if there was another approach that I didn't think of. Any help would really be appreciated!
$$\begin{align*}Ae^{5it}+Be^{-5it}&=A\cos(5t)+Ai\sin(5t)+B\cos(-5t)+Bi\sin(-5t)\\ &=(A+B)\cos(5t)+(A-B)i\sin(5t)\,, \end{align*}$$ so $A+B=10$ and $(A-B)i=8$, or $A-B=-8i$.
Solving simultaneously gives $$A=5-4i, B=5+4i.$$