# How come this curve changes if equation remains same?

I have a query below, and want to understand the reason of this in detail.

Here is the graph of $x^2+(y-\sqrt{x^2})^2=1$ drawn by Wolfram Alpha:

In this equation if you replace the term, $\sqrt{x^2}$ by $x$, which is a valid substitution, the graph seems to become an ellipse:

Shouldn't the curve remain same? What is the reason for this? Am I seriously missing some fundamental point here?

-
For $x<0$, $\sqrt{x^2}=-x$. – joriki Feb 15 '11 at 12:08
@joriki: How is that possible, i thought for x < 0, sqrt(x^2) is still x. Explanation please! thanks. – goldenmean Feb 15 '11 at 12:12
For each positive real number $y$, there are two numbers whose square is $y$, one positive and one negative. $\sqrt{y}$ is defined as the positive of those two numbers. The two numbers whose square is $x^2$ are $x$ and $-x$, so $\sqrt{x^2}$ is $x$ or $-x$, depending on which of those two is positive. If $x$ is negative, it is $-x$ that's positive, and thus $\sqrt{x^2}=-x$ for $x$ negative. – joriki Feb 15 '11 at 12:21
So, the correct substitution is $\left| x \right|$, which yields wolframalpha.com/input/?i=x^2%2B(y-abs(x))^2%3D1 :) – Andy Feb 15 '11 at 12:51
@joriki: You should post that as a real answer (so that the question can be marked as answered). – Hans Lundmark Feb 15 '11 at 12:54

For each positive real number $y$, there are two numbers whose square is $y$, one positive and one negative. $\sqrt{y}$ is defined as the positive of those two numbers. The two numbers whose square is $x^2$ are $x$ and $−x$, so $\sqrt{x^2}$ is $x$ or $−x$, depending on which of those two is positive. If $x$ is negative, it is $−x$ that's positive, and thus $\sqrt{x^2}=−x$ for $x$ negative.
... which is to say that $\sqrt{x^2}=|x|$ for $x\in\mathbb{R}$. – Isaac Feb 15 '11 at 14:04