Any good libre replacement for Wolfram Alpha?

4 risposte [Ultimo contenuto]
koszkonutek
Offline
Iscritto: 03/19/2020

I would like to have some libre computer algebra program capable of serving as a replacement to Wolfram Alpha that I could recommend to people.

I know of Maxima, but once I couldn't get it to solve the equation in the attachment. Either I didn't know how to operate Maxima properly or the equation is too hard for analytical solving or Maxima was not good enough...

Any suggestions?

AllegatoDimensione
Screenshot_2021-03-22_11-27-31.png14.11 KB
Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I very much doubt there exists any algebraic method to find the zero of that function. Plotting it (e.g., with plot2d in Maxima), one can see it admits a zero in [0, 1]. Solving numerically with Maxima:
$ maxima
Maxima 5.41.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) find_root(30*x*%e^-30 - 30*%e^(-11*x) + 1/(11*30) = 0, x, 0, 1);
(%o1) 0.8363900032134406

koszkonutek
Offline
Iscritto: 03/19/2020

> I very much doubt there exists any algebraic method
> to find the zero of that function.

That's what I would think. The weird thing is during a university course I was expected to use something like Wolfram Alpha to find the exact root in order to verify my own numerical solution against it. I even lost some points for not doing it (didn't affect the final grade).

Who knows? Maybe the professor made a mistake and gave me a function that's too hard?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I was expected to use something like Wolfram Alpha to find the exact root

I teach numerical analysis. Starting the chapter on root finding, I say: "raise your hand if you can solve x² = 2". Most of the students do. I ask one of them: "what is the positive solution of x² = 2 then?". He or she answers "the square root of 2". However, what is a square root of a number a? By definition, it is the positive number that, squared, equals a. So answering that the positive solution of x² = 2 is the square root of 2 is just repeating the question. It is not solving the equation. In Maxima, solve gives the same disappointing solution:
$ maxima
Maxima 5.41.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) solve(x^2 = 2);
(%o1) [x = - sqrt(2), x = sqrt(2)]

To really solve that equation, you need a root finding algorithm, after bracketing the root of interest, here between 1 and 2:
(%i2) find_root(x^2 = 2, x, 1, 2);
(%o2) 1.414213562373095

Here is a solution! Not repeating the problem! The solution is not exact indeed. The actual solution is an irrational number, with infinite decimals that never enter a cycle. We can get more decimals increasing the number of bits in the mantissa of the representations of the numbers in floating-point algorithmic, if the programming language natively allows it. We can even use a library that implements arbitrary precision arithmetic (at a high computational cost, compared to using a native type such as "double"), like GNU MP (for C or C++) or Boost (only for C++). Maxima, which is not used in applications such as numerical simulations where performance matters, has bf_find_root (where "bf" stands for "bigfloat"):
(%i3) bf_find_root(x^2 = 2, x, 1, 2);
(%o3) 1.414213562373095048801688724209698078569671875376948073176679738b0

We will never get the infinite decimals, the exact solution. They do not fit in the universe. But no real-world application needs the infinite decimals. Also, even if solutions expressed with square/cubic/... roots are considered acceptable, most of the equations cannot have their roots expressed in this way. Even the roots of an algebraic equation of degree 5 or more cannot, in the general case, be expressed in this way (a result from group theory). Numerical analysis is needed.

koszkonutek
Offline
Iscritto: 03/19/2020

Well, thank you for the lecture - some might use it to learn about numerical analysis.

The thing is - I have all the time been mostly aware of the theory you presented. When the professor told us to find the exact roots of our equations in order to verify our own numerical solutions, I correctly understood that by "exact" she meant "expressed in terms of square roots, cubic roots, complex numbers, etc.". Even though I knew such problem is not solvable in general, I assumed that if I am supposed to do it - then it is surely possible with that *particular* equation. Given my assumption that it is possible in this *particular* case and the fact Maxima couldn't do it - I suspected it's just not good enough. Yet, I was not 100% sure - as one might deduce from my first post.

So, in case anyone still has some computer algebra software recommendation - please share with us :)