Example 26 Given $a_{i}, b_{i} \in \mathbf{R}(i=1,2, \cdots, n), \sum_{i=1}^{n} a_{i}^{2}=4, \sum_{i=1}^{n} b_{i}^{2}=9$, find the maximum value of $\sum_{i=1}^{n} a_{i} b_{i}$.
First, consider when $a_{1}^{2}+a_{2}^{2}=4, b_{1}^{2}+b_{2}^{2}=9$, how to find the maximum value of $a_{1} b_{1}+a_{2} b_{2}$.
Since $1=\left(\frac{a_{1}}{2}\right)^{2}+\left(\frac{a_{2}}{2}\right)^{2}, 1=\left(\frac{b_{1}}{3}\right)^{2}+\left(\frac{b_{2}}{3}\right)^{2}$, then $\left(\frac{a_{1}}{2}\right)^{2}+\left(\frac{b_{1}}{3}\right)^{2} \geqslant 2 \cdot \frac{a_{1} b_{1}}{2 \cdot 3}=\frac{a_{1} b_{1}}{3},\left(\frac{a_{2}}{2}\right)^{2}+\left(\frac{b_{2}}{3}\right)^{2} \geqslant 2 \cdot \frac{a_{2} b_{2}}{2 \cdot 3}=\frac{a_{2} b_{2}}{3}$, i.e., $2=\left(\frac{a_{1}}{2}\right)^{2}+\left(\frac{b_{1}}{3}\right)^{2}+\left(\frac{a_{2}}{2}\right)^{2}+\left(\frac{b_{2}}{3}\right)^{2} \geqslant \frac{a_{1} b_{1}+a_{2} b_{2}}{3}$, thus $a_{1} b_{1}+a_{2} b_{2} \leqslant 6$, where the equality holds if and only if $\frac{a_{1}}{b_{1}}=\frac{a_{2}}{b_{2}}=\frac{2}{3}$.
By analogy with the above method, the maximum value of $a_{1} b_{1}+a_{2} b_{2} \cdots+a_{n} b_{n}$ is 6.