Initially, the term referred to any body of knowledge. In this sense, philosophy is closely related to religion, mathematics, natural science, education, and politics.
In section thirteen of his Lives and Opinions of the Eminent Philosophers, the oldest surviving history of philosophy (3rd century), Diogenes Laërtius presents a three-part division of ancient Greek philosophical inquiry:
Natural philosophy (i.e. physics, from Greek: ta physika, lit. ’things having to do with physis [nature]’) was the study of the constitution and processes of transformation in the physical world.
Moral philosophy (i.e. ethics, from êthika, ‘having to do with character, disposition, manners’) was the study of goodness, right and wrong, justice and virtue.
Metaphysical philosophy (i.e. logic, from logikós, ‘of or pertaining to reason or speech’) was the study of existence, causation, God, logic, forms, and other abstract objects. (meta ta physika, ‘after the Physics’)
In Against the Logicians the Pyrrhonist philosopher Sextus Empiricus detailed the variety of ways in which the ancient Greek philosophers had divided philosophy, noting that this three-part division was agreed to by Plato, Aristotle, Xenocrates, and the Stoics. The Academic Skeptic philosopher Cicero also followed this three-part division.
This division is not obsolete, but has changed: natural philosophy has split into the various natural sciences, especially physics, astronomy, chemistry, biology, and cosmology; moral philosophy has birthed the social sciences, while still including value theory (e.g. ethics, aesthetics, political philosophy, etc.); and metaphysical philosophy has given way to formal sciences such as logic, mathematics and philosophy of science, while still including epistemology, cosmology, etc. For example, Newton’s Mathematical Principles of Natural Philosophy (1687), since classified as a book of physics, uses the term natural philosophy as it was understood at the time, encompassing disciplines such as astronomy, medicine and physics that later became associated with the sciences.