Solution:
Given that y varies directly as x, this implies that
[tex]y\propto x[/tex]Introducing a constant of variation K, we have
[tex]y=Kx\text{ --- equation 1}[/tex][tex]when\text{ x=7, y=21}[/tex]Thus, by substituting these values into equation 1, we have
[tex]\begin{gathered} 21=3K \\ divide\text{ both sides by the coefficient of K, which is 3} \\ \frac{21}{3}=\frac{3K}{3} \\ \Rightarrow K=3 \end{gathered}[/tex]The constant of variation is
[tex]3[/tex]By substituting the value of K into equation 1,
we have the equation of the direct variation to be
[tex]y=3x[/tex]