Online Algebra Calculator
Many of users do not use powerful Maxima computer algebra system for systematic work, but for ad hoc algebraic calculations – equations, functions, matrixes, etc. only. To do this job, it is not useful to download the whole application from a web site.
Function: apply (<F>, [<x_1>, ..., <x_n>]) Constructs and evaluates an expression <F>(<arg_1>, ..., <arg_n>).
![Apply Example m:(h:[],for i:0 thru 3 do h:append(h,[i^2]),h);
n:for j:1 thru 5 do h:append(h,[(h:[],for i:0 thru 3 do h:append(h,[i^2]),h)]);
h;
p:[[0, 1, 4, 9], [0, 1, 4, 9], [0, 1, 4, 9], [0, 1, 4, 9], [0, 1, 4, 9], [0, 1, 4, 9]];
apply(matrix, p);](http://maxima-online.org//plot.html?g=i160086740.png&t=img&db=r-1230190070)
apply does not attempt to distinguish array functions from ordinary functions; when <F> is the name of an array function, apply evaluates <F>(...) (that is, a function call with parentheses instead of square brackets). arrayapply evaluates a function call with square brackets in this case.
Examples:
apply evaluates its arguments. In this example, min is applied to the value of L.
(%i1) L : [1, 5, -10.2, 4, 3];
(%o1) [1, 5, - 10.2, 4, 3]
(%i2) apply (min, L);
(%o2) - 10.2 apply evaluates arguments, even if the function <F> quotes them.
(%i1) F (x) := x / 1729;
x
(%o1) F(x) := ----
1729
(%i2) fname : F;
(%o2) F
(%i3) dispfun (F);
x
(%t3) F(x) := ----
1729 (%o3) [%t3]
(%i4) dispfun (fname);
fname is not the name of a user function.
-- an error. Quitting. To debug this try debugmode(true);
(%i5) apply (dispfun, [fname]);
x
(%t5) F(x) := ----
1729(%o5) [%t5]
apply evaluates the function name <F>. Single quote defeats evaluation. demoivre is the name of a global variable and also a function.
(%i1) demoivre;
(%o1) false
(%i2) demoivre (exp (%i * x));
(%o2) %i sin(x) + cos(x)
(%i3) apply (demoivre, [exp (%i * x)]);
demoivre evaluates to false
Improper name or value in functional position.
-- an error. Quitting. To debug this try debugmode(true);
(%i4) apply (demoivre, [exp (%i * x)]);
(%o4) %i sin(x) + cos(x) There are also some inexact matches for apply. Try ?? apply to see them.
(%o1) true (%i2)
solve(a*x^2+b*x+c=0,a);
solve(a*x^2+b*x+c=0,b);
solve(a*x^2+b*x+c=0,x);
solve(a*x^2+b*x+c=0,a);
solve(a*x^2+b*x+c=0,b);
solve(a*x^2+b*x+c=0,x);