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.

xs: sqrt(g^2*(1-g^2/(4*r^2)));
i1: integrate(-r+sqrt(g^2-x^2) + sqrt(r^2-g^2*(1-g^2/(4*r^2))), x);
e1: ratsimp(2 * (subst(xs, x, i1) - subst(0, x, i1)));
i2: integrate(sqrt(r^2-x^2)-sqrt(r^2-g^2*(1-g^2/(4*r^2))), x);
e2: ratsimp(2 * (subst(xs, x, i2) - subst(0, x, i2) ));
e: ratsimp(e1 + e2);
f1: ratsimp(subst(10, r, e1));
f2: ratsimp(subst(10, r, e2));
f:ratsimp(subst(10, r, e));
plot2d([f1, f2, f,%pi*10^2/2],[g,3.744,3.745]);
g:3.7445;
plot2d([-10+sqrt(g^2-x^2) + sqrt(10^2-g^2*(1-g^2/(4*10^2))), -sqrt(10^2-x^2)+sqrt(10^2-g^2*(1-g^2/(4*10^2)))], [x, -10, 10]);

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

eq1:1686.5*x^2+c1=61....

eq1a:subst(250,x,eq1);

eq2:562.2*x^3+c1*x=20...

Calculate

subst

(x^3 + y^3) / (x^2 * ...

subst (lambda*x, x, %...

Calculate

subst

subst(f,sqrt,sqrt(a));

Calculate

subst

dx : x-x0;

dy : y-y0;

F : a*dx^2 + b*dx*dy ...

Calculate

subst

eq01:lambda=c/f;

eq02:f=E/h;

eq03:subst(eq02,eq01);

Calculate

subst

h:[%i/(w^3*c^2*l-2*%i...

p:h*subst(-w,w,h);

Calculate

subst

konstanty:[f2=15,f3=1...

rovnice:[k+f2+f3+q=5,...

reseni:subst(konstant...

Calculate

subst

eq1:a+b=6;

subst(3,a,eq1);

Calculate

subst

eq01:lambda=c/f;

eq02:f=E/h;

eq03:subst(eq02,eq01);

Calculate

subst

f: y^5-y^3-rho;

g: subst([y=xi*z],f);

Calculate