9. The red balls in the bag account for $\frac{7}{16}$ of the total number of balls in the bag; after adding 40 more red balls to the bag, the red balls account for $\frac{3}{4}$ of the total number of balls. How many balls are there in the bag in the end?
9. The red balls in the bag account for $\frac{7}{16}$ of the total number of balls in the bag; after adding 40 more red balls, the red balls account for $\frac{3}{4}$ of the total. How many balls are there in the bag in the end?
【Analysis】After adding 40 red balls, both the number of red balls and the total number of balls change, but the number of balls of other colors remains the same. Consider the number of other colored balls as the unit "1"; the red balls account for $\frac{7}{16}$ of the total, so the other colored balls account for $1-\frac{7}{16}=\frac{9}{16}$ of the total. Thus, the red balls account for $\frac{7}{16} \div \frac{9}{16}=\frac{7}{9}$ of the other colored balls. Similarly, the red balls later account for $\frac{3}{4} \div\left(1-\frac{3}{4}\right)=3$ times the number of other colored balls. Therefore, the 40 added red balls account for $\left(3-\frac{7}{9}\right)$ of the number of other colored balls. Using the concept of division of fractions, we can find the number of other colored balls, and then determine the total number of balls later.
【Solution】Solution: $\frac{7}{16} \div\left(1-\frac{7}{16}\right)$
$$
\begin{array}{l}
=\frac{7}{16} \div \frac{9}{16} \\
=\frac{7}{9} ; \\
\frac{3}{4} \div\left(1-\frac{3}{4}\right) \\
=\frac{3}{4} \div \frac{1}{4} \\
=3 \\
40 \div\left(3-\frac{7}{9}\right) \\
=40 \div \frac{20}{9} \\
18 \div\left(1-\frac{3}{4}\right) \\
=18 \div \frac{1}{4} \\
=72 \text { (balls) }
\end{array}
$$

Answer: There are 72 balls in the bag in the end.