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

This page is set to execute \begin{axiom}... \end{axiom} commands using FriCAS. See also FriCASIntegration.

fricas
)version
Value = "FriCAS 1.3.7 compiled at Wed Jun 30 16:44:06 UTC 2021"

Any comments added here use this version of FriCAS.

fricas
solve(s=v*t+a*t^2/2,t)

\label{eq1}\left[{{{2 \  t \  v}+{a \ {{t}^{2}}}-{2 \  s}}= 0}\right](1)
Type: List(Equation(Fraction(Polynomial(Integer))))

fricas
radicalSolve(s=v*t+a*t^2/2,t)

\label{eq2}\left[{t ={{-{\sqrt{{{v}^{2}}+{2 \  a \  s}}}- v}\over a}}, \:{t ={{{\sqrt{{{v}^{2}}+{2 \  a \  s}}}- v}\over a}}\right](2)
Type: List(Equation(Expression(Integer)))

fricas
solve(v*t+a*t^2/2-s=0,t)

\label{eq3}\left[{{{2 \  t \  v}+{a \ {{t}^{2}}}-{2 \  s}}= 0}\right](3)
Type: List(Equation(Fraction(Polynomial(Integer))))

fricas
solve(v*t+a*t/2-s=0,t)

\label{eq4}\left[{t ={{2 \  s}\over{{2 \  v}+ a}}}\right](4)
Type: List(Equation(Fraction(Polynomial(Integer))))

fricas
solve(v*t+a*t^2/2-s=0,t)

\label{eq5}\left[{{{2 \  t \  v}+{a \ {{t}^{2}}}-{2 \  s}}= 0}\right](5)
Type: List(Equation(Fraction(Polynomial(Integer))))

fricas
radicalSolve(p^3 - p + 1/10=0,p)

\label{eq6}\begin{array}{@{}l}
\displaystyle
\left[{p ={{{{\left(-{3 \ {\sqrt{- 3}}}+ 3 \right)}\ {{\root{3}\of{{-{3 \ {\sqrt{3}}}+{\sqrt{-{373}}}}\over{{60}\ {\sqrt{3}}}}}^{2}}}- 2}\over{{\left({3 \ {\sqrt{- 3}}}+ 3 \right)}\ {\root{3}\of{{-{3 \ {\sqrt{3}}}+{\sqrt{-{373}}}}\over{{60}\ {\sqrt{3}}}}}}}}, \: \right.
\
\
\displaystyle
\left.{p ={{{{\left(-{3 \ {\sqrt{- 3}}}- 3 \right)}\ {{\root{3}\of{{-{3 \ {\sqrt{3}}}+{\sqrt{-{373}}}}\over{{60}\ {\sqrt{3}}}}}^{2}}}+ 2}\over{{\left({3 \ {\sqrt{- 3}}}- 3 \right)}\ {\root{3}\of{{-{3 \ {\sqrt{3}}}+{\sqrt{-{373}}}}\over{{60}\ {\sqrt{3}}}}}}}}, \: \right.
\
\
\displaystyle
\left.{p ={{{3 \ {{\root{3}\of{{-{3 \ {\sqrt{3}}}+{\sqrt{-{37
3}}}}\over{{60}\ {\sqrt{3}}}}}^{2}}}+ 1}\over{3 \ {\root{3}\of{{-{3 \ {\sqrt{3}}}+{\sqrt{-{373}}}}\over{{60}\ {\sqrt{3}}}}}}}}\right] (6)
Type: List(Equation(Expression(Integer)))

fricas
R1 ==> Record(foo1: String, remLexs: List Integer)
Type: Void
fricas
R2 ==> Record(foo2: String, remLexs: List Integer)
Type: Void
fricas
r1: R1 := ["a", [1,2,3]]

\label{eq7}\left[{foo 1 = \verb#"a"#}, \:{remLexs ={\left[ 1, \: 2, \: 3 \right]}}\right](7)
Type: Record(foo1: String,remLexs: List(Integer))
fricas
r2: R2 := ["b", [5]]

\label{eq8}\left[{foo 2 = \verb#"b"#}, \:{remLexs ={\left[ 5 \right]}}\right](8)
Type: Record(foo2: String,remLexs: List(Integer))
fricas
r1.remLexs

\label{eq9}\left[ 1, \: 2, \: 3 \right](9)
Type: List(Integer)
fricas
r2.remLexs

\label{eq10}\left[ 5 \right](10)
Type: List(Integer)

fricas
)set output tex off
 
fricas
)set output algebra on
guessPRec [1, 0, 1, 1, 4, 10, 35, 120, 455, 1792, 7413, 31780, 140833, 641928, 3000361, 14338702, 69902535, 346939792, 1750071307, 8958993507, 46484716684, 244187539270, 1297395375129, 6965930587924]
(13) [ [ f(n): 2 2 (- n - 17 n - 72)f(n + 3) + (4 n + 30 n + 44)f(n + 2) + 2 2 (19 n + 113 n + 150)f(n + 1) + (14 n + 42 n + 28)f(n) = 0 , f(0) = 1, f(1) = 0, f(2) = 1] ]
Type: List(Expression(Integer))

fricas
guessRec([1,1,0,1,- 1,2,- 1,5,- 4,29,- 13,854,- 685])
2 (14) [[f(n): f(n + 2) + f(n + 1) - f(n) = 0, f(0) = 1, f(1) = 1]]
Type: List(Expression(Integer))

integrate(exp(x-x^2), x) --mariuszi28cg, Mon, 25 Sep 2017 20:14:29 +0000 reply
fricas
integrate(exp(x-x^2), x)
1 - 4 2 x - 1 +---+ %e erf(-------)\|%pi 2 (15) --------------------- 2
Type: Union(Expression(Integer),...)

fricas
1+1
(16) 2
Type: PositiveInteger?

2^3-2**3

2^3

fricas
2^3
(17) 8
Type: PositiveInteger?

fricas
2**3
There are no library operations named ** Use HyperDoc Browse or issue )what op ** to learn if there is any operation containing " ** " in its name.
Cannot find a definition or applicable library operation named ** with argument type(s) PositiveInteger PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

fricas
sqrt(2)^2-2
(18) 0
Type: AlgebraicNumber?

fricas
a:=sqrt(2)
+-+ (19) \|2
Type: AlgebraicNumber?
fricas
b:=sqrt(a)
+----+ | +-+ (20) \|\|2
Type: AlgebraicNumber?
fricas
b^2-a
(21) 0
Type: AlgebraicNumber?

fricas
f(a) == { local b=sqrt(a); b^2-a}
Line 1: f(a) == { local b=sqrt(a); b^2-a} ........A........B Error A: Missing mate. Error B: syntax error at top level Error B: Possibly missing a } 3 error(s) parsing

local needs to be on separate statement:

fricas
f(a) == { local b; b :=sqrt(a); b^2-a}
Type: Void
fricas
f(2)
fricas
Compiling function f with type PositiveInteger -> AlgebraicNumber 
(23) 0
Type: AlgebraicNumber?
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
(24) 0
Type: AlgebraicNumber?

fricas
[q,r]
(25) [q, r]
Type: List(OrderedVariableList([q,r]))

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(2)
fricas
Compiling function f with type PositiveInteger -> AlgebraicNumber 
(27) 0
Type: AlgebraicNumber?
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
(28) 0
Type: AlgebraicNumber?

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(2)
fricas
Compiling function f with type PositiveInteger -> AlgebraicNumber 
(30) 0
Type: AlgebraicNumber?
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
(31) 0
Type: AlgebraicNumber?
fricas
f(z)
fricas
Compiling function f with type Variable(z) -> Expression(Integer) 
(32) 0
Type: Expression(Integer)
fricas
f(%i)
fricas
Compiling function f with type Complex(Integer) -> Expression(
      Complex(Integer)) 
(33) 0
Type: Expression(Complex(Integer))

)display properties --aUser, Thu, 01 Feb 2018 15:08:53 +0000 reply
fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(2)
fricas
Compiling function f with type PositiveInteger -> AlgebraicNumber 
(35) 0
Type: AlgebraicNumber?
fricas
c:=f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
(36) 0
Type: AlgebraicNumber?
fricas
)display properties c
Properties of c : Value (has type AlgebraicNumber): 0

fricas
f(a) == ( local b; b:=sqrt(a); b^2 = a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void

fricas
f(a) == ( local b; b:=sqrt(a); b^2 = a)
1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(2)
fricas
Compiling function f with type PositiveInteger -> Equation(
      AlgebraicNumber) 
(39) 2 = 2
Type: Equation(AlgebraicNumber?)
fricas
f(%i)
fricas
Compiling function f with type Complex(Integer) -> Equation(
      Expression(Complex(Integer))) 
(40) %i = %i
Type: Equation(Expression(Complex(Integer)))
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> Equation(
      AlgebraicNumber) 
+-+ +-+ (41) \|2 = \|2
Type: Equation(AlgebraicNumber?)
fricas
f(2^(1/2))
+-+ +-+ (42) \|2 = \|2
Type: Equation(AlgebraicNumber?)
fricas
f(2^(1/3))
3+-+ 3+-+ (43) \|2 = \|2
Type: Equation(AlgebraicNumber?)

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
(45) 0
Type: AlgebraicNumber?
fricas
)set output fortran
--------------------------- The fortran Option ----------------------------
Description: create output in FORTRAN format
)set output fortran is used to tell FriCAS to turn FORTRAN-style output printing on and off, and where to place the output. By default, the destination for the output is the screen but printing is turned off.
Syntax: )set output fortran <arg> where arg can be one of on turn FORTRAN printing on off turn FORTRAN printing off (default state) console send FORTRAN output to screen (default state) fp<.fe> send FORTRAN output to file with file prefix fp and file extension .fe. If not given, .fe defaults to .sfort.
If you wish to send the output to a file, you may need to issue this command twice: once with on and once with the file name. For example, to send FORTRAN output to the file polymer.sfort, issue the two commands
)set output fortran on )set output fortran polymer
The output is placed in the directory from which you invoked FriCAS or the one you set with the )cd system command. The current setting is: Off:CONSOLE f(sqrt(2))
(46) 0
Type: AlgebraicNumber?
fricas
)set output tex
----------------------------- The tex Option ------------------------------
Description: create output in TeX style
)set output tex is used to tell FriCAS to turn TeX-style output printing on and off, and where to place the output. By default, the destination for the output is the screen but printing is turned off.
Syntax: )set output tex <arg> where arg can be one of on turn TeX printing on off turn TeX printing off (default state) console send TeX output to screen (default state) fp<.fe> send TeX output to file with file prefix fp and file extension .fe. If not given, .fe defaults to .stex.
If you wish to send the output to a file, you may need to issue this command twice: once with on and once with the file name. For example, to send TeX output to the file polymer.stex, issue the two commands
)set output tex on )set output tex polymer
The output is placed in the directory from which you invoked FriCAS or the one you set with the )cd system command. The current setting is: Off:CONSOLE f(sqrt(2))
(47) 0
Type: AlgebraicNumber?
fricas
)set output script
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
f(sqrt(2))
(48) 0
Type: AlgebraicNumber?

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
(50) 0
Type: AlgebraicNumber?
fricas
)set output fortran on
f(sqrt(2))
R51=0
(51) 0
Type: AlgebraicNumber?
fricas
)set output tex on 
f(sqrt(2))
R52=0
(52) 0

\label{eq11}0(11)
Type: AlgebraicNumber?
fricas
)set output script on
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
Your value on is not among the valid choices.
f(sqrt(2))
R53=0
(53) 0

\label{eq12}0(12)
Type: AlgebraicNumber?

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
R55=0
(55) 0

\label{eq13}0(13)
Type: AlgebraicNumber?
fricas
)set output fortran console
f(sqrt(2))
R56=0
(56) 0

\label{eq14}0(14)
Type: AlgebraicNumber?
fricas
)set output tex console
f(sqrt(2))
R57=0
(57) 0

\label{eq15}0(15)
Type: AlgebraicNumber?
fricas
)set output script console
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
Your value console is not among the valid choices.
f(sqrt(2))
R58=0
(58) 0

\label{eq16}0(16)
Type: AlgebraicNumber?

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
R60=0
(60) 0

\label{eq17}0(17)
Type: AlgebraicNumber?
fricas
)set output fortran on
 
fricas
)set output fortran console
f(sqrt(2))
R61=0
(61) 0

\label{eq18}0(18)
Type: AlgebraicNumber?
fricas
)set output tex on 
 
fricas
)set output tex console
f(sqrt(2))
R62=0
(62) 0

\label{eq19}0(19)
Type: AlgebraicNumber?
fricas
)set output script on
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
Your value on is not among the valid choices.
fricas
)set output script console
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
Your value console is not among the valid choices.
f(sqrt(2))
R63=0
(63) 0

\label{eq20}0(20)
Type: AlgebraicNumber?

fricas
f(a) == ( local b; b:=sqrt(a); b^2-a)
Compiled code for f has been cleared. 1 old definition(s) deleted for function or rule f
Type: Void
fricas
f(sqrt(2))
fricas
Compiling function f with type AlgebraicNumber -> AlgebraicNumber 
R65=0
(65) 0

\label{eq21}0(21)
Type: AlgebraicNumber?
fricas
)set output fortran on
f(sqrt(2))
R66=0
(66) 0

\label{eq22}0(22)
Type: AlgebraicNumber?
fricas
)set output fortran off
 
fricas
)set output tex on 
f(sqrt(2))
(67) 0

\label{eq23}0(23)
Type: AlgebraicNumber?
fricas
)set output tex off
 
fricas
)set output script on
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
Your value on is not among the valid choices.
f(sqrt(2))
(68) 0
Type: AlgebraicNumber?
fricas
)set output script off
--------------------------- The scripts Option ----------------------------
Description: show subscripts,... linearly
The scripts option may be followed by any one of the following:
yes no
The current setting is indicated within the list.
Your value off is not among the valid choices.

((1+2)/3)::SquareMatrix?(3,Integer)

fricas
((1+2)/3)::SquareMatrix(3,Integer)
+1 0 0+ | | (69) |0 1 0| | | +0 0 1+
Type: SquareMatrix?(3,Integer)

fricas
((1+2)/3)::SquareMatrix(3,Integer)
+1 0 0+ | | (70) |0 1 0| | | +0 0 1+
Type: SquareMatrix?(3,Integer)

integrate(exp(x-x^2), x) --test int, Sun, 10 Jun 2018 12:51:40 +0000 reply
fricas
integrate((x+sin(x))^(1/2), x)
>> Error detected within library code: integrate: implementation incomplete (has polynomial part)

integrate(exp(x-x^2), x) --test int, Sun, 10 Jun 2018 12:52:12 +0000 reply
fricas
integrate((x+sin(x))^(1/2), x)
>> Error detected within library code: integrate: implementation incomplete (has polynomial part)

trying something difficult; see comments --h-x, Sat, 09 Nov 2019 02:31:34 +0000 reply
fricas
"";
  "Notice how the CAS computes the second (displayed) integral, while saying 'proved non-elementary' about the first one,";
  "despite the fact that the two are equal for any x in [-1..-1/sqrt(2)].";
  "My guess is that the system does not apply transformations that force additional restrictions on the function domain...";
  "Notice also how transforming the integrand into a form that the CAS can find an elementary antiderivative for requires";
  "quite some discipline in keeping track of the integrand domain, as well as using some not-so-obvious transfromations...";
  t:=sqrt(1-x*x);
  nume:=(acos(x)*t)^(-1);
  deno:=log(2*acos(x)/%pi);
  transformedDeno:=log(2+asin(2*x*t)/%pi);
  failedIntegral:=integrate(nume/transformedDeno,x);
  integrate(nume/deno, x)
2 acos(x) (71) - log(log(---------)) %pi
Type: Union(Expression(Integer),...)

Still no CAS knows if this one is elementary... Probably it is not, but a fun fact... --h-x, Sat, 09 Nov 2019 02:35:01 +0000 reply
fricas
integrate((x+sin(x))^(1/3),x)
>> Error detected within library code: integrate: implementation incomplete (has polynomial part)

Axiom is lying here, the example comes from Bronstein's tutorial, pp. 29-31 --h-x, Sun, 10 Nov 2019 09:26:19 +0000 reply
fricas
t:=x+log(x);
 nume:=(x^2+x+1)*sqrt(t)+(3*x+1)*log(x)+3*x*x+x;
 deno:=x*t*sqrt(t)+x*x*t;
 check:=integrate(nume/deno,x);
 differentiate(2*sqrt(t)+2*log(x+sqrt(t)), x)
2 +----------+ 2 (x + 2 x + 1)\|log(x) + x + (3 x + 1)log(x) + 3 x + x (72) -------------------------------------------------------- 2 +----------+ 2 3 (x log(x) + x )\|log(x) + x + x log(x) + x
Type: Expression(Integer)

No lie, compare:

fricas
nume - numer(differentiate(2*sqrt(t)+2*log(x+sqrt(t)), x))
+----------+ (73) - x\|log(x) + x
Type: Expression(Integer)

Still, shame that FriCAS can not do corrected example...

Axiom fails again, see Bronstein's Tutorial pp. 32-33 for details on this example --h-x, Sun, 10 Nov 2019 13:21:41 +0000 reply
fricas
nume:= 3*(x+exp(x))^(1/3)+(2*x*x+3*x)*exp(x)+5*x*x;
 deno:= x*(x+exp(x))^(1/3);
 "integrate(nume/deno, x)"
 (q:=nume/deno,  differentiate(3*x*(x+exp(x))^(2/3)+3*log(x), x))
(74) +-------+ 3| x 2 x 2 3 \|%e + x + (2 x + 3 x)%e + 5 x [-------------------------------------, +-------+ 3| x x\|%e + x +-------+ 3| x 2 x 2 3 \|%e + x + (2 x + 3 x)%e + 5 x -------------------------------------] +-------+ 3| x x\|%e + x
Type: Tuple(Expression(Integer))

fricas
)clear value t
integrate(sqrt(A-2*t*t/((1-t*t)^2))*2/(1+t*t), t)
(75) [ +---------+ \|- 4 A - 2 * log +------------------------+ | 4 2 3 +---------+ |A t + (- 2 A - 2)t + A 4 (2 t - 2 t)\|- 4 A - 2 |------------------------ + A t | 4 2 \| t - 2 t + 1 + 2 (- 6 A - 4)t + A / 4 2 t + 2 t + 1 + +------------------------+ | 4 2 2 |A t + (- 2 A - 2)t + A (t - 1) |------------------------ | 4 2 +-+ \| t - 2 t + 1 - 2 \|2 atan(-----------------------------------) +-+ t\|2 / 4 ,
+-------+ +-------+ t\|4 A + 2 - \|4 A + 2 atan(-----------------------------------) +------------------------+ | 4 2 2 |A t + (- 2 A - 2)t + A (t - 1) |------------------------ | 4 2 \| t - 2 t + 1 + +------------------------+ | 4 2 2 |A t + (- 2 A - 2)t + A (t - 1) |------------------------ | 4 2 +-+ \| t - 2 t + 1 - \|2 atan(-----------------------------------) +-+ t\|2 / 2 ]
Type: Union(List(Expression(Integer)),...)

fricas
integrate(x/sqrt(2*%pi)*exp(-1/2*log(x)^2),x=0..%plusInfinity)
2 +-+ +---+ %e \|2 \|%pi (76) ------------- +-----+ \|2 %pi
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
guess([3,6,9,12,15,18,21,24,27,30])
(77) [3 n + 3]
Type: List(Expression(Integer))




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