(x - a)

and you need to get it under the square root sign. What is the right way to do it?

I came up with two methods, hopefully at least one of them is right. I want to find out which is right and to read more on the topic in order to understand WHY it is right.

First way:

\(\displaystyle

x - a = \sqrt{x^2 - a^2} = \sqrt{(x-a)(x+a)}

\)

Second way:

\(\displaystyle

x - a = \sqrt{(x-a)^2} = \sqrt{x^2 - 2xa + a^2}

\)

I can't find any videos on youtube or texts on the math sites, because I don't know which keywords to use in order to find it - any help would be appreciated.