Q.y=2x

sir this question answer 2x log 2

According to your suggested answer, I think your function was

y = 2^x

then taking the ln of both sides:
lny = ln(2^x) = x ln2
now differentiate,
y' / y = ln2
y' = y(ln 2) = ln2 (2^x)

you cannot use log2 , it must be ln2