# Why is Maxima a student and a student? or "The task of the weightless bear"

In this post I want to kill several birds with one stone.
First, tell people again about the Maxima free computer algebra system.
Secondly, to find the weight of the “mystical hare” from a simple task for schoolchildren.

Thus, after reading this article, you will learn what Maxima is, for what purposes it can be used, and how to solve the system of linear equations in Maxima,

#### Part one: Why should a student or schoolchild Maxima?

For all the periods of my studies at the stages of school, secondary special or higher education.
None of the teachers spoke about free applied mathematical programs that could simplify the life of a student in a technical specialty.

For some reason, in the minds of teachers, the best tool for automatic computing was Microsoft Excel. Both in college and in high school, we were asked to do calculations either on a calculator or in Excel. Despite the fact that both college and university were very decent in my midst.

I remember the feeling of euphoria when I accidentally met Matlab by the will of a friend.

I just opened up a new world of accessible mathematics. Now I will share it with you.

Why do we need computer algebra systems at all?
Mathematics can bring physical suffering ,
well fall into a stupor at the sight of something more difficult than 2 * 2.

As mentioned earlier, Maxima is a free computer algebra system.
Maxima has a wide mathematical toolkit.
From simple arithmetic to symbolic or numerical calculations from the field of higher mathematics (differential equations, integrals, Laplace transforms, Taylor series, and so on ...)
Naturally, Maxima also knows how to build graphs.

Unlike the more venerable, demanding and powerful Matlab and MathCad.
Maxim is not demanding on resources, and most importantly, completely free.

Of course, the programs mentioned above fulfill the widest range of tasks,
I think there is no program that alone could replace all the functions offered by the full package of the same Matlab (with the included module of symbolic calculations), but we will now talk about the simplest calculations that can be useful to a student.

In addition, Maxima is more likely to be compared with Maple. The Internet claims that Maxima is an OpenSource analogue of Maple (Maybe it really is, but I can’t presume to say it because Maple was not seen in its pure form)

Naturally there is a version for both Windows and Linux systems.

Maxima is a console program, but there are various graphical interfaces to it. Perhaps the most common of them is WxMaxima.

Maxima is written in Common Lisp. People familiar with this language will find it easy to learn (and maybe even see how the program functions). In other matters, for people who do not know programming at all, mastering the basics of Maxima will also not cause great difficulties.

In order not to be unfounded I will give a simple example,

we introduce the following expression

diff (x ^ 3, x, 1) in Maxima ;

and as an answer we get the

first derivative 3 * x ^ 2.

All. The hateful derivative table (you probably had one) - you can no longer teach! The same is true for integrals: we introduce integrate (cos (x), x); we get: sin (x).

It will look like this:

How to do it:
Suppose your hands are burning, you just set a maxim and want to see at least some result:

in order to calculate the derivative, open WxMaxima.
Click on the empty white space with the left mouse button and copy or paste this diff formula (x ^ 3, x ,1); then press Control + Enter and you will get the calculations for this cell. It should be noted that in Maxima the cells depend on each other, for example, if you drove

(% i1) x: 2;

(% i2) x + 3;

And count by pressing control + Enter only in the second cell,
you will get
(% o2) x + 3;

because the value calculated in the previous cell is not yet known to the program.

Also, if you change the value in the cell (% i1) x: 2; for example, on (% i1) x: 4; Remember to recalculate the cell.

Although, of course, you can by pressing ctrl + R recount all the cells at once.

And the last piece of advice: Sometimes it is useful to nullify your hectic activity in Maxima by choosing Maxima-> restart maxima

And so I told you a little about Maxima and am ready to move on to the second part of the Article.

#### Part Two: Solving the system of linear equations in Maxima (the weightless bear problem)

Background:

Somehow on a cloudy autumn day, my colleague Drzugrik walked around the Internet and came across this link: nnm.ru/blogs/samovar1/pedagogi-rezvyatsya

Having wiped out, tears of joy and tenderness, we all together decided to solve one of the proposed this article tasks.

So here is the condition of the problem.
In general, the task was presented in a graphical way, but just in case, I will describe it in text, too: a

fox weighs as much as a hare and a weight of five kilograms taken together a
wolf weighs as much as a fox and a weight of four kilograms taken together a
hare and a fox weigh as much how much a wolf and a weight in one kilogram taken together a
bear weighs as much as a hare a fox and a wolf combined.

We started by creating systems of equations, but then our paths and most importantly the results “slightly” diverged.

What we just did not succeed:
and negative mass bears

and hare mutants weighing three times as much as a wolf

A colleague even sent this task to his friend - a teacher of elementary grades, but she also failed.

As a result, a man was found among us who could solve this problem.
But due to the fact that he was able to do this alone, the sediment remained and in order to dispel his doubts, I decided to call for help - a computer.

I suggest that you first try to find the answer to the problem manually, and only then look under the spoiler

To solve the problem, the following code was introduced in Maxima:
(% i1) eq1: lisa = zay + 5; eq2: lisa + 4 = volk; eq3: lisa + zay = volk + 1; eq4: medved = volk + lisa + zay;
(% o1) lisa = zay + 5
(% o2) lisa + 4 = volk
(% o3) zay + lisa = volk + 1
(% o4) medved = zay + volk + lisa

this is the input of our system of equations then the second line

(% i2) solve ([eq1, eq2, eq3, eq4], [zay, lisa, volk, medved]);
(% o5) [[zay = 5, lisa = 10, volk = 14, medved = 29]]

this is directly the solution of the equations

and the third line

(% i3) ev ([eq1, eq2, eq3, eq4], [%]) ;

this is a check of the solution by the substitution method

(% o6) [10 = 10.14 = 14.15 = 15.29 = 29]

Everything is quite simple.

So if you didn’t look under the spoiler, figured out the solution and want to check it, then you don’t even have to install Maxima on your computer. You can use the
WEB interface at maxima-online.org .

To run on the installed version of WxMaxima, the task file can be downloaded from the people:
narod.ru/disk/63475686001.9c996f295ea0a37cef0241e55a328799/%D0%B7%D0%B0%D0%B4%D0%B0%D1%87%D0%B0.wxm. html

Of the shortcomings of Maxima, perhaps I can single out a not very strong community in my opinion.
For example, the answer to my question on the inverse Laplace transform, I never found on the Internet.

Ps. I understand that in fact, many readers of Habr probably have a good knowledge of mathematics, so you can disagree with me that people in general do not know mathematics well and even wonder how we could find difficulties in such a simple task, but that's it - relatively. The people around me (and myself) do not very well own the “Queen of Sciences”, and most importantly, we make purely human errors by inattention. Therefore, I hope that this article will help people cope with at least the long-forgotten basics of mathematics.

upd: corrected grammatical errors thanks vasilisc kiselev_dv