# How to deal with indefinite integral with $\pm$ sign? [closed]

In solving indefinite integral problems, we often encounter the following types of problems: The integrand of integral contains $$\pm$$ sign. How can I deal with this kind of sign and get the result consistent with the textbook?

Integrate[Sqrt[x^2 + a^2], x]
Integrate[Sqrt[x^2 - a^2], x]

• why is it important to have it the same as the textbook? why not integrate once with minus, and next with plus? You can put the results in a list at the end. btw, there is PlusMinus but I think it is only for display – Nasser Jun 30 at 9:46
• The use of $\pm$ is a short notation for two different integrals. Consider those two integrals separately as you wrote. – user64494 Jun 30 at 10:34
• You just have two separate integrals there. There's just a convenient relationship between the two that the textbook summarises using the $\pm$ symbol. – user112495 Jun 30 at 13:16
• I usually use an s (short for sign) to represent $\pm$, and in the result returned replace its squares by $1$. – Αλέξανδρος Ζεγγ Jun 30 at 13:35