There is circumstantial evidence of protohistoric knowledge of algebraic identities involving binary quadratic forms. The first problem concerning binary quadratic forms asks for the existence or construction of representations of integers by particular binary quadratic forms. The prime examples are the solution of Pell's equation and the representation of integers as sums of two squares. Pell's equation was already considered by the Indian mathematician Brahmagupta in the 7th century CE. Several centuries later, his ideas were extended to a complete solution of Pell's equation known as the chakravala method, attributed to either of the Indian mathematicians Jayadeva or Bhāskara II. The problem of representing integers by sums of two squares was considered in the 3rd century by Diophantus. In the 17th century, inspired while reading Diophantus's Arithmetica, Fermat made several observations about representations by specific quadratic forms including that which is now known as Fermat's theorem on sums of two squares. Euler provided the first proofs of Fermat's observations and added some new conjectures about representations by specific forms, without proof.