### The Maxima on-line user's manual

Algebra Calculator

#### Linsolve

Function: linsolve ([<expr_1>, ..., <expr_m>], [<x_1>, ..., <x_n>]) Solves the list of simultaneous linear equations for the list of variables. The expressions must each be polynomials in the variables and may be equations.

When `globalsolve` is `true`, each solved-for variable is bound to its value in the solution of the equations.

When `backsubst` is `false`, `linsolve` does not carry out back substitution after the equations have been triangularized. This may be necessary in very big problems where back substitution would cause the generation of extremely large expressions.

When `linsolve_params` is `true`, `linsolve` also generates the `%r` symbols used to represent arbitrary parameters described in the manual under `algsys`. Otherwise, `linsolve` solves an under-determined system of equations with some variables expressed in terms of others.

When `programmode` is `false`, `linsolve` displays the solution with intermediate expression (`%t`) labels, and returns the list of labels.

```          (%i1) e1: x + z = y;
(%o1)                       z + x = y
(%i2) e2: 2*a*x - y = 2*a^2;
2
(%o2)                   2 a x - y = 2 a
(%i3) e3: y - 2*z = 2;
(%o3)                      y - 2 z = 2
(%i4) [globalsolve: false, programmode: true];
(%o4)                     [false, true]
(%i5) linsolve ([e1, e2, e3], [x, y, z]);
(%o5)            [x = a + 1, y = 2 a, z = a - 1]
(%i6) [globalsolve: false, programmode: false];
(%o6)                    [false, false]
(%i7) linsolve ([e1, e2, e3], [x, y, z]);
Solution```

`          (%t7)                       z = a - 1`

`          (%t8)                        y = 2 a`

```          (%t9)                       x = a + 1
(%o9)                    [%t7, %t8, %t9]
(%i9) %;
(%o9)            [z = a - 1, y = 2 a, x = a + 1]
(%i10) [globalsolve: true, programmode: false];
(%o10)                    [true, false]
(%i11) linsolve ([e1, e2, e3], [x, y, z]);
Solution```

`          (%t11)                      z : a - 1`

`          (%t12)                       y : 2 a`

```          (%t13)                      x : a + 1
(%o13)                 [%t11, %t12, %t13]
(%i13) %;
(%o13)           [z : a - 1, y : 2 a, x : a + 1]
(%i14) [x, y, z];
(%o14)                 [a + 1, 2 a, a - 1]
(%i15) [globalsolve: true, programmode: true];
(%o15)                    [true, true]
(%i16) linsolve ([e1, e2, e3], [x, y, z]);
(%o16)           [x : a + 1, y : 2 a, z : a - 1]
(%i17) [x, y, z];
(%o17)                 [a + 1, 2 a, a - 1]```

There are also some inexact matches for `linsolve`. Try `?? linsolve` to see them.

```(%o1)                                true
(%i2) ```

### Related Articles

How to create Nullspace (Kernel) matrix

### Related Examples

##### linsolve

eq1:(-102/31)*x+(4/96...

linsolve([eq1],[x]);

Calculate

##### linsolve

eq1:x11+x12+x13=11;

eq2:x21+x22+x23=9;

eq3:x11+x21=7;

Calculate

##### linsolve

eq1:-N2*L+F3*L-N3*4*L=0;

eq2:N1*L + F*2*L - N3...

eq3:N1*4*L + N2*3*L -...

Calculate

##### linsolve

f(x):=m*x+t;

linsolve([f(a)=-c,f(b...

Calculate

##### linsolve

eq1:(W*(L-L1)-F1*L)/(...

eq2:(W*(L-L1)-F2*(L-L...

linsolve([eq1,eq2],[F...

Calculate

##### linsolve-numer

eq1:q= 1800 + 240*p;

eq2: q= 3550 - 266*p;

linsolve([eq1,eq2],[p...

Calculate

##### linsolve

eq1:-7+c*100+2000*(c-...

eq2:5000*a+20000*(a-b...

eq3:10000*b+1000*(b-c...

Calculate

##### linsolve-solve

eq1: 6*a = 6*d;

eq2: 12*a + c = 12*d ...

eq3: 6*a + c = 7*d + ...

Calculate

##### linsolve

eq1:a00x+v00x*u+(a010...

eq2:a00y+v00y*u+(a010...

linsolve([eq1,eq2],[t...

Calculate

##### linsolve

eq1:0.5*x^4+3=yp;

eq2:yp=5;

linsolve([eq1,eq2],[x...

Calculate