Philosophy has nothing got to do with the latter two. Philosophy is the love for knowledge, and it refers to realization and rationalization the human existence.
Aristole made all of his students studied mathematics before philosophy because he said that math was the absolute truth and can not be changed. Ex. 2+2 will always equal 4 and never 5.