If y varies directly with x, this means that each time x increases one unit, y gets modified k times:
You can symbolize this as
[tex]y=kx[/tex]When y=20, x=4, with this you can determine the value of k as:
[tex]\begin{gathered} 20=4k \\ k=\frac{20}{4} \\ k=5 \end{gathered}[/tex]k=5 means that every time x increases one unit, y will increase 5 units.
[tex]y=5x[/tex]Now you can calculate the value of y for x=2 as
[tex]\begin{gathered} y=5\cdot2 \\ y=10 \end{gathered}[/tex]When x=2, y=10