Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Subst Calculator

Subst

Function: subst (<a>, <b>, <c>) Substitutes <a> for <b> in <c>. <b> must be an atom or a complete subexpression of <c>. For example, x+y+z is a complete subexpression of 2*(x+y+z)/w while x+y is not. When <b> does not have these characteristics, one may sometimes use substpart or ratsubst (see below). Alternatively, if <b> is of the form e/f then one could use subst (a*f, e, c) while if <b> is of the form e^(1/f) then one could use subst (a^f, e, c). The subst command also discerns the x^y in x^-y so that subst (a, sqrt(x), 1/sqrt(x)) yields 1/a. <a> and <b> may also be operators of an expression enclosed in double-quotes " or they may be function names. If one wishes to substitute for the independent variable in derivative forms then the at function (see below) should be used.

m: 4;
e0: ((m+1)*x+(m-1)*y)/(2*m);
e1: ((m-1)*x+(m+1)*y)/(2*m);
fullratsimp(subst(e0, y, e1));
 solve((a-r)*(d-r)-b*c,r);
a0: 0;
a1: 1;
a: 49/64;
b: 15/64;
c: 3/8;
d: 5/8;
sqrt(a^2+d^2-2*a*d+4*b*c);
a1*b/sqrt(a^2+d^2-2*a*d+4*b*c);

subst is an alias for substitute.

subst (<eq_1>, <expr>) or subst ([<eq_1>, ..., <eq_k>], <expr>) are other permissible forms. The <eq_i> are equations indicating substitutions to be made. For each equation, the right side will be substituted for the left in the expression <expr>.

exptsubst if true permits substitutions like y for %e^x in %e^(a*x) to take place.

When opsubst is false, subst will not attempt to substitute into the operator of an expression. E.g. (opsubst: false, subst (x^2, r, r+r[0])) will work.

Examples:

          (%i1) subst (a, x+y, x + (x+y)^2 + y);
                                              2
          (%o1)                      y + x + a
          (%i2) subst (-%i, %i, a + b*%i);
          (%o2)                       a - %i b

For further examples, do example (subst).

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

(%o1)                                true
(%i2) 

Subst Example

Related Examples

subst

answer:x*4+y-2=0;

not is(subst([x=0,y=0...

Calculate

subst

a1+a2*t+a3*(2*t*t-1);

subst((x-50)/70,t,%o1);

Calculate

subst

subst (a, x+y, (x+y) ...

Calculate

subst

var1: E[A] = 1.0e7;

var2: E[P] = 3.04e5;

var3: R[1] = .62;

Calculate

subst

w=x^2;

w=subst(x=2,w);

Calculate

subst-tan-trigexpand

f:tan(2*u-v);

f:trigexpand(f);

f:subst(u=2*w,f);

Calculate

subst

g: m*(x-u)+v;

t: subst( 0,x,g );

k: x^2+y^2-2*t*y-1;

Calculate

subst

P(k) := k + 1;

Q(k) := k + 3/2;

subst(1/2,z,z^2/(P(k)...

Calculate

subst

var1: E[6063] = 1.0e7;

var2: E[ABS] = 3.04e5;

eq1: I = %pi/4*(R[2]^...

Calculate

subst

x_SPFV:1;

x_SPNV:1;

x_SGV:1;

Calculate