# 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

Contrast Security's Contrast Enterprise | Aug 30, 2016 |

illusive networks' Deceptions Everywhere | Aug 29, 2016 |

Happy Birthday Linux | Aug 25, 2016 |

ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs | Aug 24, 2016 |

Updates from LinuxCon and ContainerCon, Toronto, August 2016 | Aug 23, 2016 |

NVMe over Fabrics Support Coming to the Linux 4.8 Kernel | Aug 22, 2016 |

- Contrast Security's Contrast Enterprise
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- illusive networks' Deceptions Everywhere
- Happy Birthday Linux
- What I Wish I’d Known When I Was an Embedded Linux Newbie
- New Version of GParted
- ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs
- Tech Tip: Really Simple HTTP Server with Python
- Returning Values from Bash Functions
- All about printf

## 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.