# MuPAD

We will start our investigation of MuPAD with a mathematical classic:

>> 2+2; 4

Passed with flying colours! Now let's try some problems beyond the reach of your average hand-held calculator.

>> 3^(4^5); 37339184874102004353295975418486658822540977678373400775063693172207904061 72652512299936889388039772204687650654314751581087270545921608585813513369 82809187314191748594262580938807019951956404285571818041046681288797402925 51766801234061729839657473161915238672304623512593489605859058828465479354 05059362023765478074427305821445270589887562514528177934133521419207446230 27518729185432862375737063985485319476416926263819972887006907013899256524 297198527698749274196276811060702333710356481As you see, MuPAD has no fear about dealing with very large integers.

>> DIGITS:=1000:float(PI); 3.141592653589793238462643383279502884197169399375105820974944592307816406 28620899862803482534211706798214808651328230664709384460955058223172535940 81284811174502841027019385211055596446229489549303819644288109756659334461 28475648233786783165271201909145648566923460348610454326648213393607260249 14127372458700660631558817488152092096282925409171536436789259036001133053 05488204665213841469519415116094330572703657595919530921861173819326117931 05118548074462379962749567351885752724891227938183011949129833673362440656 64308602139494639522473719070217986094370277053921717629317675238467481846 76694051320005681271452635608277857713427577896091736371787214684409012249 53430146549585371050792279689258923542019956112129021960864034418159813629 77477130996051870721134999999837297804995105973173281609631859502445945534 69083026425223082533446850352619311881710100031378387528865875332083814206 17177669147303598253490428755468731159562863882353787593751957781857780532 171226806613001927876611195909216420199The value

**DIGITS**gives the number of significant digits when dealing with floating point values. Its default is 10, and it can be set to any value between 1 and 2^31 - 1.

>> DIGITS:=100:float(1/997); 0.001003009027081243731193580742226680040120361083249749247743229689067201 604814443329989969909729187562 >> 43^(1/5); 2.121747460841897852639905031079416833442447899377300135845506404964677379 294415637755003497680157377

The general command **solve** can be used to
solve equations of all types: algebraic, differential,
recurrence.

>> solve(x^2-4*x+3=0,x); {1, 3} >> sols:=solve(a*x^3+b*x^2+c*x+d=0,x):

We will suppress the output as it is rather long, but let's see what we can do with it:

>> op(sols,1); / 3 / 2 3 3 2 2 \1/2 \ | b c d b | d b c d c b d b c | | | ---- - --- - ----- + | ---- - ----- + ----- + ----- - ------ | |^(1/3) | 2 2 a 3 | 2 3 3 4 4 | | \ 6 a 27 a \ 4 a 6 a 27 a 27 a 108 a / / / 3 / 2 3 3 2 2 \ b | b c d b | d b c d c b d b c | - --- + | ---- - --- - ----- - | ---- - ----- + ----- + ----- - ------ | 3 a | 2 2 a 3 | 2 3 3 4 4 | \ 6 a 27 a \ 4 a 6 a 27 a 27 a 108 a / 1/2 \ | |^(1/3) | /The

**op**command picks out subexpressions; in this case, as the result is a three-element set, we have chosen its first element.

>> generate::TeX(%); "- \\frac{b}{3 a} + \\sqrt[3]{- \\frac{d}{2 a} + \\frac{b c}{6 a^2} - \\fr\ ac{b^3}{27 a^3} + \\sqrt{- \\frac{b c d}{6 a^3} + \\frac{d^2}{4 a^2} + \\f\ rac{c^3}{27 a^3} + \\frac{b^3 d}{27 a^4} - \\frac{b^2 c^2}{108 a^4}}} + \\\ sqrt[3]{- \\frac{d}{2 a} + \\frac{b c}{6 a^2} - \\frac{b^3}{27 a^3} - \\sq\ rt{- \\frac{b c d}{6 a^3} + \\frac{d^2}{4 a^2} + \\frac{c^3}{27 a^3} + \\f\ rac{b^3 d}{27 a^4} - \\frac{b^2 c^2}{108 a^4}}}"The

**TeX**command is one not automatically loaded when MuPAD is launched. To access it, we have to give its full address within MuPAD's libraries.

Here **%** refers to the output of the
previous command. This result can now be saved to a file:

>> fprint("solution.tex",%);

MuPAD can also solve systems of algebraic equations.

>> solve({x+2*y+a*z=-1,a*x-3*y+z=3,2*x-a*y-5*z=2},{x,y,z}); { { 2 2 2 } } { { a - a 3 a - 5 a - 19 11 a - 2 a + 19 } } { { z = --------------, x = ---------------, y = ---------------- } } { { 3 3 3 } } { { a - 17 a - 19 a - 17 a - 19 a - 17 a - 19 } }The above system, being linear, could have been solved equally well by using the

**linsolve**command.

## Trending Topics

## Webinar

### Practical Task Scheduling Deployment

July 20, 2016 12:00 pm CDT

One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.

Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.

Join *Linux Journal*'s Mike Diehl and Pat Cameron of Help Systems.

Free to *Linux Journal* readers.

SUSE LLC's SUSE Manager | Jul 21, 2016 |

My +1 Sword of Productivity | Jul 20, 2016 |

Non-Linux FOSS: Caffeine! | Jul 19, 2016 |

Murat Yener and Onur Dundar's Expert Android Studio (Wrox) | Jul 18, 2016 |

Rogue Wave Software's Zend Server | Jul 14, 2016 |

Webinar: Practical Task Scheduling Deployment | Jul 14, 2016 |

- SUSE LLC's SUSE Manager
- Returning Values from Bash Functions
- My +1 Sword of Productivity
- Tech Tip: Really Simple HTTP Server with Python
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- Rogue Wave Software's Zend Server
- Parsing an RSS News Feed with a Bash Script

## Geek Guides

With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.

This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.

Get the Guide
## Comments

## Sellout

Mupad has been bought out by mathworks and all code is now under matlab (junk) licence.

any and all open source work is now dead.

## Thankyou for a well written a

Thankyou for a well written article. TeXmacs acts as an excellent interface to mupad. I assume that the TeXmacs screen display generated by TeX. The graphics is generated by javaview. The combination of TeXmacs and javaview greatly enhance the mupad experience.