login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Appendix B  Examples

Polynomials, rational functions:

coeff(X**3 + 3*X**2*Y + 3*X*Y**2 + Y**3,x);
reduce
\displaylines{\qdd
\{y^{3}\co 3\cdot y^{2}\co 3\cdot y\co 1
\}
\cr}
 
gcd(X**2 + 4*X + 3,X**2 - 2*X - 3);
reduce
\displaylines{\qdd
x
+1
\cr}
 
resultant(X**2 + 4*X + 3,X**2 - 2*X - 3,x);
reduce
\displaylines{\qdd
0
\cr}
 
decompose(x**6+6x**4+x**3+9x**2+3x-5);
reduce
\displaylines{\qdd
\{u^{2}
  +u
  -5\co u=
  \[x^{3}
    +3\cdot x
   
factorize(x**6+6x**4+x**3+9x**2+3x);
reduce
\displaylines{\qdd
\{\{x^{3}
    +3\cdot x
    +1\co 1
  \}
  \co 
  \{x^{2}
    +3\co 1
  \}
  \co 
  \{x\co 1
  \}
\}
\cr}
 
roots(x**6+6x**4+x**3+9x**2+3x-5);
reduce
\displaylines{\qdd
\{x=
  \[-0.775167
   
interpol({0,7,26,63},z,{1,2,3,4});
reduce
\displaylines{\qdd
z^{3}
-1
\cr}
 

partial fraction decomposition:

pf(2/((x+1)^2*(x+2)),x);
reduce
\displaylines{\qdd
\{\frac{2}{
        x
        +2}\co 
  \frac{-2}{
        x
        +1}\co 
  \frac{2}{
        x^{2}
        +2\cdot x
        +1}
\}
\cr}
 

Matrices:

m:=mat((1,x),(2,y));
reduce
\displaylines{\qdd
m:=
\[\pmatrix{1&x\cr 
           2&y\cr 
           }
 
1/m;
reduce
\displaylines{\qdd
\pmatrix{\frac{-y}{
               2\cdot x
               -y}
         &
         \frac{x}{
               2\cdot x
               -y}\cr 
         \frac{2}{
               2\cdot x
               -y}&
         \frac{-1}{
               2\cdot x
               -y}\cr 
         }
\Nl}
 
det m;
reduce
\displaylines{\qdd
-2\cdot x
+y
\cr}
 

Ordinary differential equations:

load odesolve;
odesolve(df(y(x),x)=y(x)+x**2+2,y(x),x);
*** y declared operator
reduce
\displaylines{\qdd
\{y
  \(x
   

Linear system (hidden):

solve({(a*x+y)/(z-1)-3,y+b+z,x-y},
      {x,y,z});
reduce
\displaylines{\qdd
\{\{x=
    \[\frac{-3\cdot 
            \(b
              +1
             

Transcendental equations:

solve(a**(2*x)-3*a**x+2,x);
reduce
\displaylines{\qdd
\{x=
  \[\frac{2\cdot arbint
          \(2
           

Polynomial systems:

solve(
 { a*c1 - b*c1**2 - g*c1*c2 + e*c3,
   -g*c1*c2 + (e+t)*c3 -k*c2,
   g*c1*c2 + k*c2 - (e+t) * c3},
  {c3,c2,c1});
reduce
\displaylines{\qdd
\{\{c_{3}=
    \[\frac{c_{1}\cdot 
            \(-c_{1}^{2}\cdot b\cdot g
              +c_{1}\cdot a\cdot g
              -c_{1}\cdot b\cdot k
              +a\cdot k
             

Structural analysis:

load_package compact;
compact(s*(1-(sin x**2)) +c*(1-(cos x)**2) +(sin x)**2+(cos x)**2, {cos x^2+sin x^2=1});
reduce
\displaylines{\qdd
\cos 
\(x
 

Calculus:

df(exp(x**2)/x,x,2);
reduce
\displaylines{\qdd
\frac{2\cdot e^{x^{2}}\cdot 
      \(2\cdot x^{4}
        -x^{2}
        +1
       
int(x^3*exp(2x),x);
reduce
\displaylines{\qdd
\frac{e^{2\cdot x}\cdot 
      \(4\cdot x^{3}
        -6\cdot x^{2}
        +6\cdot x
        -3
       
limit(x*sin(1/x),x,infinity);
reduce
\displaylines{\qdd
1
\cr}
 

Series:

on rounded;
taylor(sin(x+1),x,0,4);
reduce
\displaylines{\qdd
0.841470984808
+0.540302305868\cdot x
-0.420735492404\cdot x^{2}\nl 
-0.0900503843114\cdot x^{3}
+0.0350612910337\cdot x^{4}
+O
\(x^{5}
 
sum(n,n);
reduce
\displaylines{\qdd
0.5\cdot n\cdot 
\(n
  +1
 
prod(n/(n+2),n);
reduce
\displaylines{\qdd
\frac{2}{
      n^{2}
      +3\cdot n
      +2}
\cr}
 

Complex numbers:

w:=(x+3*i)**2;
reduce
\displaylines{\qdd
w:=
\[6\cdot i\cdot x
  +x^{2}
  -9
 

Rounded numbers:

precision 25;
reduce
\displaylines{\qdd
12
\cr}
 
pi**2;
reduce
\displaylines{\qdd
9.869604401089358618834491
\cr}
 

Modular numbers:

on modular;
*** Domain mode rounded changed to modular
setmod 17;
reduce
\displaylines{\qdd
1
\cr}
 
(x-1)**2;
reduce
\displaylines{\qdd
x^{2}
+15\cdot x
+1
\cr}
 
factorize ws;
reduce
\displaylines{\qdd
\{\{x
    +16\co 2
  \}
\}
\cr}
 




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: