Theorem (Mackey's restriction formula)
Let $G$ be a group, $H,K\leq G$ be subgroups, and $V$ be a representation of $H$. Then $$ \begin{align*} \op{Res}^G_K \op{Ind}^G_H V = \bigoplus_{HwK \in H\backslash G/K} \op{Ind}^K_{K \cap w\inv Hw} \prescript{w\inv}{}{\op{Res}^H_{H \cap wKw\inv}} V. \end{align*} $$
Here $H\backslash G/K$ is the set of double cosets, and $\op{Res}$ and $\op{Ind}$ denote the restriction and induction of representations.
$\prescript{x}{}ρ$ denotes the twisted representation: if $ρ: S\to \GL(W)$, $S\leq T$ and $x\in T$, then $\prescript{x}{}ρ: xSx\inv \to \GL(W)$ is defined by $\prescript{x}{}ρ(y) = ρ(x\inv yx)$.
Together with Frobenius reciprocity, this implies $$ \begin{align*} \langle \op{Ind}^G_H V, \op{Ind}^G_H V\rangle ={}& \langle V, \op{Res}^G_H \op{Ind}^G_H V\rangle \\ ={}& \sum_{HwH\in H\backslash G/H} \langle V, \op{Ind}^H_{H \cap w\inv Hw} \prescript{w\inv}{}{\op{Res}^H_{H \cap wHw\inv}} V\rangle \\ ={}& \sum_{HwH\in H\backslash G/H} \langle \op{Res}^H_{H \cap w\inv H w} V, \prescript{w\inv}{}{\op{Res}^H_{H \cap w H w\inv}}V\rangle \\ ={}& \langle V, V\rangle + \sum_{\substack{HwH\in H\backslash G/H: \\w\not\in H}} \langle \op{Res}^H_{H \cap w\inv H w}, \prescript{w\inv}{}{\op{Res}^H_{H \cap wHw\inv} V}\rangle. \end{align*} $$