Summary: Microgrids have lately proved to be the most efficient type of power system delivering uninterrupted power to a local area incurring negligible amount of transmission loss. Inclusion of the available renewable energy sources among the various distributed generation (DG) sources in a microgrid have decreased the emission of harmful toxic gases to a great extent. Dynamic economic dispatch indicates the economic dispatch of a microgrid allocating the timely optimal output of the distributed generation sources. However, the setup of a microgrid involves a huge amount of capital out of which installation cost, operation and maintenance cost, and depreciation cost instigated through the passing of time are a few. This paper uses three soft computing techniques viz. particle swarm optimization, differential evolution, and differential evolution with local global neighborhoods to perform a novel dynamic cost analysis of a microgrid and minimize its overall cost which includes fuel, emission, operation and maintenance cost, installation, and depreciation costs. Four different case studies are pulled off on a microgrid, and a comparative analysis is done to identify the best case. Numerical results and figures also point out the best optimization technique which was able to give the most efficient and minimal cost for the microgrid. [ABSTRACT FROM AUTHOR]