CAS | Science @ Science @ MentDB Weak
Computer algebra (CAS)
• Computer algebra system: exact integrals, equations, differential equations, simplification, factorization, limits, series, with Symja (matheclipse, LGPL v3).
• Installation: copy the jars of org.matheclipse:matheclipse-core and of all its dependencies in the folder cas of the server (or the folder given by the Java property -Dmentdb.cas.dir=...). They are loaded in a separate class loader: no conflict with the other jars of the server. Then call cas status.
• The expressions use the syntax of MentDB (sin, ln, sqrt, pi, e, bessel_j, legendre...) and the results are written in this syntax, except cas eval (Symja syntax). The session variables [x] are not available: write the symbols (x, a, k).
• Time limit of a computation: 30 s (Java property -Dmentdb.cas.timeout=seconds). The access to the files from the expressions is disabled.
The exact form of a result can differ slightly with the version of Symja (order of the terms).
• Installation: copy the jars of org.matheclipse:matheclipse-core and of all its dependencies in the folder cas of the server (or the folder given by the Java property -Dmentdb.cas.dir=...). They are loaded in a separate class loader: no conflict with the other jars of the server. Then call cas status.
• The expressions use the syntax of MentDB (sin, ln, sqrt, pi, e, bessel_j, legendre...) and the results are written in this syntax, except cas eval (Symja syntax). The session variables [x] are not available: write the symbols (x, a, k).
• Time limit of a computation: 30 s (Java property -Dmentdb.cas.timeout=seconds). The access to the files from the expressions is disabled.
The exact form of a result can differ slightly with the version of Symja (order of the terms).
cas statuscas integrate <expression> <variable>cas integrate <expression> <variable> <a> <b>cas solve <equations> <variables>cas dsolve <equations> <function> <variable>cas simplify <expression>cas expand <expression>cas factor <expression>cas limit <expression> <variable> <a>cas series <expression> <variable> <a> <n>cas eval <expression>
cas status
Description
State of the CAS: folder of the jars, number of jars, installed or not (with the error), test Integrate(x^2, x)
State of the CAS: folder of the jars, number of jars, installed or not (with the error), test Integrate(x^2, x)
Examples (1)
admin
cas status
mentdb
{"installed": true, "folder": "/opt/mentdb/cas", "jars": 30, "test": "x^3/3", "timeout_seconds": 30}
cas integrate <expression> <variable>
Description
Primitive (indefinite integral) of an expression
Primitive (indefinite integral) of an expression
Parameters
expression: The expression (MentDB syntax: sin, ln, sqrt, pi, e, bessel_j...) - String - required
variable: The variable, ex: x - String - required
expression: The expression (MentDB syntax: sin, ln, sqrt, pi, e, bessel_j...) - String - required
variable: The variable, ex: x - String - required
Examples (2)
admin
cas integrate "x^2" "x"
mentdb
x^3/3
admin
cas integrate "1/x" "x"
mentdb
ln(x)
cas integrate <expression> <variable> <a> <b>
Description
Definite integral from a to b (exact when possible); the bounds can be expressions (pi, Infinity)
Definite integral from a to b (exact when possible); the bounds can be expressions (pi, Infinity)
Parameters
expression: The expression - String - required
variable: The variable - String - required
a: The lower bound (number or expression) - String - required
b: The upper bound (number or expression) - String - required
expression: The expression - String - required
variable: The variable - String - required
a: The lower bound (number or expression) - String - required
b: The upper bound (number or expression) - String - required
Examples (2)
admin
cas integrate "sin(x)" "x" 0 "pi"
mentdb
2
admin
cas integrate "x*e^(-x)" "x" 0 "Infinity"
mentdb
1
cas solve <equations> <variables>
Description
Solve exactly an equation or a system (a single = is an equation).
Returns a JSON array of solutions; an empty array when there is none
Solve exactly an equation or a system (a single = is an equation).
Returns a JSON array of solutions; an empty array when there is none
Parameters
equations: An equation, or a JSON array of equations - String - required
variables: A variable, or a JSON array of variables - String - required
equations: An equation, or a JSON array of equations - String - required
variables: A variable, or a JSON array of variables - String - required
Examples (2)
admin
cas solve "x^2 = 4" "x"
mentdb
[{"x": "-2"}, {"x": "2"}]
admin
cas solve "[\"x+y = 3\", \"x-y = 1\"]" "[\"x\", \"y\"]"
mentdb
[{"x": "2", "y": "1"}]
cas dsolve <equations> <function> <variable>
Description
Solve an ordinary differential equation (or a system): y'(x), y''(x); C(1), C(2) are the constants of integration.
Returns a JSON array of solutions
Solve an ordinary differential equation (or a system): y'(x), y''(x); C(1), C(2) are the constants of integration.
Returns a JSON array of solutions
Parameters
equations: An equation, or a JSON array of equations (with the initial conditions, ex: y(0) = 1) - String - required
function: The unknown function, ex: y - String - required
variable: The variable, ex: x - String - required
equations: An equation, or a JSON array of equations (with the initial conditions, ex: y(0) = 1) - String - required
function: The unknown function, ex: y - String - required
variable: The variable, ex: x - String - required
Examples (1)
admin
cas dsolve "y'(x) = y(x)" "y" "x"
mentdb
[{"y(x)": "e^x*C(1)"}]
cas simplify <expression>
Description
Simplify an expression (Symja FullSimplify, with the trigonometric identities)
Simplify an expression (Symja FullSimplify, with the trigonometric identities)
Parameters
expression: The expression - String - required
expression: The expression - String - required
Examples (1)
admin
cas simplify "sin(x)^2+cos(x)^2"
mentdb
1
cas expand <expression>
Description
Expand an expression (products and powers)
Expand an expression (products and powers)
Parameters
expression: The expression - String - required
expression: The expression - String - required
Examples (1)
admin
cas expand "(x+1)^2"
mentdb
1+2*x+x^2
cas factor <expression>
Description
Factor a polynomial
Factor a polynomial
Parameters
expression: The expression - String - required
expression: The expression - String - required
Examples (1)
admin
cas factor "x^2-1"
mentdb
(-1+x)*(1+x)
cas limit <expression> <variable> <a>
Description
Limit of an expression when the variable tends to a (a can be Infinity)
Limit of an expression when the variable tends to a (a can be Infinity)
Parameters
expression: The expression - String - required
variable: The variable - String - required
a: The point (number or expression) - String - required
expression: The expression - String - required
variable: The variable - String - required
a: The point (number or expression) - String - required
Examples (2)
admin
cas limit "sin(x)/x" "x" 0
mentdb
1
admin
cas limit "(1+1/n)^n" "n" "Infinity"
mentdb
e
cas series <expression> <variable> <a> <n>
Description
Taylor series of order n around a (the polynomial, without the O(x^n) term)
Taylor series of order n around a (the polynomial, without the O(x^n) term)
Parameters
expression: The expression - String - required
variable: The variable - String - required
a: The point - String - required
n: The order (0 to 50) - Number - required
expression: The expression - String - required
variable: The variable - String - required
a: The point - String - required
n: The order (0 to 50) - Number - required
Examples (1)
admin
cas series "sin(x)" "x" 0 5
mentdb
x-x^3/6+x^5/120
cas eval <expression>
Description
Any Symja expression, in the Symja syntax (result in the Symja syntax): D, Integrate, Solve, DSolve, Simplify, Factor, Series, Limit, Sum, Product, Det, Inverse, Eigenvalues... (https://symjaweb.appspot.com/)
Any Symja expression, in the Symja syntax (result in the Symja syntax): D, Integrate, Solve, DSolve, Simplify, Factor, Series, Limit, Sum, Product, Det, Inverse, Eigenvalues... (https://symjaweb.appspot.com/)
Parameters
expression: The Symja expression - String - required
expression: The Symja expression - String - required
Examples (2)
admin
cas eval "D(Sin(x)^2, x)"
mentdb
2*Cos(x)*Sin(x)
admin
cas eval "Sum(1/k^2, {k, 1, Infinity})"
mentdb
Pi^2/6
