Example 17 Find the maximum value of the function $y=x-3+\sqrt{10-9 x^{2}}$.


Given $y=x-3+\sqrt{10-9 x^{2}}$ can be transformed into
$$
y=-3+\frac{1}{3} \cdot 3 x+\sqrt{10-9 x^{2}},
$$

let $f(x)=\frac{1}{3} \cdot 3 x+\sqrt{10-9 x^{2}}$,
and $(3 x)^{2}+\left(\sqrt{10-9 x^{2}}\right)^{2}=10$,
construct the vector $\vec{a}=\left(\frac{1}{3}, 1\right)$,
$\vec{b}=\left(3 x, \sqrt{10-9 x^{2}}\right)$, by the vector formula $\vec{a} \cdot \vec{b} \leqslant|\vec{a}| \cdot|\vec{b}|$ we get
$$
\begin{aligned}
f(x) & =\frac{1}{3} \cdot 3 x+\sqrt{10-9 x^{2}} \\
& \leqslant \sqrt{\left(\frac{1}{3}\right)^{2}+1^{2}} \cdot \sqrt{(3 x)^{2}+\left(\sqrt{10-9 x^{2}}\right)^{2}} \\
& =\frac{10}{3}
\end{aligned}
$$

Thus, $y \leqslant-3+\frac{10}{3}=\frac{1}{3}$, with equality holding if and only if $\frac{\sqrt{10-9 x^{2}}}{3}=3 x$, i.e., $x=\frac{1}{3}$, at which point $y_{\max }=\frac{1}{3}$.