[proofplan]
We use the $\mathfrak{sl}_2$-subalgebra associated to the root $\alpha$ and let it act on the direct sum of the root spaces occurring in the $\alpha$-string through $\beta$. The element $\alpha^\vee$ acts diagonally on these root spaces, with eigenvalues $\langle \beta,\alpha^\vee\rangle+2n$. Since this direct sum is invariant under the raising and lowering operators, $\alpha^\vee$ acts as a commutator on a finite-dimensional [vector space](/page/Vector%20Space), hence has trace zero. Computing the same trace from the root-space decomposition gives the desired identity.
[/proofplan]
[step:Build the finite-dimensional string module preserved by the $\alpha$-operators]
For each root $\gamma \in \Phi$, define the root space
\begin{align*}
\mathfrak g_\gamma := \{x \in \mathfrak g : [h,x] = \gamma(h)x \text{ for every } h \in \mathfrak h\}.
\end{align*}
Choose nonzero elements $e_\alpha \in \mathfrak g_\alpha$ and $f_\alpha \in \mathfrak g_{-\alpha}$ normalized so that
\begin{align*}
[e_\alpha,f_\alpha]=\alpha^\vee.
\end{align*}
Define the finite-dimensional complex vector space
\begin{align*}
M := \bigoplus_{n=-p}^{q} \mathfrak g_{\beta+n\alpha}.
\end{align*}
We claim that $M$ is preserved by the three endomorphisms
\begin{align*}
E:M &\to M, & E(x)&:=[e_\alpha,x],\\
F:M &\to M, & F(x)&:=[f_\alpha,x],\\
H:M &\to M, & H(x)&:=[\alpha^\vee,x].
\end{align*}
Indeed, for $x \in \mathfrak g_{\beta+n\alpha}$ and $h \in \mathfrak h$, the Jacobi identity gives
\begin{align*}
[h,[e_\alpha,x]]
&= [[h,e_\alpha],x]+[e_\alpha,[h,x]]\\
&= \alpha(h)[e_\alpha,x]+(\beta+n\alpha)(h)[e_\alpha,x]\\
&= (\beta+(n+1)\alpha)(h)[e_\alpha,x].
\end{align*}
Thus $[e_\alpha,x]$ lies in $\mathfrak g_{\beta+(n+1)\alpha}$ if $\beta+(n+1)\alpha \in \Phi$, and is $0$ otherwise. Since the string has no roots beyond $\beta+q\alpha$, this shows $E(M)\subset M$. The same calculation with $f_\alpha \in \mathfrak g_{-\alpha}$ gives $F(M)\subset M$. Finally, since $\alpha^\vee \in \mathfrak h$, each root space $\mathfrak g_{\beta+n\alpha}$ is preserved by $H$, so $H(M)\subset M$.
[guided]
The purpose of $M$ is to isolate exactly the root spaces lying on the line through $\beta$ in the $\alpha$-direction. We define
\begin{align*}
M := \bigoplus_{n=-p}^{q} \mathfrak g_{\beta+n\alpha},
\end{align*}
where
\begin{align*}
\mathfrak g_\gamma := \{x \in \mathfrak g : [h,x] = \gamma(h)x \text{ for every } h \in \mathfrak h\}
\end{align*}
is the root space of a root $\gamma \in \Phi$.
Choose nonzero root vectors $e_\alpha \in \mathfrak g_\alpha$ and $f_\alpha \in \mathfrak g_{-\alpha}$ normalized by
\begin{align*}
[e_\alpha,f_\alpha]=\alpha^\vee.
\end{align*}
We need to check that bracketing with these elements does not leave $M$. Let $x \in \mathfrak g_{\beta+n\alpha}$. For every $h \in \mathfrak h$, the Jacobi identity gives
\begin{align*}
[h,[e_\alpha,x]]
&= [[h,e_\alpha],x]+[e_\alpha,[h,x]]\\
&= \alpha(h)[e_\alpha,x]+(\beta+n\alpha)(h)[e_\alpha,x]\\
&= (\beta+(n+1)\alpha)(h)[e_\alpha,x].
\end{align*}
This means that $[e_\alpha,x]$ is either $0$ or a vector in the root space $\mathfrak g_{\beta+(n+1)\alpha}$. Since the displayed string contains all roots of the form $\beta+m\alpha$, there is no root past $\beta+q\alpha$, so the bracket is $0$ at the right endpoint and otherwise remains inside $M$.
The same argument with $f_\alpha \in \mathfrak g_{-\alpha}$ gives
\begin{align*}
[h,[f_\alpha,x]]
= (\beta+(n-1)\alpha)(h)[f_\alpha,x],
\end{align*}
so $[f_\alpha,x]$ lies in $\mathfrak g_{\beta+(n-1)\alpha}$ or is $0$. It is therefore also inside $M$. Finally, $\alpha^\vee \in \mathfrak h$, so by the definition of root spaces the map $x \mapsto [\alpha^\vee,x]$ preserves every summand of $M$. Thus $M$ is invariant under the three operators $E,F,H$.
[/guided]
[/step]
[step:Express the Cartan action as a commutator on the string module]
Because $M$ is invariant under $E$ and $F$, their commutator is an endomorphism of $M$. For $x \in M$,
\begin{align*}
(EF-FE)(x)
&= [e_\alpha,[f_\alpha,x]]-[f_\alpha,[e_\alpha,x]]\\
&= [[e_\alpha,f_\alpha],x]\\
&= [\alpha^\vee,x]\\
&= H(x),
\end{align*}
where the second equality is the Jacobi identity. Hence
\begin{align*}
H = EF-FE
\end{align*}
as endomorphisms of the finite-dimensional vector space $M$. Taking traces and using $\operatorname{tr}(AB)=\operatorname{tr}(BA)$ for endomorphisms of a finite-dimensional vector space, we obtain
\begin{align*}
\operatorname{tr}(H)
= \operatorname{tr}(EF)-\operatorname{tr}(FE)
= 0.
\end{align*}
[guided]
The reason for introducing the $\mathfrak{sl}_2$-operators is that the Cartan element $\alpha^\vee$ is their commutator. Since $E$ and $F$ are endomorphisms of $M$, the compositions $EF$ and $FE$ are also endomorphisms of $M$. For every $x \in M$, the Jacobi identity gives
\begin{align*}
[e_\alpha,[f_\alpha,x]]-[f_\alpha,[e_\alpha,x]]
= [[e_\alpha,f_\alpha],x].
\end{align*}
By our normalization $[e_\alpha,f_\alpha]=\alpha^\vee$, so
\begin{align*}
(EF-FE)(x) = [\alpha^\vee,x]=H(x).
\end{align*}
Thus
\begin{align*}
H=EF-FE.
\end{align*}
Now we use a linear-algebra fact: on a finite-dimensional vector space, the trace of a commutator is zero because $\operatorname{tr}(AB)=\operatorname{tr}(BA)$. Applying this to $E$ and $F$ gives
\begin{align*}
\operatorname{tr}(H)
= \operatorname{tr}(EF-FE)
= \operatorname{tr}(EF)-\operatorname{tr}(FE)
= 0.
\end{align*}
This is the key global constraint on the string: the sum of all $\alpha^\vee$-weights occurring in $M$ must vanish.
[/guided]
[/step]
[step:Compute the same trace from the root-space decomposition]
For each integer $n$ with $-p \le n \le q$, the operator $H$ acts on $\mathfrak g_{\beta+n\alpha}$ by the scalar
\begin{align*}
(\beta+n\alpha)(\alpha^\vee)
= \beta(\alpha^\vee)+n\alpha(\alpha^\vee)
= \langle \beta,\alpha^\vee\rangle+2n.
\end{align*}
Since $\mathfrak g$ is complex semisimple, each root space $\mathfrak g_{\beta+n\alpha}$ is one-dimensional. Therefore
\begin{align*}
\operatorname{tr}(H)
&= \sum_{n=-p}^{q}\left(\langle \beta,\alpha^\vee\rangle+2n\right)\\
&= (p+q+1)\langle \beta,\alpha^\vee\rangle
+2\sum_{n=-p}^{q} n.
\end{align*}
The finite arithmetic sum is
\begin{align*}
\sum_{n=-p}^{q} n
= -\sum_{m=1}^{p}m+\sum_{m=1}^{q}m
= -\frac{p(p+1)}{2}+\frac{q(q+1)}{2}.
\end{align*}
Hence
\begin{align*}
\operatorname{tr}(H)
&= (p+q+1)\langle \beta,\alpha^\vee\rangle
-p(p+1)+q(q+1)\\
&= (p+q+1)\langle \beta,\alpha^\vee\rangle
+(q-p)(p+q+1)\\
&= (p+q+1)\left(\langle \beta,\alpha^\vee\rangle+q-p\right).
\end{align*}
[guided]
We now compute $\operatorname{tr}(H)$ using the direct-sum decomposition of $M$. Fix an integer $n$ with $-p \le n \le q$. If $x \in \mathfrak g_{\beta+n\alpha}$, then the definition of the root space gives
\begin{align*}
H(x)
= [\alpha^\vee,x]
= (\beta+n\alpha)(\alpha^\vee)x.
\end{align*}
Since $\alpha(\alpha^\vee)=2$, this scalar is
\begin{align*}
(\beta+n\alpha)(\alpha^\vee)
= \beta(\alpha^\vee)+n\alpha(\alpha^\vee)
= \langle \beta,\alpha^\vee\rangle+2n.
\end{align*}
For a finite-dimensional complex semisimple Lie algebra, every root space is one-dimensional. Therefore each summand $\mathfrak g_{\beta+n\alpha}$ contributes exactly the scalar $\langle \beta,\alpha^\vee\rangle+2n$ to the trace. Summing over all roots in the string gives
\begin{align*}
\operatorname{tr}(H)
&= \sum_{n=-p}^{q}\left(\langle \beta,\alpha^\vee\rangle+2n\right)\\
&= (p+q+1)\langle \beta,\alpha^\vee\rangle
+2\sum_{n=-p}^{q} n.
\end{align*}
The remaining sum is an elementary arithmetic sum:
\begin{align*}
\sum_{n=-p}^{q} n
= -\sum_{m=1}^{p}m+\sum_{m=1}^{q}m
= -\frac{p(p+1)}{2}+\frac{q(q+1)}{2}.
\end{align*}
Substituting this into the trace formula gives
\begin{align*}
\operatorname{tr}(H)
&= (p+q+1)\langle \beta,\alpha^\vee\rangle
-p(p+1)+q(q+1)\\
&= (p+q+1)\langle \beta,\alpha^\vee\rangle
+(q-p)(p+q+1)\\
&= (p+q+1)\left(\langle \beta,\alpha^\vee\rangle+q-p\right).
\end{align*}
This is the same trace as before, now expressed entirely in terms of the two endpoints of the string.
[/guided]
[/step]
[step:Equate the two trace computations to obtain the string formula]
From the commutator computation,
\begin{align*}
\operatorname{tr}(H)=0.
\end{align*}
From the root-space computation,
\begin{align*}
\operatorname{tr}(H)
= (p+q+1)\left(\langle \beta,\alpha^\vee\rangle+q-p\right).
\end{align*}
Since $p,q \in \mathbb N \cup \{0\}$, we have $p+q+1>0$. Therefore
\begin{align*}
\langle \beta,\alpha^\vee\rangle+q-p=0,
\end{align*}
and hence
\begin{align*}
\langle \beta,\alpha^\vee\rangle=p-q.
\end{align*}
This is the desired root string identity.
[/step]