# Five equations to solve 6-variables question, is it possible?

I was given a task to find the value of variable a,b,c,d,e and f. But I'm not sure it is even possible, given that only 5 equations are available. Can anybody point out how to solve these:

a+b+c=164.35;
d+e+f=94.44;
a^2+d^2=20.06^2;
b^2+e^2=74.34^2;
c^2+f^2=123.27^2


Thank you.

EDIT 1:

If you know additional constraints for each variable, you can add them in to the list of equations.

sols = Solve[{
a + b + c == 164.35,
d + e + f == 94.44,
a^2 + d^2 == 20.06^2,
b^2 + e^2 == 74.34^2,
c^2 + f^2 == 123.27^2,
a >= 0,
b >= 0,
c >= 0,
d >= 0,
e >= 0,
f >= 0
},
{a, b, c, d, e, f},
Reals
]
sols[]
(* {a->19.7827,b->23.001,c->121.566,d->3.32366,e->70.6922,f->20.4241} *)


sols[] remains relatively simple, however the first 2 are still rather complicated expressions.

Original:

If you look up Solve or NSolve in the documentation centre, it should demonstrate some basic examples of how to use those functions.

sols = Solve[{
a + b + c == 164.35,
d + e + f == 94.44,
a^2 + d^2 == 20.06^2,
b^2 + e^2 == 74.34^2,
c^2 + f^2 == 123.27^2
},
{a, b, c, d, e, f},
Reals
]


The first 7 solutions returned are complicated ConditionalExpressions, but if you look as sols[[8 ;; 17]], those are fairly simple solutions with a numerical value for each of the variables. Of course, I'm assuming you're only looking for answers where all $$a$$ through $$f$$ are real. If that's not the case, you can drop the Reals part from the Solve command.

In general, there are many values of $$a, b, c, d, e,$$ and $$f$$ that satisfy the equations. I don't know if you have any further constraints, or if you simply need some solution.

• Wow thanks. This is great. Yes, a through f are real values, but I forgot to mention that the values are positive number. Is there a way to add this constraint inside this? Another question is, the value may be a positive number, but it can also be zero, is there any way to represent my statement here? Thanks again. – Azlan Jun 12 '19 at 2:49
• @Azlan No problem. I've updated by answer to include your conditions. – MassDefect Jun 12 '19 at 2:58
• Great, thanks! This definitely solves my problem. – Azlan Jun 12 '19 at 3:04
• @Azlan Note that your intuition was correct: in general it is not possible to solve $n$ variables with only $n-1$ equations. In many cases, you would still be able to reduce complicated expressions to arrive at a family of solutions. Take, for example Reduce[{x+y+z==2,x+y==1},{x,y,z},Reals] which gives $z=1$ and $y=1-x$. This last part describes a line of points for which the equations hold. – LBogaardt Jun 12 '19 at 14:33
• @LBogaardt thanks for your comments, I was thinking about some similar argument when I got the assignment thus I came to ask the question here, in case anybody have any better idea. However, by applying the code that MassDefect has shown above, the answer did come out (with a few warnings). Further, by applying a few conditions, I can get one single answer that fits all of the equations and conditions. I believe (my assumption) Mathematica did go beyond reasonable measure to get that answer ie. "trial and error", which I am so thankful that I get to apply my theory on the assignment. – Azlan Jun 14 '19 at 0:55