To give the history of a physical principle is at the same time to make a logical analysis of it. The criticism of the intellectual processes that physics puts into play is related indissolubly to the exposition of the gradual evolution by which deduction perfects a theory and makes of it a more precise and better-ordered representation of laws revealed by observation.
Besides, the history of science alone can keep the physicist from the mad ambitions of dogmatism as well as the despair of Pyrrhonian skepticism.
This passage summarizes the three basic functions of teaching physics by teaching the history of physics.
(1) Analysis. The sort of history Duhem has in mind is a somewhat idealized one. When teaching physics according to the historical method, you are using history to get the point of the physics across, not doing history for history's sake. So it's OK to abstract a bit from anything that might interfere with or distract from understanding the physics. What you are looking for is the general interplay between theory and experiment that gives the theory its content.
(2) Moderation of Ambition. The history of science is a history of error: brilliant people using ingenious methods to come to wrong conclusions. By giving students of physics an idea of this history of dead-ends, confusions, hesitations, wrong assumptions, etc., you help to give them the sense that it's not enough to do the experiments and come up with the theories the way we usually imagine scientists do; you also must be self-critical and willing to be wrong many times before you get something workable -- and when you get something workable, you must be willing to recognize that it, too, could be superceded. Since Duhem is a positivist, he also thinks it helps to underscore the fact that physics represents provisionally rather than explains definitively; for instance, on this view, Newton's theory doesn't explain anything, but it represents a certain range of phenomena so astoundingly well that it can still be used after everyone has learned its flaws and limitations. And by learning physics historically, Duhem thinks you're more likely to recognize that newer theories will be fortunate if they do even half so well. When the physicist is tempted to put too much weight on his own pet theories, the history of physics can remind him that such dogmatism contributes nothing of value to physics. Against presumption, the history of physics teaches humility.
(3) Encouragement. But if the history of science is a history of error, it is also a history of progress, and the progress sometimes comes about through even serious errors. Each era in physics draws strength from the earlier eras and is pregnant with the eras to come. When you teach physics historically, you don't merely teach that physical theory is representation; you teach that it is a representation that approaches "natural classification and an increasingly clearer reflection of realities which experimental method cannot contemplate directly." When the physicist is tempted to despair of the possibility of progress, the history of physics can remind her that physics has come through worse with astounding feats of progress. Against despair, the history of physics teaches hope.
Such is Duhem's argument, anyway. It represents a sort of philosophy of science that I wish were more common, namely, the kind that thinks seriously and carefully about ways to improve scientific pedagogy.
All quotes are from Pierre Duhem, The Aim and Structure of Physical Theory. Philip Wiener, tr. Atheneum (New York: 1962) 269-270.