
Maxima – A Computer Algebra System built with Lisp - dragonsh
http://maxima.sourceforge.net/
======
nsajko
Fricas (a fork of Axiom, which is a rename of Scratchpad 2) is another very
old CAS implemented with Lisp, also now open sourced. I think Fricas is more
powerful than Maxima (maybe much more) regarding symbolic integration and its
type system, but it sadly has very few developers maintaining it.

Fricas links:

[https://en.wikipedia.org/wiki/FriCAS](https://en.wikipedia.org/wiki/FriCAS)
[https://fricas.github.io](https://fricas.github.io)
[https://fricas.github.io/book.pdf](https://fricas.github.io/book.pdf)

Axiom links:

[https://en.wikipedia.org/wiki/Axiom_(computer_algebra_system...](https://en.wikipedia.org/wiki/Axiom_\(computer_algebra_system\))
[https://github.com/daly/axiom](https://github.com/daly/axiom)

~~~
SiempreViernes
Does it come with proper equation printing?

A big problem for me getting into Maxima is that the frontends I've found are
pretty unstable and the terminal version only does equations as ascii art,
which I just cant' stand reading.

~~~
forgotpwd16
>pretty unstable

What do you mean? wxMaxima has worked fine for me.

~~~
jgalt212
I've had good success with wxMaxima as well, but none of the equations I've
worked with can fill a blackboard. SymPy is very nice as well, but for obvious
reasons, it feels a bit more forced when interacting with it.

~~~
ogogmad
I use Sympy interactively, and I don't know what you mean by "forced". It
doesn't feel that way to me.

~~~
jgalt212
this is a bit rush, but an example setting up the quadratic equation.

    
    
      f(x) := a*x^2 + b*x + c
      solve( f(x),x );
      
      from sympy import symbols, solve
      a, b, c, x = sympy.symbols(('a', 'b', 'c', 'x'))
      y = sympy.Eq(a*x**2+b*x+c, 0)
      solve(y, x)

~~~
ogogmad
I would change the first two lines to:

    
    
      from sympy.abc import *
      from sympy import *
    

I would put that into a file, and auto-load it at startup so I don't need to
run it manually every time - one way of doing that is using iPython profiles.

Also put this in your startup file to get more pleasant looking output:

    
    
      init_printing(use_unicode=True)
    

Once you've done that, you only need to type:

    
    
      y = a*x**2 + b*x + c
      solve(y,x)

~~~
forgotpwd16
SymPy already comes with `isympy` script that will import everything from
SymPy and create some common symbols (x, y, z, t, k, m, n, f, g, h) using
either `python` or `ipython` (default). To do what you said the following
script may be run.

    
    
      #!/usr/bin/env python
      from sympy.abc import *
      from sympy import *
      import code
      init_printing()
      code.interact(local=locals())

------
lokedhs
Of interest may be my project that implements a CLIM-based user interface on
top of Maxima. It turns out that CLIM is perfect for this, as its idea of
presentation forms matches the way mathematical expressions are represented in
Maxima.

I have made a few videos showing how it works. It's also available on Flathub,
or if you're brave you can build it yourself.

[https://peertube.mastodon.host/videos/watch/df751bd5-5a26-44...](https://peertube.mastodon.host/videos/watch/df751bd5-5a26-44da-90d5-f47624161649)

[https://peertube.mastodon.host/videos/watch/b003360f-97a9-4f...](https://peertube.mastodon.host/videos/watch/b003360f-97a9-4f77-b474-e78d9bb687cb)

[https://github.com/lokedhs/maxima-client](https://github.com/lokedhs/maxima-
client)

~~~
smabie
I love CLIM, too bad it's not used much. The whole idea of it is very
interesting, an evolutionary dead end that in many ways seems far superior
then what "modern" GUIs provide

~~~
lokedhs
I think there are more practical reasons why it's not used more. What you say
is absolutely true of course, but the bigger issue is that McCLIM still has
some technical issues.

What is really needed is a multiplatform backend that implements everything
completely. Right now the only production grade backend is the CLX one, and
even that one requires you to jump though hoops to get complete font
rendering.

I built all of this into the flatpak distribution, but few people are willing
to go through that just to distribute some software.

------
zzbn00
For a bit of a Maxima vs Mathematica perspective, it is worth reading
Fateman's review of Mathematics:

[https://people.eecs.berkeley.edu/~fateman/papers/mma.review....](https://people.eecs.berkeley.edu/~fateman/papers/mma.review.pdf)

~~~
jmount
Beautiful writing: "... a critique of this aspect of the system will have to
wait until the bugs are fixed and only the features remain."

------
marcle
I am often amazed that one can run Maxima on an Android phone (Maxima on
Android), including Gnuplot graphics and MathJax math formulae:

    
    
      plot3d ([cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)], [x, -%pi, %pi], [y, -1, 1], ['grid, 50, 15]);
    
      /* gradient of the log-likelihood for a time-dependent accelerated failure time model */
      assume(t>0)$ H:-log(S(integrate(exp(alpha+beta*x(u)),u,0,t))); diff(delta*diff(H,t)-H,beta);
    

Axiom/Fricas is a beautiful language which provides a powerful mathematical
type system.

~~~
em500
Why are you amazed about that? A modern Android phone is a general purpose
computer roughly as powerful as a 2010-2015 laptop. Math software like Maxima,
Mathematica, Maple have a very long history and was widely used on 1980s/1990s
hardware.

~~~
ploika
Because it is amazing? Intellectually I know all about Moore's law, but having
a supercomputer in your pocket still feels like science fiction in reality.
There's no reason to push that feeling away.

~~~
Sharlin
But things like plotting a simple function, 3D or not, are vastly less
performance-intensive than almost all _other_ things that people do with their
phones, like rendering just about any modern webpage. Never mind actually
demanding things like playing 3D games (doing _that_ on a cellphone was indeed
rather amazing back in 2011, being accustomed to mobile games mostly being
simple 2D affairs).

~~~
narwally
I recently pulled out an old 2008 unibody Macbook pro just to play around on.
It was a nearly %100 CPU utilization just attempting to play a 4K youtube
video. That's something my $400 phone doesn't even break a sweat on. It's
amazing how well cell phones have been optimized in the last decade.

~~~
Sharlin
That one's probably thanks to hardware h.264/265 decoding. That poor 2008 MBP
likely has to do all the heavy lifting in software…

------
vsskanth
Used Maxima to find some analytical differentials. It is very powerful but
documentation could be a pain to decipher if you're new

------
1MachineElf
To my detriment, I avoided having to learn anything in my 2007 highschool
online Algebra 2 class by simply feeding the equations into Maxima. That was
the year I first started using Linux - a Ubuntu 8.04 install CD on a Linux
magazine saved my laptop from a corrupted Windows Vista install while away
from home.

~~~
narwally
I was doing my first Linux install around the same time. I ordered an install
CD from both Ubuntu and Linux Mint; the Mint one came in first, so that's the
OS I used for my first few years. I used the CD to make a bootable usb stick
so that I could use the internet when my parents weren't home (they kept
Windows password protected). I've never actually run Windows on a personal
machine since I didn't have my own until college, and but that time I was a
few years into my Linux journey.

------
dharmatech
See also, computer algebra library for Scheme:

[https://github.com/dharmatech/mpl](https://github.com/dharmatech/mpl)

~~~
gnufx
How does it compare with JACAL, which is the old Scheme one I know?
[https://people.csail.mit.edu/jaffer/JACAL](https://people.csail.mit.edu/jaffer/JACAL)

~~~
zelphirkalt
According to a file mpl.org in the repo linked, JACAL uses SLIB. Not sure if
MPL does not, but I would assume that.

Not sure what difference it makes, but probably some.

------
tgv
If you want to see what it can do for you, wxMaxima is an easier entry, with
at least an attempt at a GUI: [https://github.com/wxMaxima-
developers/wxmaxima/releases](https://github.com/wxMaxima-
developers/wxmaxima/releases), although macOS is quite badly supported.

------
guts
There is a maxima to python translation tool. It's good for sharing your
maxima code with everyone else.
[https://gist.github.com/LakshyAAAgrawal/33eee2d33c4788764087...](https://gist.github.com/LakshyAAAgrawal/33eee2d33c4788764087eef1fa67269e)

~~~
alchadoor
This is nicee... With this we can bridge between historic Maxima and
technology of present aka Python. As they say “It is in the roots, not the
branches, that a tree’s greatest strength lies.”

~~~
LakshyAAAgrawal
Thank you for the kind words..

------
sadfev
I think sagemath uses this for their symbolic package

~~~
williamstein
That is correct. We embed Maxima at the C level using ECL for much better
performance than one might expect (basically call Maxima from python very
efficiently in the same process!).

~~~
sadfev
Prof Stein,

I am pleasantly surprised to get a reply from you! I have one question, How
often is Sympy used in Sagemath compared to Maxima?

Or rather when I do symbolic math in sagemath, do I ever hit Sympy?

------
geogra4
Is this related to macsyma?

~~~
e40
Maxima was the port of Macsyma to Franz Lisp at UC Berkeley done by Prof.
Fateman and his students. Franz Lisp was written to be Mac Lisp compatible for
the sole purpose of running Macsyma. Prof Fateman worked on Macsyma at MIT.

~~~
minxomat
And today Franz Lisp is instrumental in running older maclisp programs because
the Franz lisp binaries still run unmodified on current BSD releases (with
kernel compatibility turned on).

~~~
e40
That's amazing. VAX or 68k binaries?

~~~
minxomat
Less exciting than that, the first BSD port.

Details are here:
[https://github.com/turbo/netlisp](https://github.com/turbo/netlisp)

------
davidcorbin
How does this compare to Sage?

~~~
nsajko
Sage is a python wrapper around other systems such as Maxima or Fricas.

~~~
bee_rider
Does sage also handle numerical stuff? The impression I got was that it was a
bit more general than Maxima.

However, I am terribly frightened by programs like this, as I suspect they are
much smarter than me, so I tend to avoid them.

~~~
williamstein
Yes, Sage includes Python and the Python numerical stack (numpy, scipy, etc).
It also has a lot of new code related to interval arithmetic (arbitrary
precision numerical computation with proven error bounds).

~~~
bee_rider
I do numerical linear algebra stuff, but every time I hear about interval
arithmetic my ears perk up. It just seems like our error bounds require
caveats (a-hah, I actually gave you the backward error, nyaah!) while theirs
are just numbers.

