I've been staring at this problem for quite sometime, but I don't think I understand bra-ket notation in the form $<a | x | a>$. I understand that <a|x> is just an inner product, but I suppose I'm a little confused once we add in that third term. Could someone break this down and perhaps expand the original problem of:
<3| a^2 + a$\mathbf{a}^\intercal$ + $\mathbf{a}^\intercal$a +($\mathbf{a}^\intercal$)^2 | 3> and perhaps show me what they're actually evaluating? I would have thought that it expanded as: <3|a^2> + <3 | a$\mathbf{a}^\intercal$> + <3|$\mathbf{a}^\intercal$a> + <3 |($\mathbf{a}^\intercal$)^2> + <a^2| 3> + <a$\mathbf{a}^\intercal$+|3> + <$\mathbf{a}^\intercal$a|3> + <$\mathbf{a}^\intercal$^2|3>, but seems as if they only keep the middle two terms acting on the |3>?