c't magazin testsuite with MuPAD 1.3


Author: Frank Postel
Date  : 07. Aug. 1995
Format: dvi, postscript

Abstract

In c't 7 (1995), pp. 194-208, the capabilities of the Windows-versions of Derive, Mathplus, Macsyma, Maple and Mathematica were compared. The authors Stefan Braun and Harald Häuser (Visual Analysis, München, Fax-No.: +49-89-6258033) designed a testsuite which consists of 38 problems from different areas of mathematics. Derive was able to solve 20 problems, Mathplus could solve 8 problems, Macsyma 33 problems, Maple 36 problems and Mathematica suceeded in 32 problems.

In this note it is demonstrated how MuPAD 1.3 solves 33 problems of the testsuite and which problems MuPAD can't solve.

Contents

  1. Linear Algebra
  2. Simplify Expressions
  3. Solve Equations
  4. Series and Summations
  5. Limit Computation and Differentation
  6. Integration
  7. Laplace and Fourier Transformation
  8. Differential Equations
  9. Graphics

Initialize this part by loading the linalg library into MuPAD: loadlib("linalg");

    Linear Algebra

  1. Compute the invert of the 30x30 Hilbert matrix:
    >> MS:= SquareMatrix( 30,Rational ):
       H := MS( func(1/(i+j-1),i,j) ):
    >> iH:= H^(-1):
       iH[30,30];
    
        53338390370510951379337308012614400
    
  2. Compute the eigenvalues of the matrix
                 +-       -+
                 | a, 1, 0 |
                 | 1, 1, 1 |
                 | 1, 1, 2 |
                 +-       -+
    
    >> MExpr:= Matrix( ExpressionField(normal) ):
       A:= MExpr( [[a,1,0],[1,1,1],[1,1,2]] );
    
        +-       -+
        | a, 1, 0 |
        |         |
        | 1, 1, 1 |
        |         |
        | 1, 1, 2 |
        +-       -+
    
    >> le:= linalg::eigenValues( A ):
    
    The following outputs were cutted due to the long results:
    >> le[1];
    
        /                /    2    3  
        |          2     |   a    a   
        | - 3 a + a  + 9 | - -- + -- + ...
        \                \   6    27  
    
               1/2              2       3      4      1/2       \ 1/3 \
              3    (108 a - 90 a  + 32 a  - 5 a  - 81)          |     |
        ... + ------------------------------------------- + 1/2 |     |
                                  18                            /     /
    
    >> le[2];
    
        /                                                         
        |        2            1/2            1/2          2  1/2  
        | 3 a - a  + (- 9 I) 3    + (3 I) a 3    + (- I) a  3    + ...
        \                                                         
    
               1/2              2       3      4      1/2       \ 1/3 \
              3    (108 a - 90 a  + 32 a  - 5 a  - 81)          |     |
        ... + ------------------------------------------- + 1/2 |     |
                                  18                            /     /
    
    >> le[3];
    
        /                                                       
        |        2          1/2              1/2        2  1/2  
        | 3 a - a  + (9 I) 3    + (- 3 I) a 3    + (I) a  3    + ...
        \                                                       
    
               1/2              2       3      4      1/2       \ 1/3 \
              3    (108 a - 90 a  + 32 a  - 5 a  - 81)          |     |
        ... + ------------------------------------------- + 1/2 |     |
                                  18                            /     /
    

    Simplify Expressions

  3. Simplify the expression sqrt ( 9+4*sqrt(5) ) :
    >> radsimp( sqrt( 9+4*sqrt(5) ) );
    
         1/2    
        5    + 2
    
  4. Simplify the expression (sin(2x) - sin(x)cos(x)) / (cos(x)(1+tan(x)^2)) :
    >> e:= (sin(2*x) - sin(x)*cos(x))/(cos(x)*(1+tan(x)^2)):
       combine( normal(expand(e)), sincos );
       
        sin(x)   sin(3 x)
        ------ + --------
          4         4   
    
  5. Simplify the expression (e^x-1) / (e^(x/2)+1) :
    >> simplify( (exp(x) - 1)/(exp(x/2)+1),exp );
    
           / x \    
        exp| - | - 1
           \ 2 /    
    

    Solve Equations

  6. Solve the equation x^4 + ax^2 + 1 = 0 :
    >> solve( x^4 + a*x^2 + 1 = 0, x);
    
        --  1/2          2     1/2 1/2     1/2          2     1/2 1/2 
        |  2    (- a + (a  - 4)   )       2    (- a + (a  - 4)   )    
        |  ---------------------------, - ---------------------------,
        --              2                              2              
    
            1/2          2     1/2 1/2     1/2          2     1/2 1/2 --
           2    (- a - (a  - 4)   )       2    (- a - (a  - 4)   )     |
           ---------------------------, - ---------------------------  |
                        2                              2              --
    
  7. Solve the equation 2sin(x) + 5cos(x) = 3 :
    >> solve( 2*sin(x) + 5*cos(x) = 3, x );
    
      --                 /    1/2       \                  /  1/2       \ --
      |                  |   5          |                  | 5          |  |
      |  2 PI k1 + 2 atan| - ---- + 1/4 |, 2 PI k2 + 2 atan| ---- + 1/4 |  |
      --                 \    4         /                  \  4         / --
    
  8. Solve the equation e^(2x) + e^x - 1 = 0 :
    >> solve( exp(2*x) + exp(x) - 1 = 0, x );
    
      --               /    1/2       \                /  1/2       \ --
      |                |   5          |                | 5          |  |
      |  2 I PI k3 + ln| - ---- - 1/2 |, 2 I PI k4 + ln| ---- - 1/2 |  |
      --               \    2         /                \  2         / --
    
  9. Solve the system
                  x*y^2 + 2*c + x*z = 1
                  x*y   - x^2 + 2*z = 0
                  x*y   - z         = 0
    
    >> solve( {x*y^2+2*c+x*z=1, x*y-x^2+2*z=0, x*y-z=0}, {x,y,z} );
    
        -- --             2                                 -- --
        |  |      x      x                        3          |  |
        |  |  y = -, z = --, x = RootOf(18 c + 4 x  - 9, x)  |  |
        -- --     3      3                                  -- --
    

    Series and Summations

  10. Compute the Taylor series of cosh(x) / sinh(x)-1/x at x=0 :
    >> s:= series( cosh(x)/sinh(x)-1/x,x,5 );
    
        x      3
        - + O(x )
        3    
        
    >> testtype( s,Type::Series( Taylor ) );
    
        TRUE 
    
  11. Compute the Fourier series of x^3 with period 4 in (-2, 2) :
    Unable to do in MuPAD 1.3
    
  12. Compute the sum over 1 / (k^2+a^2) for k=1..infinity :
    >> sum( 1/(k^2+a^2), k=1..infinity );
    
        /                                                        
        |         2 1/2                  2 1/2              2 1/2
        | psi((- a )    + 1) - psi(- (- a )    + 1) + 2 (- a )   
        |                                                        
        \                                                        
    
               /               2 1/2                2 1/2                \ \
               | - psi(k + (- a )   ) + psi(k - (- a )   )               | |
          limit| -----------------------------------------, k = infinity | | /
               |                      2 1/2                              | |
               \                2 (- a )                                 / /
    
                     2 1/2 
          (2 (- a )   )     
    

    Limit Computation and Differentation

  13. Compute limit( (asinh((u+a)/b)-asinh((u-a)/b)), u=infinity ) with a>0 , b>0 :
    >> limit( asinh((u+a)/b) - asinh((u-a)/b), u=infinity );
    
        0
    
  14. Compute limit( e^(1/x^2) / (e^(1/x^2) + e^(1/x^4) , x=0 ) :
    >> limit( exp(1/x^2)/(exp(1/x^2)+exp(1/x^4)) , x=0 );
    
        0
    
  15. Compute the derivative of ( -1/5*x^2 + 1/5*x^2*tan(1/2*ln(x))^2 + 4/5*x^2*tan(1/2*ln(x)) ) / ( 1+tan(1/2*ln(x))^2 ) :
    >> diff( (-1/5*x^2 + 1/5*x^2*tan(1/2*ln(x))^2 + 4/5*x^2*tan(1/2*ln(x))) 
             / (1 + tan(1/2*ln(x))^2) , x );
    
        /                / ln(x) \          / ln(x) \2  
        |         8 x tan| ----- |   2 x tan| ----- |   
        |   2 x          \   2   /          \   2   /   
        | - --- + ---------------- + ----------------- + ...
        |    5           5                   5          
        |                                               
        \                                               
    
            /           2    / ln(x) \    2    / ln(x) \2 \ \  
            |    2   4 x  tan| ----- |   x  tan| ----- |  | |  
            |   x            \   2   /         \   2   /  | |  
        ... | - -- + ----------------- + ---------------- | | 
            \   5            5                  5         / /  
    
            /      / ln(x) \2 /    / ln(x) \2     \2 \
         /  | x cos| ----- |  | tan| ----- |  + 1 |  |
            \      \   2   /  \    \   2   /      /  /
    
    The output was cutted due to the long result.

  16. Compute y'' of sqrt (x^3+y(x)^3) + e^sin(y(x)) :
    Unable to do in MuPAD 1.3
    

    Integration

  17. Compute the integral of (2*x^4 + 1) / ((x^5+x)sqrt(x^4+1)) in x:
    >> int( (2*x^4 + 1)/((x^5+x)*sqrt(x^4+1)) , x );
    
           /          4              \
           |       2 x  + 1          |
        int| --------------------, x |
           |       5    4     1/2    |
           \ (x + x ) (x  + 1)       /
    
    As one can see, by now the integrator of MuPAD is not able to handle certain algebraic dependences of functions, but we hope that this will be implemented in a next MuPAD release.

  18. Compute the integral of e^(-x)sin(x)cos(x) in x :
    >> int( exp(-x)*sin(x)*cos(x) , x );
    
          cos(2 x)   sin(2 x) 
        - -------- - ---------
          5 exp(x)   10 exp(x)
    
  19. Compute the integral over x^3 / (e^x+1) for x=0..infinity :
    >> int( x^3/(exp(x)+1), x=0..infinity );
    
             4
         7 PI 
         -----
          120 
    
  20. Compute the integral over ln(x)^2 / sqrt(1-x^2) for x=0..1 :
    >> int( ln(x)^2/sqrt(1-x^2), x=0..1 );
    
           3           2
         PI    PI ln(2) 
         --- + ---------
         24        2    
    

    Laplace and Fourier Transformation

  21. Compute the Laplace transformation of sin(t) :
    >> laplace( sin(t), t, s );
    
           1   
         ------
          2    
         s  + 1
    
  22. Compute the inverse Laplace transformation of the result above :
    >> ilaplace( %, s, t );
    
         sin(t)
    
  23. Compute the Laplace transformation of heaviside(t-2)sin(t) :
    >> laplace( heaviside(t-2) * sin(t), t, s );
    
                    / cos(2)   s sin(2) \
         exp(- 2 s) | ------ + -------- |
                    |  2         2      |
                    \ s  + 1    s  + 1  /
    
  24. Compute the inverse Laplace transformation of the result above :
    >> ilaplace( %, s, t );
    
         heaviside(t - 2) (cos(2) sin(t - 2) + sin(2) cos(t - 2))
    
    Use combine to get back the original function:
    >> combine(%,sincos);
    
         sin(t) heaviside(t - 2)
    
  25. Compute the Fourier transformation of e^(-t^2) :
    >> fourier( exp(-t^2),t,x );
    
                  /    2 \
           1/2    |   x  |
         PI    exp| - -- |
                  \   4  /
    
  26. Compute the inverse Fourier transformation of e^(-t^2) :
    >> ifourier( exp(-t^2),t,x );
    
            /    2 \
            |   x  |
         exp| - -- |
            \   4  /
         -----------
               1/2  
           2 PI     
    

    Differential Equations

    Initialize this part by loading the ode library into MuPAD : loadlib("ode");

  27. Solve the linearly differential equation x^2*y' - x*y = x*ln(x) :
    >> solve( ode( x^2*diff(y(x),x)-x*y(x) = x*ln(x) , y(x) ) );
    
        [C1 x - ln(x) - 1]
    
  28. Solve the differential equation y' - y^2 - 3y + 4 = 0 :
    >> solve( ode(diff(y(x),x) - y(x)^2 - 3*y(x) + 4 = 0, y(x)) );
    
        --             /            ln(y - 1)   ln(y + 4)        \ --
        |  -4, 1, solve| - C2 - x + --------- - --------- = 0, y |  |
        --             \                5           5            / --
    
  29. Solve the linearly differential equation y'' - 4 y = sin(x) :
    >> solve( ode( diff(y(x),x$2) - 4*y(x) = sin(x) , y(x)) );
    
        --   sin(x)                               --
        |  - ------ + C3 exp(2 x) + C4 exp(- 2 x)  |
        --     5                                  --
    
  30. Solve the differential equation y'' - 2 / x*y' + 3 / x^2*y = 2*x - 1 :
    >> solve( ode( diff(y(x),x$2) - 2/x*diff(y(x),x) + 3/x^2*y(x) 
                   = 2*x - 1, y(x) ) );
    
     --           3              /        1/2 \              /        1/2 \ --
     |     2   2 x        3/2    | ln(x) 3    |       3/2    | ln(x) 3    |  |
     |  - x  + ---- + C2 x    cos| ---------- | + C3 x    sin| ---------- |  |
     --         3                \     2      /              \     2      / --
    
  31. Solve the equation 8*y'' + 9*(y')^4 = 0 :
    >> solve( ode( 8*diff(y(x),x$2) + 9*diff(y(x),x)^4 = 0, y(x) ) );
    
        --          / /          9 y \1/2 /   16 C5   2 y \             \ --
        |  C6, solve| | - 2 C5 + --- |    | - ----- + --- | = x + C7, y |  |
        --          \ \           4  /    \    27      3  /             / --
    
  32. Solve the differential equation 4*y'''' - 12*y''' + 11*y'' - 3*y' = 4 cos(x) :
    >> solve( ode(  4*diff(y(x),x$4) - 12*diff(y(x),x$3) + 
                   11*diff(y(x),x$2) -  3*diff(y(x),x) = 4*cos(x) , y(x) ) );
    
        --      14 cos(x)   18 sin(x)                      / 3 x \
        |  C8 - --------- + --------- + C10 exp(x) + C9 exp| --- |
        --         65          65                          \  2  /
    
                    / x \ --
           + C11 exp| - |  |
                    \ 2 / --
    
  33. Solve the system of differential equations of order 1
                  x' - x + y' + 2 y = 1 + e^t 
                  y' + 2 y + z' + z = 2 + e^t 
                  x' - x + z' + z   = 3 + e^t
    
    >> solve( ode(
       { diff(x(t),t) - x(t)   + diff(y(t),t) + 2*y(t) = 1+exp(t),
         diff(y(t),t) + 2*y(t) + diff(z(t),t) + z(t)   = 2+exp(t),
         diff(x(t),t) - x(t)   + diff(z(t),t) + z(t)   = 3+exp(t) },
         {x(t), y(t), z(t)} ) );
    
        -- --        t exp(t)                  
        |  |  x(t) = -------- + C12 exp(t) - 1,
        |  |            2                      
        -- --                                  
    
                     exp(t)     C13           exp(t)    C14       -- --
              y(t) = ------ + -------, z(t) = ------ + ------ + 2  |  |
                       6            2           4      exp(t)      |  |
                              exp(t)                              -- --
    

    Graphics

    Initialize this part by loading the plotlib library into MuPAD and export all their functions: loadlib("plotlib"); export( plotlib );

  34. Plot the function cosh(x) / (sinh(x) - 1/x) for x = 0 .. 5 :
    Unable to do in MuPAD 1.3
    
    In the current version of MuPAD, the plot command can not handle singularities, therefore a plot of this function would only be possible for the interval (0,5].

  35. Plot the implicit function T(x,y):= x e^y - y e^(-x) = 1 for x,y = -4 .. 4 :
    >> implicitplot( fun(args(1)*exp(args(2))-args(2)*exp(-args(1)) - 1) , 
                     -4..4, -4..4, 7 );
                        
    show image
    
  36. Plot the function x^2*cos(y) + sin(x) for x,y = -4 .. 4 :
    >> plot3d( Scaling=UnConstrained,
               [ Mode=Surface,[u, v, u^2*cos(v) + sin(u)],
                 u=[-4.0,4.0],v=[-4.0,4.0],
                 Color=[Height,[0.996109,0.164050,0.0], [0.992203,0.996109,0.0]],
                 Style=[ColorPatches,AndMesh]
               ] );
    
    show image
    
  37. Plot the high surfaces of z(x,y) := x^2*cos(y)+sin(x) for x,y = -4 .. 4 :
    Unable to do in MuPAD 1.3
    
  38. Plot the vector field of [-y^2,x^2] for x,y = -4 .. 4 :
    >> fieldplot( Axes = Origin, [ [-y^2, x^2], x = [-4, 4], y = [-4, 4], 
                  Grid = [30, 30] ] );
    
    show image
    

Converted and installed by: MuPAD-Webmaster
Last updated: 10. Jan. 1996