A closed-form solution to estimate space-dependent parameters in heat and mass transport