Eliminating one or more variables from a list of equations

### 9.1.17 Eliminating one or more variables from a list of equations

The eliminate command eliminates variables from a list of equations.

- eliminate takes two arguments:
  - eqns, a list of equations.
  - vars, the variable or list of variables to eliminate. The equations can be given as expressions, in which case they will be assumed to be 0.
- eliminate(eqns,vars) returns the equations with the variables vars eliminated or an indication that Xcas cannot eliminate them.

#### Examples

Assuming the variables used haven’t been set to any values:

eliminate([x=v0*t,y=y0-g*t^2], t)

| ⎡ ⎣ | g x2+y v02−v02 y0 | ⎤ ⎦

eliminate([x+y+z+t-2,x*y*t=1,x^2+t^2=z^2],[x,z])

| ⎡ ⎣ | 2 t2 y2−4 t2 y+t y3−4 t y2+4 t y+2 t+2 y−4 | ⎤ ⎦

If the variable(s) cannot be eliminated, then eliminate returns [1] or [-1]. If eliminate returns an empty list, that means the equations determine the values of the variables to be eliminated.

x:=2; y:=-5 eliminate([x=2*t,y=1-10*t^2],t)

| ⎡ ⎣ | 1 | ⎤ ⎦

since t cannot be eliminated from both equations.

x:=2; y:=-9 eliminate([x=2*t,y=1-10*t^2],t)

| ⎡ ⎣ | ⎤ ⎦

since the first equation gives t=1, which satisfies the second equation.

x:=2; y:=-9 eliminate([x=2*t,y=1-10*t^2,z=x+y-t],t)

| ⎡ ⎣ | 1,z+8 | ⎤ ⎦

since the first equation gives t=1, which satisfies the second equation, and so that leaves z=2−9−1=−8, or z+8=0.