<?xml version="1.0" encoding="utf-8" standalone="no"?><?xml-stylesheet href="/mathmlc2p.xsl" type="text/xsl"?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>overview</title>
</head>
<body>
<tt>
import jscl.math.Generic;<br/>
static import jscl.math.Predef.*;<br/>
<br/>
manager = new javax.script.ScriptEngineManager();<br/>
engine = manager.getEngineByName(&quot;jscl&quot;);<br/>
importObject(engine);<br/>
<br/>
x = variable(&quot;x&quot;);<br/>
y = variable(&quot;y&quot;);<br/>
<br/>
assert(eval(&quot;groebner({x^2 + y^2 - 4, x*y - 1}, {x, y})&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><vector><apply><plus/><apply><minus/><cn>1</cn><apply><times/><cn>4</cn><apply><power/><ci>x</ci><cn>2</cn></apply></apply></apply><apply><power/><ci>x</ci><cn>4</cn></apply></apply><apply><minus/><apply><minus/><apply><times/><cn>4</cn><ci>x</ci></apply><apply><power/><ci>x</ci><cn>3</cn></apply></apply><ci>y</ci></apply></vector></math>));<br/>
<br/>
a = matrix(&quot;a&quot;, 2);<br/>
b = vector(&quot;b&quot;, 2);<br/>
x = vector(&quot;x&quot;, 2);<br/>
<br/>
assert(eval(&quot;matrix({{a[0][0], a[0][1]},&quot;+<br/>
                    &quot;{a[1][0], a[1][1]}}, {x[0],&quot;+<br/>
                                          &quot;x[1]})-{b[0],&quot;+<br/>
                                                  &quot;b[1]}&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><vector><apply><plus/><apply><plus/><apply><minus/><ci><msub><mi>b</mi><mrow><cn>0</cn></mrow></msub></ci></apply><apply><times/><ci><msub><mi>a</mi><mrow><cn>0</cn><cn>0</cn></mrow></msub></ci><ci><msub><mi>x</mi><mrow><cn>0</cn></mrow></msub></ci></apply></apply><apply><times/><ci><msub><mi>a</mi><mrow><cn>0</cn><cn>1</cn></mrow></msub></ci><ci><msub><mi>x</mi><mrow><cn>1</cn></mrow></msub></ci></apply></apply><apply><plus/><apply><plus/><apply><minus/><ci><msub><mi>b</mi><mrow><cn>1</cn></mrow></msub></ci></apply><apply><times/><ci><msub><mi>a</mi><mrow><cn>1</cn><cn>0</cn></mrow></msub></ci><ci><msub><mi>x</mi><mrow><cn>0</cn></mrow></msub></ci></apply></apply><apply><times/><ci><msub><mi>a</mi><mrow><cn>1</cn><cn>1</cn></mrow></msub></ci><ci><msub><mi>x</mi><mrow><cn>1</cn></mrow></msub></ci></apply></apply></vector></math>));<br/>
<br/>
a = variable(&quot;a&quot;);<br/>
b = variable(&quot;b&quot;);<br/>
c = variable(&quot;c&quot;);<br/>
x = variable(&quot;x&quot;);<br/>
<br/>
assert(eval(&quot;solve(c+b*x+a*x^2,x)&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><ci><msub><mi>root</mi><mrow><cn>0</cn></mrow></msub></ci><ci>c</ci><ci>b</ci><ci>a</ci></apply></math>));<br/>
<br/>
assert(eval(&quot;subst(1/x^2,x,a)&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><divide/><cn>1</cn><apply><power/><ci>a</ci><cn>2</cn></apply></apply></math>));<br/>
<br/>
assert(eval(&quot;simplify(exp(sqrt(-1)*pi))&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><cn>-1</cn></math>));<br/>
<br/>
assert(eval(&quot;simplify(elementary(cos(x)^2+sin(x)^2))&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><cn>1</cn></math>));<br/>
<br/>
assert(eval(&quot;numeric(exp(1))&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><cn type="real">2.718281828459045</cn></math>));<br/>
<br/>
f = function(&quot;f&quot;, 0);<br/>
f_ = function(&quot;f&quot;, 1);<br/>
<br/>
assert(eval(&quot;d(cos(f(x)),x)&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><minus/><apply><times/><apply><ci><msup><mi>f</mi><mrow><mo>&#x02032;</mo></mrow></msup></ci><ci>x</ci></apply><apply><sin/><apply><ci>f</ci><ci>x</ci></apply></apply></apply></apply></math>));<br/>
<br/>
z = variable(&quot;z&quot;);<br/>
f = function(&quot;f&quot;, new int[] {0,0,0});<br/>
f_1_0_0 = function(&quot;f&quot;, new int[] {1,0,0});<br/>
f_0_1_0 = function(&quot;f&quot;, new int[] {0,1,0});<br/>
f_0_0_1 = function(&quot;f&quot;, new int[] {0,0,1});<br/>
<br/>
assert(eval(&quot;curl(grad(f(x,y,z),{x,y,z}),{x,y,z})&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><vector><cn>0</cn><cn>0</cn><cn>0</cn></vector></math>));<br/>
<br/>
assert(eval(&quot;taylor(exp(x),x,0,4)&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><plus/><apply><plus/><apply><plus/><apply><plus/><cn>1</cn><ci>x</ci></apply><apply><times/><apply><divide/><cn>1</cn><cn>2</cn></apply><apply><power/><ci>x</ci><cn>2</cn></apply></apply></apply><apply><times/><apply><divide/><cn>1</cn><cn>6</cn></apply><apply><power/><ci>x</ci><cn>3</cn></apply></apply></apply><apply><times/><apply><divide/><cn>1</cn><cn>24</cn></apply><apply><power/><ci>x</ci><cn>4</cn></apply></apply></apply></math>));<br/>
<br/>
assert(eval(&quot;integral(1/(1+x^2),x)&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><plus/><apply><times/><apply><ci><msub><mi>root</mi><mrow><cn>0</cn></mrow></msub></ci><cn>1</cn><cn>0</cn><cn>4</cn></apply><apply><ln/><apply><minus/><cn>1</cn><apply><times/><cn>2</cn><apply><times/><ci>x</ci><apply><ci><msub><mi>root</mi><mrow><cn>0</cn></mrow></msub></ci><cn>1</cn><cn>0</cn><cn>4</cn></apply></apply></apply></apply></apply></apply><apply><times/><apply><ci><msub><mi>root</mi><mrow><cn>1</cn></mrow></msub></ci><cn>1</cn><cn>0</cn><cn>4</cn></apply><apply><ln/><apply><minus/><cn>1</cn><apply><times/><cn>2</cn><apply><times/><ci>x</ci><apply><ci><msub><mi>root</mi><mrow><cn>1</cn></mrow></msub></ci><cn>1</cn><cn>0</cn><cn>4</cn></apply></apply></apply></apply></apply></apply></apply></math>));<br/>
<br/>
assert(eval(&quot;quote(integral(1/(1+x^2),x))&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><int/><bvar><ci>x</ci></bvar><apply><divide/><cn>1</cn><apply><plus/><cn>1</cn><apply><power/><ci>x</ci><cn>2</cn></apply></apply></apply></apply></math>));<br/>
<br/>
man = variable(&quot;man&quot;);<br/>
mortal = variable(&quot;mortal&quot;);<br/>
sokrates = variable(&quot;sokrates&quot;);<br/>
<br/>
assert(eval(&quot;groebner({sokrates*(1+man), man*(1+mortal)}, {man, mortal, sokrates}, lex, 2)&quot;)<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><vector><apply><plus/><ci>man</ci><apply><times/><ci>man</ci><ci>mortal</ci></apply></apply><apply><plus/><ci>sokrates</ci><apply><times/><ci>man</ci><ci>sokrates</ci></apply></apply><apply><plus/><ci>sokrates</ci><apply><times/><ci>mortal</ci><ci>sokrates</ci></apply></apply></vector></math>));<br/>
<br/>
assert(eval(&quot;factorize(sokrates+mortal*sokrates)&quot;).expand()<br/>
.equals(<math xmlns="http://www.w3.org/1998/Math/MathML"><apply><times/><ci>sokrates</ci><apply><plus/><cn>1</cn><ci>mortal</ci></apply></apply></math>));<br/>
</tt>
</body>
</html>
