In this paper,we discuss the application of non-homogeneous differential equations by using the Duhamel principle.Based on the comparison method,we prove the relevant Duhamel principles and the solutions for ordinary differential equations and partial differential equations.The comparison of results can make students more impress by the method,and they can flexibly apply the method to solve other types of non-homogeneous differential equations.