# 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

### Fast/Flexible Linux OS Recovery

On Demand Now

In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.

Join *Linux Journal*'s Shawn Powers and David Huffman, President/CEO, Storix, Inc.

Free to *Linux Journal* readers.

Devuan Beta Release | May 03, 2016 |

May 2016 Issue of Linux Journal | May 02, 2016 |

May 2016 Video Preview | May 02, 2016 |

BitTorrent Inc.'s Sync | Apr 29, 2016 |

The Humble Hacker? | Apr 28, 2016 |

EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager | Apr 27, 2016 |

- Devuan Beta Release
- May 2016 Issue of Linux Journal
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The US Government and Open-Source Software
- The Humble Hacker?
- The Death of RoboVM
- BitTorrent Inc.'s Sync
- Open-Source Project Secretly Funded by CIA
- New Container Image Standard Promises More Portable Apps
- AdaCore's SPARK Pro

## Geek Guides

In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.

Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.

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.