Cogito, ergo sum
The Latin cogito, ergo sum, usually translated into English as "I think, therefore I am", is the "first principle" of René Descartes's philosophy. He originally published it in French as je pense, donc je suis in his 1637 Discourse on the Method, so as to reach a wider audience than Latin would have allowed. It later appeared in Latin in his Principles of Philosophy, and a similar phrase also featured prominently in his Meditations on First Philosophy.  The dictum is also sometimes referred to as the cogito.  As Descartes explained in a margin note, "we cannot doubt of our existence while we doubt." In the posthumously published The Search for Truth by Natural Light, he expressed this insight as dubito, ergo sum, vel, quod idem est, cogito, ergo sum ("I doubt, therefore I am — or what is the same — I think, therefore I am"). Antoine Léonard Thomas, in a 1765 essay in honor of Descartes presented it as dubito, ergo cogito, ergo sum ("I doubt, therefore I think, therefore I am").Descartes's statement became a fundamental element of Western philosophy, as it purported to provide a certain foundation for knowledge in the face of radical doubt. While other knowledge could be a figment of imagination, deception, or mistake, Descartes asserted that the very act of doubting one's own existence served—at minimum—as proof of the reality of one's own mind; there must be a thinking entity—in this case the self—for there to be a thought.
One critique of the dictum, first suggested by Pierre Gassendi, is that it presupposes that there is an "I" which must be doing the thinking. According to this line of criticism, the most that Descartes was entitled to say was that "thinking is occurring", not that "I am thinking".

In Descartes's writings
Descartes first wrote the phrase in French in his 1637 Discourse on the Method. He referred to it in Latin without explicitly stating the familiar form of the phrase in his 1641 Meditations on First Philosophy. The earliest written record of the phrase in Latin is in his 1644 Principles of Philosophy, where, in a margin note (see below), he provides a clear explanation of his intent: "[W]e cannot doubt of our existence while we doubt". Fuller forms of the phrase are attributable to other authors.

Discourse on the Method
The phrase first appeared (in French) in Descartes's 1637 Discourse on the Method in the first paragraph of its fourth part:

Meditations on First Philosophy
In 1641, Descartes published (in Latin) Meditations on first philosophy in which he referred to the proposition, though not explicitly as "cogito, ergo sum" in Meditation II:

Principles of Philosophy
In 1644, Descartes published (in Latin) his Principles of Philosophy where the phrase "ego cogito, ergo sum" appears in Part 1, article 7:

Descartes's margin note for the above paragraph is:

The Search for Truth by Natural Light
Descartes, in a lesser-known posthumously published work dated as written ca. 1647 and titled La Recherche de la Vérité par La Lumiere Naturale (The Search for Truth by Natural Light), provides his only known phrasing of the cogito as cogito, ergo sum and admits that his insight is also expressible as dubito, ergo sum:

Other forms
The proposition is sometimes given as dubito, ergo cogito, ergo sum. This form was penned by the French literary critic, Antoine Léonard Thomas, in an award-winning 1765 essay in praise of Descartes, where it appeared as "Puisque je doute, je pense; puisque je pense, j'existe" ('Since I doubt, I think; since I think, I exist'). With rearrangement and compaction, the passage translates to "I doubt, therefore I think, therefore I am," or in Latin, "dubito, ergo cogito, ergo sum." This aptly captures Descartes's intent as expressed in his posthumously published La Recherche de la Vérité par La Lumiere Naturale as noted above: I doubt, therefore I am — or what is the same — I think, therefore I am.
A further expansion, dubito, ergo cogito, ergo sum—res cogitans ("…—a thinking thing") extends the cogito with Descartes's statement in the subsequent Meditation, "Ego sum res cogitans, id est dubitans, affirmans, negans, pauca intelligens, multa ignorans, volens, nolens, imaginans etiam et sentiens…" ("I am a thinking [conscious] thing, that is, a being who doubts, affirms, denies, knows a few objects, and is ignorant of many,-- who loves, hates, wills, refuses, who imagines likewise, and perceives"). This has been referred to as "the expanded cogito."

Translation
"I am thinking" vs. "I think"
While the Latin translation cōgitō may be translated rather easily as "I think/ponder/visualize", je pense does not indicate whether the verb form corresponds to the English simple present or progressive aspect. Technically speaking, the French lemma pense by itself is actually the result of numerous different conjugations of the verb penser (to think) – it could mean "I think... (something)"/"He thinks... (something)", "I think."/"He thinks.", or even "You (must) think... (something).", thereby necessitating the use of the wider context, or a pronoun, to understand the meaning. In the case of je pense, a pronoun is already included, je or "I", but this still leaves the question of whether "I think..." or "I think." is intended. Therefore, translation needs a larger context to determine aspect.Following John Lyons (1982), Vladimir Žegarac notes, "The temptation to use the simple present is said to arise from the lack of progressive forms in Latin and French, and from a misinterpretation of the meaning of cogito as habitual or generic" (cf. gnomic aspect). Also following Lyons, Ann Banfield writes, "In order for the statement on which Descartes's argument depends to represent certain knowledge,… its tense must be a true present—in English, a progressive,… not as 'I think' but as 'I am thinking, in conformity with the general translation of the Latin or French present tense in such nongeneric, nonstative contexts." Or in the words of Simon Blackburn, "Descartes's premise is not 'I think' in the sense of 'I ski', which can be true even if you are not at the moment skiing. It is supposed to be parallel to 'I am skiing'."The similar translation "I am thinking, therefore I exist" of Descartes's correspondence in French ("je pense, donc je suis") appears in The Philosophical Writings of Descartes by Cottingham et al. (1988).: 247 The earliest known translation as "I am thinking, therefore I am" is from 1872 by Charles Porterfield Krauth.Fumitaka Suzuki writes "Taking consideration of Cartesian theory of continuous creation, which theory was developed especially in the Meditations and in the Principles, we would assure that 'I am thinking, therefore I am/exist' is the most appropriate English translation of 'ego cogito, ergo sum'."

"I exist" vs. "I am"
Alexis Deodato S. Itao notes that cogito, ergo sum is "literally 'I think, therefore I am'." Others differ: 1) "[A] precise English translation will read as 'I am thinking, therefore I exist'.; and 2) "[S]ince Descartes ... emphasized that existence is such an important 'notion,' a better translation is 'I am thinking, therefore I exist.'"

Punctuation
Descartes wrote this phrase as such only once, in the posthumously published lesser-known work noted above, The Search for Truth by Natural Light. It appeared there mid-sentence, uncapitalized, and with a comma. (Commas were not used in Classical Latin but were a regular feature of scholastic Latin, the Latin Descartes "had learned in a Jesuit college at La Flèche.") Most modern reference works show it with a comma, but it is often presented without a comma in academic work and in popular usage. In Descartes's Principia Philosophiae, the proposition appears as ego cogito, ergo sum.

Interpretation
As put succinctly by Krauth (1872), "That cannot doubt which does not think, and that cannot think which does not exist. I doubt, I think, I exist."The phrase cogito, ergo sum is not used in Descartes's Meditations on First Philosophy but the term "the cogito" is used to refer to an argument from it.  In the Meditations, Descartes phrases the conclusion of the argument as "that the proposition, I am, I exist, is necessarily true whenever it is put forward by me or conceived in my mind" (Meditation II). George Henry Lewes says Descartes "has told us that [his objective] was to find a starting point from which to reason—to find an irreversible certainty. And where did he find this? In his own consciousness. Doubt as I may, I cannot doubt of my own existence, because my very doubts reveal to me a something which doubts. You may call this an assumption, if you will; I point out the fact as one above and beyond all logic; which logic can neither prove nor disprove; but which must always remain an irreversible certainty, and as such a fitting basis of philosophy."At the beginning of the second meditation, having reached what he considers to be the ultimate level of doubt—his argument from the existence of a deceiving god—Descartes examines his beliefs to see if any have survived the doubt. In his belief in his own existence, he finds that it is impossible to doubt that he exists.  Even if there were a deceiving god (or an evil demon), one's belief in their own existence would be secure, for there is no way one could be deceived unless one existed in order to be deceived.

But I have convinced myself that there is absolutely nothing in the world, no sky, no earth, no minds, no bodies.  Does it now follow that I, too, do not exist? No. If I convinced myself of something [or thought anything at all], then I certainly existed. But there is a deceiver of supreme power and cunning who deliberately and constantly deceives me.  In that case, I, too, undoubtedly exist, if he deceives me; and let him deceive me as much as he can, he will never bring it about that I am nothing, so long as I think that I am something.  So, after considering everything very thoroughly, I must finally conclude that the proposition, I am, I exist, is necessarily true whenever it is put forward by me or conceived in my mind. (AT VII 25; CSM II 16–17)
There are three important notes to keep in mind here. First, he claims only the certainty of his own existence from the first-person point of view — he has not proved the existence of other minds at this point. This is something that has to be thought through by each of us for ourselves, as we follow the course of the meditations. Second, he does not say that his existence is necessary; he says that if he thinks, then necessarily he exists (see the instantiation principle). Third, this proposition "I am, I exist" is held true not based on a deduction (as mentioned above) or on empirical induction but on the clarity and self-evidence of the proposition. Descartes does not use this first certainty, the cogito, as a foundation upon which to build further knowledge; rather, it is the firm ground upon which he can stand as he works to discover further truths.  As he puts it:

Archimedes used to demand just one firm and immovable point in order to shift the entire earth; so I too can hope for great things if I manage to find just one thing, however slight, that is certain and unshakable. (AT VII 24; CSM II 16)
According to many Descartes specialists, including Étienne Gilson, the goal of Descartes in establishing this first truth is to demonstrate the capacity of his criterion — the immediate clarity and distinctiveness of self-evident propositions — to establish true and justified propositions despite having adopted a method of generalized doubt. As a consequence of this demonstration, Descartes considers science and mathematics to be justified to the extent that their proposals are established on a similarly immediate clarity, distinctiveness, and self-evidence that presents itself to the mind. The originality of Descartes's thinking, therefore, is not so much in expressing the cogito—a feat accomplished by other predecessors, as we shall see—but on using the cogito as demonstrating the most fundamental epistemological principle, that science and mathematics are justified by relying on clarity, distinctiveness, and self-evidence.
Baruch Spinoza in "Principia philosophiae cartesianae" at its Prolegomenon identified "cogito ergo sum" the "ego sum cogitans" (I am a thinking being) as the thinking substance with his ontological interpretation.

Predecessors
Although the idea expressed in cogito, ergo sum is widely attributed to Descartes, he was not the first to mention it. Plato spoke about the "knowledge of knowledge" (Greek: νόησις νοήσεως, nóesis noéseos) and Aristotle explains the idea in full length:

But if life itself is good and pleasant…and if one who sees is conscious that he sees, one who hears that he hears, one who walks that he walks and similarly for all the other human activities there is a faculty that is conscious of their exercise, so that whenever we perceive, we are conscious that we perceive, and whenever we think, we are conscious that we think, and to be conscious that we are perceiving or thinking is to be conscious that we exist... (Nicomachean Ethics, 1170a 25 ff.)

The Cartesian statement was interpreted to be an Aristotelian syllogism where the premise that all thinkers are also beings is not made explicit.In the late sixth or early fifth century BC, Parmenides is quoted as saying "For to be aware and to be are the same". (Fragment B3)
In the early fifth century AD, Augustine of Hippo in De Civitate Dei (book XI, 26) affirmed his certain knowledge of his own existence, and added: "So far as these truths are concerned, I do not at all fear the arguments of the Academics when they say, What if you are mistaken? For if I am mistaken, I exist." This formulation (si fallor, sum) is sometimes called the Augustinian cogito. In 1640, Descartes wrote to thank Andreas Colvius (a friend of Descartes's mentor, Isaac Beeckman) for drawing his attention to Augustine:

I am obliged to you for drawing my attention to the passage of St Augustine relevant to my I am thinking, therefore I exist. I went today to the library of this town to read it, and I do indeed find that he does use it to prove the certainty of our existence. He goes on to show that there is a certain likeness of the Trinity in us, in that we exist, we know that we exist, and we love the existence and the knowledge we have. I, on the other hand, use the argument to show that this I which is thinking is an immaterial substance with no bodily element. These are two very different things. In itself it is such a simple and natural thing to infer that one exists from the fact that one is doubting that it could have occurred to any writer. But I am very glad to find myself in agreement with St Augustine, if only to hush the little minds who have tried to find fault with the principle.: 159 
Another predecessor was Avicenna's "Floating Man" thought experiment on human self-awareness and self-consciousness.The 8th century Hindu philosopher Adi Shankara wrote, in a similar fashion, that no one thinks 'I am not', arguing that one's existence cannot be doubted, as there must be someone there to doubt. The central idea of cogito, ergo sum is also the topic of Mandukya Upanishad.
Spanish philosopher Gómez Pereira in his 1554 work De Inmortalitate Animae, wrote "nosco me aliquid noscere, & quidquid noscit, est, ergo ego sum" ('I know that I know something, anyone who knows is, therefore I am').

Critique
Use of "I"
In Descartes, The Project of Pure Enquiry, Bernard Williams provides a history and full evaluation of this issue. The first to raise the "I" problem was Pierre Gassendi, who in his Disquisitio Metaphysica, as noted by Saul Fisher "points out that recognition that one has a set of thoughts does not imply that one is a particular thinker or another. …[T]he only claim that is indubitable here is the agent-independent claim that there is cognitive activity present."The objection, as presented by Georg Lichtenberg, is that rather than supposing an entity that is thinking, Descartes should have said: "thinking is occurring." That is, whatever the force of the cogito, Descartes draws too much from it; the existence of a thinking thing, the reference of the "I," is more than the cogito can justify. Friedrich Nietzsche criticized the phrase in that it presupposes that there is an "I", that there is such an activity as "thinking", and that "I" know what "thinking" is. He suggested a more appropriate phrase would be "it thinks" wherein the "it" could be an impersonal subject as in the sentence "It is raining."

Kierkegaard
The Danish philosopher Søren Kierkegaard calls the phrase a tautology in his Concluding Unscientific Postscript.: 38–42  He argues that the cogito already presupposes the existence of "I", and therefore concluding with existence is logically trivial. Kierkegaard's argument can be made clearer if one extracts the premise "I think" into the premises "'x' thinks" and "I am that 'x'", where "x" is used as a placeholder in order to disambiguate the "I" from the thinking thing.Here, the cogito has already assumed the "I"'s existence as that which thinks. For Kierkegaard, Descartes is merely "developing the content of a concept", namely that the "I", which already exists, thinks.: 40  As Kierkegaard argues, the proper logical flow of argument is that existence is already assumed or presupposed in order for thinking to occur, not that existence is concluded from that thinking.

Williams
Bernard Williams claims that what we are dealing with when we talk of thought, or when we say "I am thinking," is something conceivable from a third-person perspective—namely objective "thought-events" in the former case, and an objective thinker in the latter. He argues, first, that it is impossible to make sense of "there is thinking" without relativizing it to something. However, this something cannot be Cartesian egos, because it is impossible to differentiate objectively between things just on the basis of the pure content of consciousness. The obvious problem is that, through introspection, or our experience of consciousness, we have no way of moving to conclude the existence of any third-personal fact, to conceive of which would require something above and beyond just the purely subjective contents of the mind.

Heidegger
As a critic of Cartesian subjectivity, Heidegger sought to ground human subjectivity in death as that certainty which individualizes and authenticates our being. As he wrote in 1925 in History of the Concept of Time:This certainty, that "I myself am in that I will die," is the basic certainty of Dasein itself. It is a genuine statement of Dasein, while cogito sum is only the semblance of such a statement. If such pointed formulations mean anything at all, then the appropriate statement pertaining to Dasein in its being would have to be sum moribundus [I am in dying], moribundus not as someone gravely ill or wounded, but insofar as I am, I am moribundus. The MORIBUNDUS first gives the SUM its sense.

John Macmurray
The Scottish philosopher John Macmurray rejects the cogito outright in order to place action at the center of a philosophical system he entitles the Form of the Personal. "We must reject this, both as standpoint and as method. If this be philosophy, then philosophy is a bubble floating in an atmosphere of unreality." The reliance on thought creates an irreconcilable dualism between thought and action in which the unity of experience is lost, thus dissolving the integrity of our selves, and destroying any connection with reality. In order to formulate a more adequate cogito, Macmurray proposes the substitution of "I do" for "I think,"  ultimately leading to a belief in God as an agent to whom all persons stand in relation.

See also
Cartesian doubt
Floating man
Solipsism
Academic skepticism
Brain in a vat
I Am that I Am
Tat Tvam Asi, "You are that"
The Animal That Therefore I Am
Vertiginous question

Notes
References
Further reading
Abraham, W. E. 1974. "Disentangling the Cogito." Mind 83:329.
Baird, Forrest E., and Walter Kaufmann. 2008. From Plato to Derrida. Upper Saddle River, NJ: Pearson Prentice Hall. ISBN 978-0-13-158591-1.
Boufoy-Bastick, Z. 2005. "Introducing 'Applicable Knowledge' as a Challenge to the Attainment of Absolute Knowledge." Sophia Journal of Philosophy 8:39–52.
Christofidou, A. 2013. Self, Reason, and Freedom: A New Light on Descartes' Metaphysics. Routledge.
Hatfield, G. 2003. Routledge Philosophy Guidebook to Descartes and the Meditations. Routledge. ISBN 0-415-11192-7.
Kierkegaard, Søren. [1844] 1985. Philosophical Fragments. Princeton. ISBN 978-0-691-02036-5.
— [1846] 1985. Concluding Unscientific Postscript. Princeton. ISBN 978-0-691-02081-5.

External links
Zalta, Edward N. (ed.). "Descartes's Epistemology". Stanford Encyclopedia of Philosophy.