Computational Analysis of a duality based approach for solving ordinary and partial differential equations