Given:
y varies directly as x.
When x=10, y=20.
Since y varies directly as x, the relation between x and y can be written as,
[tex]y=kx\text{ -----(1)}[/tex]Here, k is a constant.
Since y=20, when x=10, substitute x=10 and y =20 in the above equation to find the constant k.
[tex]\begin{gathered} 20=k\times10 \\ k=\frac{20}{10} \\ k=2 \end{gathered}[/tex]Therefore, the equation of variation can be written as,
[tex]\begin{gathered} y=kx \\ y=2x \end{gathered}[/tex]Therefore, the equation of variation in which y varies directly as x is y=2x.
Now to find the value of y when x =20, substitute x=20 and k=2 in equation (1).
[tex]\begin{gathered} y=2\times20 \\ y=40 \end{gathered}[/tex]Therefore, when x=20,the value of y is 40.