Getting rid of the square roots in the expression $\sqrt{a} + \sqrt{b} + \sqrt{c} = d$

I need to find an alternate form of $\sqrt{a} + \sqrt{b} + \sqrt{c} = d$ without square roots for a problem that I'm working on, but it's rather complicated to do. What we can do is

$\sqrt{a} + \sqrt{b} + \sqrt{c} = d \iff \sqrt{a} = d - \sqrt{b} - \sqrt{c} \iff a = (d - \sqrt{b} - \sqrt{c})^2$

and then calculate the right hand side, then iterate the process by putting a square root on one side, then proceed as above until all square roots are gone. However, this is a rather complicated process and I would like to do this with a computer but it exceeds WolframAlpha's server time. Can I get this done somewhere else? I would do this by hand myself but I will also need it for $\sqrt{a} + \sqrt{b} + \sqrt{c} + \sqrt{d} = e$ and perhaps even more complicated expressions, so if someone can show me an easy way to proceed with calculations - or point me to some computer program that can do this - I would appreciate it. Thanks in advance.

(note: not sure how to tag my question, feel free to change the tag if you can find something more appropriate).

Note: edited as per suggestions in the comments.

-
There are two problems: (1) the expressions are going to get large rapidly; a term with $n$ square roots will lead to a polynomial relation of degree $2^n$, and (2) your equivalences are running 'the wrong way' - it's not true that $a=b\Leftrightarrow a^2=\pm b^2$, but rather that $a^2=b^2\Leftrightarrow a=\pm b$, which is the opposite of what you want to make this work. In general, the polynomial relation will have $2^n$ distinct 'roots' for the one non-square-root variable of the original expression in terms of the other variables. –  Steven Stadnicki Nov 14 '13 at 17:52
See the answers to this math StackExchange question: Rationalizing radicals –  Dave L. Renfro Nov 14 '13 at 18:15

You are asking a special case of the following problem in abstract algebra: Suppose $x$ is a solution to $p(x) = 0$ and $y$ solves $q(y)=0$, for polynomials $p,q$ (with, say, integer coefficients); find a polynomial (with, again, integer or whatever coefficients) that has $x+y$ as a solution. In the "$\sqrt{a} + \sqrt{b} = c$" version of your question, you have $p(x) = x^2-a$ and $q(y) = y^2 - b$.

There is a general way to do this. Unfortunately in the version I described, the degrees of the polynomials get large. This is because of the following. Suppose that $p$ is of degree $\deg p$, and $q$ has degree $\deg q$. Then generically $p$ has $\deg p$ many complex solutions and $q$ has $\deg q$ many complex solutions. Thus (unless these solutions happen to satisfy some coincidences) there are $(\deg p)(\deg q)$ many possible values of $x+y$ if all you know is that $x$ solves $p(x)=0$ and $y$ solves $p(y)=0$. Whatever the polynomial is that $x+y$ solves, it must be solved by all of possible of these $(\deg p)(\deg q)$ numbers, since you have no way of telling it which solution you want. Therefore, this polynomial must have degree $(\deg p)(\deg q)$.

So in the example "$\sqrt a + \sqrt b = c$", we're looking for a polynomial solved by $c$ with "integer" (really, polynomial expressions in $a,b$) coefficients, and it necessarily will have degree $4$. Now adding on another square root means that in your case, your polynomial in $d$ will have degree $(4)(2) = 8$. In the next one, you get a polynomial of degree $16$. There's really nothing you can do about this.

Of course, there will be some patterns. Let me focus on your case of sums of square roots. The two solutions to $x^2-a = 0$ are, of course, $\pm \sqrt a$, and the two solutions to $y^2-b$ are $\pm \sqrt b$. Thus the four possible values of $x+y$ are $\pm \sqrt a \pm \sqrt b$. Therefore the polynomial we want is the degree-$4$ polynomial vanishing on these four points, namely:

$(z - \sqrt a - \sqrt b)(z - \sqrt a + \sqrt b)(z + \sqrt a - \sqrt b)(z + \sqrt a + \sqrt b) = ((z - \sqrt a)^2 - b)((z + \sqrt a)^2 - b) = (z^2 - a)^2 + b^2 - b((z - \sqrt a)^2 + (z + \sqrt a)^2) = z^4 - 2z^2a + a^2 + b^2 - 2z^2 b - 2ab = z^4 - 2(a+b)z^2 + (a-b)^2$

This illustrates, for example, that only even powers of the new variable (in your case, $d$) will appear — exactly because the set of solutions to this polynomial will necessarily be symmetric under $d \mapsto -d$. Such a polynomial is called "even".

In all cases, let me henceforth call the new variable $z$ — so you asked about $\sqrt a + \sqrt b + \sqrt c = z$ or $\sqrt a + \sqrt b + \sqrt c + \sqrt d = z$, and so far I've discussed $\sqrt a + \sqrt b = z$. Let's say there are $n$ terms on the left, so that we're looking for an even degree-$2^n$ polynomial in $z$; and I will set $a = a_1$, $b = a_2$, $c = a_3$, and on up to $a_n$. The above calculation also illustrates that the coefficient on $z^{2^n - 2k}$ will be a symmetric polynomial in the $a_i$, homogeneous of degree $k$. That it's symmetric is clear: the problem as posed is symmetric in the $a_i$. That it is homogeneous of degree $k$ follows from rescaling all $a_i$ to $\lambda a_i$; then the solutions $z$ uniformly rescale to $\sqrt \lambda z$.

So in the case that you originally asked about, with $a=3$, we're looking for:

$z^8 + p_1(a_1,a_2,a_3) z^6 + p_2(a_1,a_2,a_3) z^4 + p_3(a_1,a_2,a_3) z^2 + p_4(a_1,a_2,a_3)$

where each $p_j$ is a homogeneous symmetric polynomial of degree $j$. It is well-known, then, that $p_j$ is a polynomial in the polynomials $s_1 = a_1 + a_2 + a_3$, $s_2 = a_1^2 + a_2^2 + a_3^2$, $s_3 = a_1^3 + a_2^3 + a_3^3$, $\dots$, $s_j = a_1^j + a_2^j + a_3^j$. For example, $p_1 = \alpha(a_1 + a_2 + a_3)$ for some coefficient $\alpha$, and

$$p_2 = \beta(a_1 + a_2 + a_3)^2 + \gamma(a_1^2 + a_2^2 + a_3^2)$$

There are three as-yet undetermined coefficients in $p_3 = \delta s_1^3 + \epsilon s_1 s_2 + \zeta s_3$, and five coefficients in $p_4 = \eta s_1^4 + \theta s_1^2 s_2 + \iota s_2^2 + \kappa s_1 s_3 + \lambda s_4$. All together, we have reduced the problem from computing some arbitrary degree-$8$ polynomial with polynomial coefficients to computing $11$ rational numbers.

Can we pair these down at all? When $a \neq 0$ but $b=c=0$, the two solutions need to be $z = \pm \sqrt a$. (Well, each of these is really for solutions, for "the two values of $\pm\sqrt{0}$".) So in this case our polynomial had better evaluate to $(z^2 - a)^4$. In particular, $\alpha = -4$, and $\beta + \gamma = 6$, $\delta + \epsilon + \zeta = -4$, and $\eta + \theta + \iota + \kappa + \lambda = 1$. This completely determines $\alpha$, and of the remaining $10$ unknowns, we have $3$ equations.

When $a = b$ and $c=0$, the solutions should be $\pm 2\sqrt a$ and $0$. (Actually, two each of the first two and four of the last one.) Thus the polynomial should be $(z^2 - 4a)^2z^4$. This will determine $\alpha$ again, and give you three more equations, one of which is enough to determine $\beta,\gamma$. So we've paired the space of unknowns down to being $4$-dimensional.

You can almost certainly continue in this way. For example, set $c=0$ and $b=4a$. Then $z = \pm3\sqrt a$ or $\pm \sqrt a$, each with multiplicity two, and so the polynomial in this case is $(z^2-a)^2(z^2-9a)^2$. I think this will give you two new equations when you combine it with what you already have, and I think it's enough to determine $p_3$.

One final thing to mention: the coefficient on $z^0$ is always the product (up to a sign, which is $+1$ since there are an even number of solutions) of all the solutions. Well, the product of the solutions is $(\sqrt a + \sqrt b + \sqrt c)^2(\sqrt a - \sqrt b + \sqrt c)^2(\sqrt a - \sqrt b - \sqrt c)^2(\sqrt a + \sqrt b - \sqrt c)^2$, which is a version of the $n=2$ case. Doing this gives a different way to get $p_4$.

Here's what I get, actually doing the arithmetic:

$$z^8 - 4(a+b+c) z^6 + (2(a+b+c)^2 + 2(a^2+b^2+c^2))z^4 + (\frac43 (a+b+c)^3 - \frac83 (a^3+b^3+c^3))z^2 + (a^2 + b^2 + c^2 - 2(ab + bc + ac))^2$$

Note that the fractions in the coefficient on $z^2$ are strong evidence that I made an arithmetic mistake there, but I think the coefficients on $z^6$, $z^4$, and $z^0$ are correct.

-
I tried inserting the values $a=4$, $b=4$, $c=9$ and $z=7$ (as $\sqrt{4} + \sqrt{4} + \sqrt{9} = 7$) into your last equation, it did not result in $0$ so I think you are right that there is some arithmetic mistake (your other equation seems to be right though). But no worries I'll repeat the calculations myself, now that I understand your method. Thanks a lot for giving me a detailed answer. As $a$, $b$ and $c$ are just placeholders for more complicated expressions, I have a lot more work to do on my problem. –  Sid Nov 15 '13 at 4:22
Just realized that I have a question: I am more interested in the order of $a, b$ and $c$ than in the order of $z$. Can we know what order we will get for those if we have $n$ terms on the left? –  Sid Nov 15 '13 at 4:28
Or actually it seems to me like you have answered that question, sorry. –  Sid Nov 15 '13 at 5:23