Time and spatial concentration profile inside a membrane by means of a memory formalism