====== Maxima Cheat Sheet ======
===== Solving exponential equations =====
Maximas solve cannot handle exponential equations. However, it converts them into a form which can be used further by taking the logarithm of both sides. Make sure to set 'logexpand' to 'all':
f(x):=a*2^((x-2)/2)+2;
g(x):=b*3^((x-4)/5)+1;
solve(f(x)=g(x),x);
x - 4
x - 2 -----
----- 5
2 b 3 - 1
(%o8) [2 = ------------]
a
logexpand:all;
solve(log(solve(f(x)=g(x),x)),x);
x/5 - 4/5
2 log(b 3 - 1) - 2 log(a) + 2 log(2)
(%o11) [x = ---------------------------------------------]
log(2)
Und sonst halt mit ''find_root (expr, x, a, b)''
===== Output stuff like Maxima Input =====
(%i14) x^2/3;
2
x
(%o14) --
3
(%i15) string(%);
(%o15) x^2/3
===== Derivative as a new function (force evaluating the differentiation) =====
f(x):=a*2^((x-2)/10)+2;
define(ff(x), diff(f(x),x));
===== Using results of solve for further computations =====
sol:solve(x^2-x-1=0,x);
x^2-x, sol[2];
expand(%);
val:x,sol[2];
/* Usable inside an expresseion: */
subst(sol[2],x);
Or even better:
rhs(sol[2]);
map(rhs, sol);
===== Nummerically solve equations =====
[[https://maxima.sourceforge.io/docs/manual/maxima_116.html|Maxima doc]]
find_root(sin(2*x)=x,x,0.5,2);
===== Vector operations =====
load("vect");
cross(u,v):=express(u ~ v);
norm(a):=sqrt(a.a);
area(a,b,c):=1/2*norm(cross(b-a,c-a));
vec2eq(eq):=makelist(rhs(eq)[i]=lhs(eq)[i], i, 1, length(rhs(eq)));
===== Binomial Distribution =====
load("distrib");
pdf_binomial (25,500,0.03);
cdf_binomial (25,500,0.03);