# How to solve equation system [closed]

How to calculate $x,y,k$ in terms of constants $a$ and $b$ in the following equations in Mathematica:

4*y-k*2*x/a^2=0,
4*x-k*2*y/b^2=0,
x^2/a^2+y^2/b^2-1=0

Why doesn't the following command work? (I am new)

Solve[4*y-k*2*x/a^2=0&&4*x-k*2*y/b^2=0&&x^2/a^2+y^2/b^2-1=0,{x,y,k},reals]

There are many errors in your code:

1. it is Reals not reals
2. you have to write == instead of = (read here for example)
3. you need curl brackets (as Bob Hanlon points out, there is no need of brackets if && is used).

The correct code is:

Solve[{4*y - k*2*x/a^2 == 0 && 4*x - k*2*y/b^2 == 0 &&
x^2/a^2 + y^2/b^2 - 1 == 0}, {x, y, k}, Reals]

EDIT If you have to consider some assumptions, use the following code:

Assuming[{your assumptions},Simplify[Solve[{4*y - k*2*x/a^2 == 0 && 4*x - k*2*y/b^2 == 0 &&
x^2/a^2 + y^2/b^2 - 1 == 0}, {x, y, k}, Reals]]]
• Thank you very much. How can we add to more conditions which are $x>0$ and $x>0$? Mar 22, 2017 at 12:19
• @mattiav27, you'd actually want to put Simplify[] within Assuming[] so that any assumptions set get accounted for in simplification. Mar 22, 2017 at 12:32
• Since && is used, equations do not have to be inside brackets, Brackets are needed if the equations are separated by commas. First argument to Solve can include inequalities, e.g., Solve[4*y - k*2*x/a^2 == 0 && 4*x - k*2*y/b^2 == 0 && x^2/a^2 + y^2/b^2 - 1 == 0 && x > 0 && y > 0, {x, y, k}, Reals]; however, Assuming is better since as @J.M.points out they are passed to Simplify. Mar 22, 2017 at 16:54