For Descartes, certainty in philosphy and in mathematics is gained through understanding. We may know that two apples and two apples makes four apples, but Descartes believes that matematics transcends the senses, contributing to an overall mathematical order to the universe that is independent of senses.
Senses were at the center of his Meditations on First Philosphy, a work in which Descartes explores the concepts of self, God and mind. He begins by shaking our belief in the sneses; if they are all an illusion created by a malicious deceiver, what can we trust? His answer is that we can doubt, and that the deceiver cannot cause us to doubt our own existence. Thus, the famous "cogito ergo sum" (I think therefore I am). However, the I is not a physical "i", is is an immaterial mind that is identified by "I".
Thus begins Cartesian Dualism, the theory that there are two fundamental types of entities : mind and matter. The physical bodies exists extended in space, with depth, width and breadth. However, minds are entirely immaterial and nonspatial; they are the "I" he refers to. Since the mind is the only entity that can think (rocks cannot), Descartes uses the cogito arguemnt to prove the existence of a mind.
Descartes was a "jack of all trades", making major contributions to the areas of anatomy, cognitive science, optics, mathematics and philosophy. Underlying his methodology is the belief that all science is based on mathematics. This is manifested in his unification of ancient geometry and his new alegbra based on the Cartesian coodinate system.