Where is error in this solution to $ \sqrt{x} + \sqrt{-x} = 2 $? Given the equation:
$$ \sqrt{x} + \sqrt{-x} = 2 $$
The solutions are $x = \pm 2i$. This can be seen via Wolfram Alpha
$$
\left( \sqrt{x} + \sqrt{-x} \right)^2 = 2^2
$$
$$
\sqrt{x}^2 + 2\sqrt{x}\sqrt{-x} + \sqrt{-x}^2 = 4
$$
$$
x + 2\sqrt{x}\sqrt{-x} - x = 4
$$
$$
\sqrt{-x^2} = 2
$$
$$
-x^2 = 4
$$
$$
x = \pm 2i
$$
However, my approach to the problem only found the positive value to this equation.
$$ \sqrt{x} + \sqrt{-x} = 2 $$
$$ \sqrt{x} + i\sqrt{x} = 2 $$
$$ (1+i) \sqrt{x} = 2 $$
$$ (1-i)(1+i) \sqrt{x} = 2(1-i) $$
$$ 2 \sqrt{x} = 2 (1-i) $$
$$ x = (1-i)^2 $$
$$ x = 1^2 - 2i + (-i)^2 = -2i $$
Where did I make a mistake here that resulted in me only getting one of the two solutions to this equation?
 A: I will use $z$ instead of $x$, and assume that $z \in \mathbb C$.  I will also use $z^{1/2}$ instead of $\sqrt{x}$ to denote the square root.  Then your equation becomes $$f(z) = z^{1/2} + (-z)^{1/2} - 2 = 0, \tag{1}$$ and we observe that for any $z \in \mathbb C$, $$f(-z) = (-z)^{1/2} + (-(-z))^{1/2} = (-z)^{1/2} + z^{1/2} = f(z). \tag{2}$$  Therefore, if $r$ is a root of $f$, then $-r$ is a root of $f$.
Certain rules about how to manipulate functions of square roots are inherited from assumptions about the domain of such functions; e.g., $$\sqrt{ab} = \sqrt{a} \sqrt{b}$$ is true if $a, b$ are nonnegative real numbers.  Otherwise, we encounter inconsistencies, such as the well-known $$1 = \sqrt{1} = \sqrt{(-1)(-1)} \overset{?}{=} \sqrt{-1} \sqrt{-1} = i^2 = -1. \tag{3}$$  The equality with the $?$ symbol above it is where the error occurs.
When we talk about square roots of complex numbers, we are really talking about a one-to-two multivalued mapping; e.g., $$(-2i)^{1/2} = \{1-i, -1+i\}.$$  This is because $(1-i)^2 = -2i$ and $(-1+i)^2 = -2i$, and because $\mathbb C$ is not an ordered field, unlike $\mathbb R$, it is not a simple matter to decide which of these roots is "canonical" in the way that we decide to use $\sqrt{x}$ to denote the nonnegative square root of $x$ when $x$ is a nonnegative real.  Moreover, when considering cube roots, now one has in general three complex-valued solutions, all equally valid.  A major fundamental aspect of complex analysis concerns itself with the choice of a single value when a mapping is multivalued.
That said, it is clear that your first step is problematic:
$$\sqrt{-x} = \sqrt{-1}\sqrt{x} = i \sqrt{x}$$ does not always hold for the same reason why the aforementioned "paradox" $(3)$ is invalid.
In order to proceed along the same lines of your reasoning, you must be more careful:
$$z^{1/2} + (-z)^{1/2} = z^{1/2} + (-1)^{1/2} z^{1/2} = z^{1/2} (1 + (-1)^{1/2})$$ is allowed.  But here, the value of $(-1)^{1/2}$ must be ascertained.  It is not simply $i$, because there are two solutions to the equation $$z^2 = -1,$$ namely $$z = \{i, -i\}.$$  Therefore, the following step is applied:
$$z^{1/2} (1 + (-1)^{1/2}) = z^{1/2} (1 \pm i). \tag{4}$$  This preserves the multivalued character of the original expression, from which we proceed as follows:
$$z^{1/2} = \frac{2}{1 \pm i},$$
hence
$$z = \left(\frac{2}{1 \pm i}\right)^2 = \{-2i, 2i\} = \pm 2i.$$
A: Squaring twice,
$$ x +(-x) + 2 \sqrt{x}\sqrt{-x} =4 \to -x^2=4$$
and solutions of quadratic equation
$$ x^2+4 = 0$$
should be two in number
$$ x= \pm \sqrt {2} i~. $$
A: For the function $ \ f(x) \ = \ \sqrt{x} + \sqrt{-x} \ \ , \ $ if we are restricted to $ \ x \ \in \ \mathbb{R} \ \ , \ $ the first term is only defined for $ \ x \ \ge \ 0 \ \ $ and the second term, for $ \ x \ \le \ 0 \ \ , \ $ so the domain for $ \ f(x) \ $ is just the intersection of these intervals, $ \ x \ = \ 0 \ \ , \ $ and its only permissible value is $ \ f(0) \ = \ 0 \ \ . \ $  Consequently, to solve $ \ f(x) \ = \ r \ \ , \ $ with $ \ \ r \ $ being a non-zero real number, we are "forced onto the Argand plane" and must search for complex-valued roots of the equation.
We take a prospective root of the equation to be $ \ z \ = \ \rho·(\cos \theta \ + \ i·\sin \theta) \ = \ \rho·e^{ \ i \ · \ \theta} \ \ , \  \rho \ $ being a positive real number (the modulus of $ \ z \ ) \ \ . $  As heropup points out, the equation $ \ z^{1/2} \ + \ (-z)^{1/2} \ = \ r \ \   $  has a symmetry in that if $ \ z \ $ is a root, $ \ (-z) \ $ is also. As complex numbers have two square-roots, we have
$$ z^{1/2} \ \ =  \ \ \pm\sqrt{\rho} \ · \ [ \ \cos (  \theta  /  2  ) \ + \ i·\sin (\theta / 2) \ ] \ \ . $$
The root $ \ (-z) \ $ lies in exactly the opposite direction from the origin that $ \ z \ $ does, so we have
$$ -z \ \ = \ \ \rho·[ \ \cos (\pi \ + \ \theta) \ + \ i·\sin (\pi \ + \ \theta) \ ] $$
$$ \Rightarrow \ \  (-z)^{1/2} \ \ =  \ \ \pm\sqrt{\rho} \ · \ [ \ \cos (\pi / 2 \ + \ \theta  /  2 ) \ + \ i·\sin (\pi / 2 \ + \ \theta  /  2 ) \ ] \ \ , $$
which tells us that the square-roots of $ \ (-z) \ $ lie at equal distances from the origin and in directions perpendicular to the square-roots of $ \ z \ \ . \ $
Thus we have, $ \ z^{1/2} \ + \ (-z)^{1/2} $
$$ =  \ \ \pm \sqrt{\rho} \ · \ [ \ \cos (  \theta  /  2  ) \ + \ i·\sin (\theta / 2) \ ] \ + \ \pm\sqrt{\rho} \ · \ [ \ \cos (\pi / 2 \ + \ \theta  /  2 ) \ + \ i·\sin (\pi / 2 \ + \ \theta  /  2 ) \ ]  $$
$$ = \ \  \pm \sqrt{\rho} \ · \ [ \ \{ \ \cos (  \theta  /  2  ) + \cos (\pi / 2 \ + \ \theta  /  2 ) \ \} \ + \ i·\{ \ \sin (  \theta  /  2  ) + \sin (\pi / 2 \ + \ \theta  /  2 ) \ \} \ ]  $$
$$ = \ \ \pm \sqrt{\rho} \ · \ [ \ 2· \cos \left(  \frac{\pi / 2 \ + \ \theta}{2}  \right) · \cos (-\pi / 4  ) \  \ + \ i·  2· \sin \left(  \frac{\pi / 2 \ + \ \theta}{2}  \right) · \cos (-\pi / 4  )   \ ] $$
$$  = \ \ \pm \sqrt{\rho} · \sqrt2 \ · \ [ \   \cos  (  \pi / 4 \ + \ \theta / 2 )  \ + \ i·   \sin  (  \pi / 4 \ + \ \theta / 2 )   \ ]  $$
or
$$ \pm \sqrt{\rho} \ · \ [ \ \cos (  \theta  /  2  ) \ + \ i·\sin (\theta / 2) \ ] \ + \ \mp\sqrt{\rho} \ · \ [ \ \cos (\pi / 2 \ + \ \theta  /  2 ) \ + \ i·\sin (\pi / 2 \ + \ \theta  /  2 ) \ ]  $$
$$ = \ \  \pm \sqrt{\rho} \ · \ [ \ \{ \ \cos (  \theta  /  2  ) - \cos (\pi / 2 \ + \ \theta  /  2 ) \ \} \ + \ i·\{ \ \sin (  \theta  /  2  ) - \sin (\pi / 2 \ + \ \theta  /  2 ) \ \} \ ]  $$
$$ = \ \ \pm \sqrt{\rho} \ · \ [ \ -2· \sin \left(  \frac{\pi / 2 \ + \ \theta}{2}  \right) · \sin (-\pi / 4  ) \  \ + \ i·  2· \cos \left(  \frac{\pi / 2 \ + \ \theta}{2}  \right) · \sin (-\pi / 4  )   \ ] \ \ = \ \ 0 $$
$$  = \ \ \pm \sqrt{\rho} · \sqrt2 \ · \ [ \   \sin  (  \pi / 4 \ + \ \theta / 2 )  \ - \ i·   \cos  (  \pi / 4 \ + \ \theta / 2 )   \ ]  $$
applying here the sum-to-product  identities.
We find four possible implied sums of the square-roots.  When we apply our resulting expressions to $ \ z^{1/2} \ + \ (-z)^{1/2} \ = \ r \ \ , \  $ we find for $ \   r + i·0 \ > \ 0 \ \ , \ $
$$ \pm \sqrt{2·\rho} \ \ = \ \ r \ \ \Rightarrow \ \ \rho \ \ = \ \ \frac{r^2}{2} \ \   , $$
$$  \cos  (  \pi / 4 \ + \ \theta / 2 ) \ \ = \ \ 1 \ \ \ , \ \ \  \sin(  \pi / 4 \ + \ \theta / 2 ) \ \ = \ \ 0 $$
$$ \Rightarrow \ \ \frac{\theta}{2} \ + \ \frac{\pi}{4} \ \ = \ \ 0 \ + \ 2k \pi \ \ \Rightarrow \ \ \frac{\theta}{2}  \ \ = \ \ \frac{(8k -  1)· \pi  }{4} \ \ \Rightarrow \ \  \theta   \ \ = \ \ -\frac{ \pi}{2} \ + \ 4k \pi \ \ , $$
and for $ \   r + i·0 \ < \ 0 \ \ , \ $
$$  \cos  (  \pi / 4 \ + \ \theta / 2 ) \ \ = \ \ -1 \ \ \ , \ \ \  \sin(  \pi / 4 \ + \ \theta / 2 ) \ \ = \ \ 0 $$
$$ \Rightarrow \ \ \frac{\theta}{2} \ + \ \frac{\pi}{4} \ \ = \ \ \pi \ + \ 2k \pi \ \ \Rightarrow \ \ \frac{\theta}{2}  \ \ = \ \ \frac{(8k +  3)· \pi  }{4} \ \ \Rightarrow \ \  \theta   \ \ = \ \ \frac{3 \pi}{2} \ + \ 4k \pi \ \ . $$
When $ \ r \ $ is real then, the set of roots numbers just two, $ \ z \ = \ -\frac{r^2}{2}·i \ \ $ and, due to the symmetry of $ \ f(x) \ \ , \ (-z) \ = \ +\frac{r^2}{2}·i \ \ . $  For the specific equation of this problem, the roots are $ \ \pm \ \frac{2^2}{2}·i \ = \ \pm \ 2i \ \ . \ $
If we write the square-roots of $ \ z \ $ as $ \ u_{\pm} \ $ and those of $ \ (-z) \ $ as $ \ v_{\pm} \ \ , \ $ the graph below shows that positive and negative values of $ \ r \ $ are obtained by choosing different sums of square-roots.

