My question is very very basic but, for the life of me, I'm confused for whatever reason.
I know that if $x^2 = 5 $ then +$\sqrt{5}$ and $-\sqrt{5}$ are the solutions for $x$.
The reason, as I understand it, is that, in a function, $x$ can have two values while $y$ can only have one. And both values, when squared equal to $5$.
I also know that $\sqrt{4} = 2$ and $2$ only. The reason is we deal now with a square root function which only leads to positive values on the $y$ axis, otherwise, it wouldn't be a function as $y$ would have two values as in $\sqrt{x} = +y$ and $-y$, which isn't possible.
Now what about this then?
$y= \sqrt{x^2}$ ?
If I consider, for the sake of the example, that $x^2 = 4$ then we've already said that $\sqrt{4}$ only equals $2$, not $-2$. So the answer should be $x$ only, not both $x$ and $-x$. This makes sense somehow otherwise I would get two values for $y$ which is forbidden when it comes to functions.
So this leans towards the fact that $y= \sqrt{x^2}$ is definitely equal to $x$.
But then I see this on a youtube course:
And this totally lost me, even though it's trivial.
I don't know why that second line is using the absolute value (probably to emphasize that it remains a positive $x$ which is consistent with what I concluded here above) but then the last line considers $-x$ as an eligible value this time and the part is beyond me. I know I'm overthinking it but I lost confidence with square roots right now. I need to get back to the basics.
Thanks for your patience and input.