Example 8 The profits from operating and selling two types of goods, A and B, are $p$ (ten thousand yuan) and $q$ (ten thousand yuan) respectively, and the relationship between sales profit and invested capital $x$ (ten thousand yuan) is given by the empirical formulas: $p=\frac{1}{5} x, q=\frac{3}{5} \sqrt{x}$. Given that 3 ten thousand yuan of capital is invested in operating the two types of goods, A and B, to maximize profit, how much capital should be invested in each type of good? What is the maximum profit that can be obtained?
(2002, Zhejiang Shaoxing Junior High School Mathematics Competition)
Explanation: Let the amount of money invested in product B be $x$ million yuan, then the amount of money invested in product A is $(3-x)$ million yuan. Let the total profit from products A and B be $y$, then
$$
\begin{array}{l}
y=\frac{1}{5}(3-x)+\frac{3}{5} \sqrt{x} \\
=-\frac{1}{5} x+\frac{3}{5} \sqrt{x}+\frac{3}{5}(0 \leqslant x \leqslant 3) .
\end{array}
$$

Obviously, $y$ is a quadratic function with $\sqrt{x}$ as the independent variable.
$\int$ Since the coefficient of the quadratic term is $-\frac{1}{5}<0$, then when $\sqrt{x}=$ $-\frac{\frac{3}{5}}{2 \times\left(-\frac{1}{5}\right)}=\frac{3}{2}$, i.e., $x=\frac{9}{4}, 3-x=\frac{3}{4}$, $y_{\text {max }}=\frac{21}{20}=1.05$ (million yuan).
Note: When solving this problem, pay attention to the practical significance of the range of values.