On the derivation of the differential equations arising in option pricing