TITLE: Factoring $a^2+b^2$?
QUESTION [5 upvotes]: I remember there was a way to factor $a^2+b^2$ into something along the lines of $(a+\sqrt{a}+b)(a-\sqrt{a}+b)$ . I tried every combination of pluses and minuses for this form, but I couldn't get back the original.

REPLY [11 votes]: We have
$$
a^2 + b^2 = a^2 + 2ab + b^2 - 2ab\\
= (a + b)^2 - 2ab\\
= \big((a + b) +\sqrt{2ab}\big)\big((a + b) - \sqrt{2ab}\big)
$$
This is a trick commonly attributed to Sophie Germain, if memory serves.