If y varies directly with x then
![\begin{gathered} y=kx \\ \text{ Where k is a constant of a variation} \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/m707x0s089qb0ksk2gmbb3r7nwrc7r7zka.png)
First, we need to find the constant of a variation k, for this, we use the given values of x and y:
![\begin{gathered} y=kx \\ 12=k\cdot15 \\ \text{ Divide by 15 from both sides of the equation} \\ (12)/(15)=(k\cdot15)/(15) \\ (12)/(15)=k \\ \text{ Simplifying} \\ (3\cdot4)/(3\cdot5)=k \\ (4)/(5)=k \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/lboyeslukmozej0iyhafgibgdc5et7ausr.png)
Then since we already have the value of k we can find the value x when y = 21:
![\begin{gathered} y=kx \\ 21=(4)/(5)x \\ \text{ Multiply by 5 from both sides of the equation} \\ 5\cdot21=5\cdot(4)/(5)x \\ 105=4x \\ \text{ Divide by 4 from both sides of the equation} \\ (105)/(4)=(4x)/(4) \\ (105)/(4)=x \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/j0iu7w2fbpaezh1tr2dgmocnjsomnyoc6t.png)
Therefore, if y = 12 when x = 15, then
![x=(105)/(4)](https://img.qammunity.org/2023/formulas/mathematics/college/kbzv34a0icuibb4w4skznu9a4tjwrqeiaj.png)
when y = 21.