### 5.13.24 Eliminate one or more variables from a list of equations: eliminate

The eliminate commands takes two arguments; a list of equations and the variable (or list of variables) to eliminate.
eliminate returns the equations with the requested variables eliminated. (The equations will be given as expressions, assumed to be equal to 0.)

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

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

Output :

[v0^2*y0-x^2*g-v0^2*y]

Input:

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

Output:

[10*y^2-20*y*z+10*z^2+y-1,x+2*y-2*z]

Input:

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

Output:

[2*t^2*y^2+t*y^3-4*t^2*y-4*t*y^2+4*t*y+2*t+2*y-4]

If the variable(s) can’t be eliminated, then eliminate returns [1] or [-1]. If eliminate returns [], that means the equations determine the values of the variables to be eliminated.

Input:

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

Output:

[1]

since t cannot be eliminated from both equations. Input:

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

Output:

[]

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

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

Output:

[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.