\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)

Introduction to wxMaxima

1 What is a Computer Algebra System (CAS)?

A computer algebra system, or CAS for short, is a piece of mathematics software.  It allows a user (that's us) to type in
Algebra, Calculus, and Statistical questions - using commands that are reasonably similar to human language -
and it tries to answer them using the computational power of the computer.  The goal of most CASs is to answer these questions
in a way that a human expects.  Think of a CAS like a graphing calculator that tries its best to think and act like a human.
For the most part, all CASs that are around today do a pretty decent job at this task.  But, ultimately, they are still software
running on a machine, and sometimes the way they expect input and the way they produce output is a little... wonky.

2 What is wxMaxima?

One of the oldest CASs in existence is one called Macsyma.  It began its software life in 1968 by researches at MIT.  Yes,
you read that right - 1968!  It was heavily developed through the seventies by MIT until it was licensed to a private
company in 1982 called Symbolics.  Imediately after it was sold, the US Department of Energy took the old
source code for Macsyma and continued to develop it and use it for academics and other government agencies.  This D.O.E. version was
open sourced in 1999 under the name of Maxima, and continues to be developed as an open source project to this day!

Which brings us to the question: What is wxMaxima?  As you can imagine, software written in the sixties was not intended on
being "visual" or pretty.  Infact, Macsyma was originally intended to be run in a command line - text only environment.
While this gets the job done just fine (and you can still run Maxima this way), it offends our modern "visual" expectations
of what a program should look and act like.  Enter wxMaxima.  wxMaxima is the pretty face on the old school Maxima CAS.  It allows us
to type text, make reports, and most importantly for some of us, has menus and buttons to help us remember the commands we need.

Why all this history?  First, you should be aware of this: if you are googling for help on wxMaxima commands
you can multiply the effectiveness of your search dramatically by searching for Maxima commands as well - because wxMaxima is
just the face of Maxima that we are interacting with.  Second: Maxima has been around FOR A LONG TIME. Because of this, many
of today's CASs like Mathematica, Maple, and Matlab all borrow from its heritage.  Practically speaking, this means that
the commands and syntax you learn in Maxima will translate (with minor vocabulary changes) to any of these programs.  So learning
Maxima is a lot like learning all of the CASs at once!  Finally, because Maxima has a long history of academic use, and existed long
before Microsoft Windows was around, FREE incarnations of Maxima exist on almost every operating system.  This includes Mac, Linux, and Android.
Yup, there is an Android app for Maxima.

3 Using the wxMaxima Editor

 3.1 Typing Explanatory Text

To type text, add a title, a section, a subsection, etc. you have two options.  You can use the menu:

Cell → Insert [Text/Heading/etc]

And this will place a Text-box/Heading-box on the line below where the cursor is currently sitting.

Far easier in practice is to use the shortcuts.  Using Ctrl for the control key:

Ctrl+1 : Start a new text box

Ctrl+2 : Add a Main Title

Ctrl+2 : Add a Main Title

Ctrl+3 : Add a Section Title

Ctrl+4 : Add a Subsection Title

Ctrl+5 : Add a Subsubsection Title

If you type any amount of text (which you might when you do your homework) you may want to get comfy with these
shortcuts.  Especially Ctrl+1 to enter a new textbox.

If you looked under the Cell menu a little more, you might notice that it is also possible to insert pictures
as well as pagebreaks.  A pagebreak is a command that tells the printer/document reader to split the page at
a specific point. This can be useful for long documents that are not displaying correctly.

--- Useful formatting tips ---

>> Each text cell creates 1 paragraph. Even though you may write several paragraphs in a single cell, the breaks in your text
will be ignored unless you seperate them out to seperate cells.

>> Breaks in your text are good. Be generous with using the text cells!

 3.2 Typing in Mathematics Commands

If you want to type in commands to Maxima, then just start typing outside of any text/title box in the editor window.
The default entry method in wxMaxima is 'input.'  So if I go below this textbox and type in 3+2, then wxMaxima
will interpret this as input to be worked on:

--> 3+2;
\[\tag{\%{}o1}\label{o1} 5\]

You will hopefully notice the grayed out semi-colon (;).  All Maxima commands are terminated with ; and wxMaxima
is kind enough to add one in for us automatically!  The fact that it is grayed out means that the editor added
that for us.  We will handle using the CAS in much more depth in the next tutorial.

 3.3 Saving and Printing

To save your work, you can either use the menus:

File > Save

or

File > Save As

Or you can use the standard shortcut keys that work for most text editors:

Ctrl+s : Save

Ctrl+Shift+s : Save As

These commands will save the current session as a .wxmx file that can be read and evaluated only by the wxMaxima editor.
If you open one of these files in a competent (competent = not MSWord) text editor, then what you will see is
essentially all of the text that you have written, together with your mathematics, interspersed with basic, plain-text,
instructions for how the wxMaxima editor is to display your work in the editor.  It is possible, though not recommended,
to edit these files by hand - outside of the wxMaxima editor.

The main sore point of wxMaxima is printing support.  Remember when we said that Maxima was originally written to be run
in a text only mode?  Well, this had a lot to do with the researchers who were using Maxima not really being concerned with printing
their Maxima work directly.  The software culture at the time dictated that each program should do one thing really well and
should not do anything else.  So researchers would dump their Maxima computation results into a file and then use other tools to
incorporate their work into their reports. (Recall that the save files for wxMaxima are in PLAIN TEXT.  This allows you to easily
go into that file, dig around, and grab what you want.) Maxima itself has no printing support, because the software culture that produced
it would say: why would it?  It is a program for doing calculations, not printing reports!  But our modern software expectations find this a little offensive.  We
have grown up with programs that "do it all."  The author of wxMaxima has tried to add in printing support and on some platforms it
works.  On most others, it fails - spectacularly.

So how do you print your work if you have to?  There are two options. The first is to
export the document as an html file and then open and print it
using Firefox or Chrome.  To export as an html file:

File > Export

The default export format is html. When you choose this option, you will notice that the file name already has .html in it.
Your exported file *must* have the .html extension.  When you click Save wxMaxima creates an html version of your .wxmx file
and possibly a folder containing any pictures or graphs that your file requires.  If you then open that html file with Firefox
or Chrome, then you can print it just like any other webpage.

The second option is to print the document as a pdf file directly, and then print that pdf using a pdf viewer like
Adobe Acrobat.

Finally, if you find that your home printer prints the document without doing anything special, then congratulations!
You don't have to worry about this minor inconvenience.

 3.3.1 Save Often and Export Often!

When you export your work you are, in a sense, "taking a picture" of the work you have done.  You cannot continue to add and evaluate
math in your exported html file.  So it is important that you also save your work as a wxmx file!  You should occasionally export
your work to check to see if it is outputting what you expect!


Created with wxMaxima.