Difficult seeing expanded form of an inner product I'm reading "Linear Algebra Done Right" by Sheldon Axler and I have a question about a proof.
Suppose $V$ is a complex inner product space (i.e. inner product space over $\mathbb{C}$) and $u,w \in V$. Suppose $T$ is a linear map from $V$ to $V$.
In a proof that book states
$$\begin{aligned}
\langle T u, w\rangle=& \frac{\langle T(u+w), u+w\rangle-\langle T(u-w), u-w\rangle}{4} \\
&+\frac{\langle T(u+i w), u+i w\rangle-\langle T(u-i w), u-i w\rangle}{4} i
\end{aligned}$$
How did he expand the inner product this way? He didn't show any steps and I'm having difficulty figuring it out on my own.
 A: This is one of those annoying results where verifying that it's true is a lot less effort than figuring out how anyone could have come up with it. Here is some context which may be helpful. This is a variant of the complex polarization identity. It's easier to first think about the real polarization identity, which goes
$$\langle x, y \rangle = \frac{\langle x + y, x + y \rangle - \langle x - y, x - y \rangle}{4} = \frac{\| x + y \|^2 - \| x - y \|^2}{4}$$
where $\langle -, - \rangle$ is a real inner product on a real inner product space. The significance of this identity is that it tells you that a real inner product is determined by the norm it induces. Geometrically you can think of it as following from two applications of the law of cosines, once to the triangle with vertices $0, x, y$ (so side lengths $\| x \|, \| y \|, \| x - y \|$) and once to the triangle with vertices $0, x, -y$ (so side lengths $\|x \|, \| y \|, \| x + y \|$). Algebraically, once you have the idea that you want to express inner products in terms of lengths, it's not hard to notice that $\| x \pm y \|^2 = \| x \|^2 \pm 2 \langle x, y \rangle + \| y \|^2$ and see that subtracting isolates the inner product.
(In fact algebraically the following more general statement is true: $B(x, y) = \frac{B(x + y, x + y) - B(x - y, x - y)}{4}$ for any symmetric bilinear form $B$. In other words we don't need positive-definiteness.)
The complex polarization identity is a more complicated version of this. Again we want to show that a complex inner product is determined by the norm it induces. And again we might have the idea to look at $\| x \pm y \|^2$. But this time expanding it out gives
$$\| x \pm y \|^2 = \| x \|^2 \pm \langle x, y \rangle \pm \langle y, x \rangle + \| y \|^2 = \| x \|^2 \pm 2 \text{Re}(\langle x, y \rangle) + \| y \|^2$$
because $\langle x, y \rangle = \overline{ \langle y, x \rangle }$, so the RHS of the real polarization identity only produces the real part of the inner product. To get the complex part we also look at $x \pm iy$, which gives
$$ \| x \pm iy \|^2 = \| x \|^2 \pm 2 \text{Re}(\langle x, iy \rangle) + \| y \|^2 = \| x \|^2 \mp 2 \text{Im}(\langle x, y \rangle) + \| y \|^2.$$
So now it's just a matter of putting the real and imaginary parts together to get the whole thing, which gives the complex polarization identity
$$\langle x, y \rangle = \frac{ \| x + y \|^2 - \| x - y \|^2}{4} - i \frac{ \| x + iy \|^2 - \| x - iy \|^2}{4}.$$
(Here we use the convention that the inner product is linear in the second argument. It looks like Axler is using the opposite convention which changes the sign on the imaginary part.)
Axler's identity is a further variant on the complex polarization identity where he considers the bilinear form $B(u, v) = \langle T(u), v \rangle$, which is no longer symmetric or even conjugate-symmetric. The game from here is checking what happens to the above calculations when you repeat them for $B$; the basic calculation we need is that
$$B(u + tv, u + tv) = B(u, u) + t B(u, v) + \overline{t} B(v, u) + |t|^2 B(v, v)$$
which we apply to $t = \pm 1, \pm i$ as before and then see what cancels.
A: For $0\le n\le 3$,$$\begin{align}\langle T(u+i^nw),\,u+i^nw\rangle&=\langle Tu+i^nTw,\,u+i^nw\rangle\\&=\langle Tu,\,u\rangle+\langle Tw,\,w\rangle+i^{\pm n}\langle Tw,\,u\rangle+i^{\mp n}\langle Tu,\,w\rangle,\end{align}$$where $\pm$ is a matter of convention, being $+$ if the inner product is linear in its first argument (as mathematicians usually prefer, including in the given problem statement) or $-$ if linear in the second (as physicists often prefer, especially in quantum mechanics). So$$i^{\pm n}\langle T(u+i^nw),\,u+i^nw\rangle=\langle Tu,\,w\rangle+i^{\pm n}(\langle Tu,\,u\rangle+\langle Tw,\,w\rangle)+(-1)^n\langle Tw,\,u\rangle.$$Summing over $n$ gives $4\langle Tu,\,w\rangle$.
A: For each $a \in \{\pm 1,\pm i\}$ let $I_a := \langle T(u+aw),u+aw \rangle$. Then note that
\begin{align}
I_a &= \langle Tu+aTw,u+aw \rangle \quad \leftarrow {\small \textrm{because $T$ is linear}} \\
&= \langle Tu,u+aw \rangle + a \langle Tw,u+aw \rangle \quad \leftarrow {\small \textrm{because $\langle (\cdot), v \rangle$ is linear}} \\
&= \langle Tu,u \rangle + \langle Tu,aw \rangle + a(\langle Tw,u \rangle + \langle Tw,aw \rangle) \quad \leftarrow {\small \textrm{since $\langle v,(\cdot) \rangle$ is additive}} \\
&= \langle Tu,u \rangle + \overline{a} \langle Tu,w \rangle + a \langle Tw,u \rangle + a \overline{a} \langle Tw,w \rangle \quad \leftarrow {\small \textrm{using that $\langle v_1,cv_2 \rangle = \overline c \langle v_1,v_2 \rangle$}}
\end{align}
and now it is easy to see that
\begin{align}
I_a - I_{-a} &= \overline{a} \langle Tu,w \rangle + a\langle Tw,u \rangle - (-\overline{a} \langle Tu,w \rangle - a\langle Tw,u \rangle) \\
&= 2(\overline{a} \langle Tu,w \rangle + a \langle Tw,u \rangle).
\end{align}
So,
\begin{align} (I_1 - &I_{-1}) + (I_i - I_{-i})i \\
&= 2(\langle Tu,w \rangle + \langle Tw,u \rangle) + 2(-i \langle Tu,w \rangle + i \langle Tw,u \rangle)i \\ &= 4 \langle Tu,w \rangle.
\end{align}
