Common Mistakes
last edited 17 years ago by kratt6

Edit detail for Common Mistakes revision 1 of 3

1 2 3
Editor: Bill Page
Time: 2007年09月13日 18:21:39 GMT-7
Note:

changed:
-
1 Omitting the {axiom} enviroment
 You have to use !\begin{axiom} ... \end{axiom}
 or !\begin{reduce} ... \end{reduce} before and after the command
 like this::
 !\begin{reduce}
 int(1/(a+z^3), z);
 \end{reduce}
2 Axiom commands do not end with ;
 Oh yes, note that for Axiom you don't end the command with ; and
 the command for integration in Axiom is 'integrate'.
 \begin{axiom}
 integrate(1/(a+z^3), z)
 \end{axiom}
3 Reduce commands must end with a semicolon ;
 But it must be there for Reduce.
 \begin{reduce}
 r^2+r+1;
 \end{reduce}
4 In Axiom 'ln' is written 'log'
 This won't work::
 !\begin{axiom}integrate((x^2+2*x*ln(x)+5)/(sin(x^2+x^3-x^4)^2), x)\end{axiom}
 Put the !\begin{axiom} and \end{axiom} on separate lines and
 notice that in Axiom 'ln' is written 'log'
 \begin{axiom}
 integrate((x^2+2*x*log(x)+5)/(sin(x^2+x^3-x^4)^2), x)
 \end{axiom}
5 Don't put a \\ in front of the axiom command
 This is wrong::
 !\begin{axiom}
 \sqrt{49/100}
 \end{axiom}
 Begin each comment with an explanation. Don't put \\ in front of the Axiom command.
 Do it like this::
 Some explanation
 !\begin{axiom}
 sqrt{49/100}
 \end{axiom}
 Some explanation
 \begin{axiom}
 sqrt{49/100}
 \end{axiom}
6 No \$ before and after
 This is wrong::
 !\begin{axiom}
 \$ \\sqrt{49/100} \$
 \end{axiom}
 Don't put \$ before and after \$ and there is no \\ in front.
 Just do it like this::
 !\begin{axiom}
 sqrt{49/100}
 \end{axiom}
 and what you will see is this:
 \begin{axiom}
 sqrt{49/100}
 \end{axiom}
7 Axiom sometimes interprets commands in unexpected ways
 This command appears to work
 \begin{axiom}
 integrate(x^5 ln[x],x)
 \end{axiom}
 But notice that
 \begin{axiom}
 5 ln[x]
 \end{axiom}
 is something strange. Oddly perhaps, Axiom interprets '5' as a
 UnivariatePolynomial and 'ln![x]' as a subscripted Symbol and the
 result is a univariate polynomial in the variable 'ln![x]'.
 So perhaps what you meant to write was:
 \begin{axiom}
 integrate(x^5*log(x),x)
 \end{axiom}
8 Use braces not parenthesis after 'begin' and 'end'
 The command::
 \begin(axiom)
 integrate(sin(x))
 \end(axiom)
 wont work.
 Use "braces" like this { } not parenthesis ( ) around {axiom}.
 Finally, unless the expression is a univariate polynomial, then you must also
 specify the variable with which to integrate.
 \begin{axiom}
 integrate(sin(x),x)
 \end{axiom}
9 Use parenthesis not braces in Axiom commands
 This command::
 !\begin{axiom}
 solve{xy=1,x}
 \end{axiom}
 uses {} after the solve operation. This is syntactically correct but
 it probably doesn't do what you might expect.
 \begin{axiom}
 solve{xy=1,x}
 \end{axiom}
 In Axiom {...,...} is executed as a block of commands which
 returns the result of the last command in the sequence. Compare
 \begin{axiom}
 a:={xy=1,x}
 \end{axiom}
 which is just 'x' to
 \begin{axiom}
 b:=(xy=1,x)
 \end{axiom}
 solve normally operates on such a *tuple* and
 \begin{axiom}
 c:=[xy=1,x]
 \end{axiom}
 which is a list and finally
 \begin{axiom}
 c:=set [xy=1,x]
 \end{axiom}
 which is how to construct a set.
 Also notice that multiplication must be written using *
 \begin{axiom}
 solve(x*y=1,x)
 \end{axiom}
10 Use %minusInfinity and %plusInfinity
 I'd like to see if Axiom can do my favorite definite integral::
 !\begin{axiom}
 integrate(x^4/(sinh(x))^2,x,-inf,inf)
 \end{axiom}
 In Axiom use %minusInfinity and %plusInfinity instead of -inf and inf.
 \begin{axiom}
 integrate(x^4/(sinh(x))^2,x=%minusInfinity..%plusInfinity)
 \end{axiom}
11 Numeric conversions
 The results of calculations depend on the type of the inputs
 You can tell Axiom that you would like the result expressed
 as a floating point number (if possible) using @. For example:
 \begin{axiom}
 asin(1/2)@Float
 \end{axiom}
12 Axiom prefers symbolic calculations
 The trig functions are expressed in radians so use $\pi/2$ instead
 90ドル$ and 34ドル\pi/180$ instead of 34ドル$. Finally, because Axiom
 prefers symbolic calculations express 1ドル.544$ as a rational number
 \begin{axiom}
 r:Fraction Integer:=1.544
 eq1:=90*%pi/180-asin(n*sin(34*%pi/180)/r)=asin(n/r)
 s:=solve(eq1,n)
 \end{axiom}
 Axiom thinks there are two solutions, unfortunately only one
 is valid:
 \begin{axiom}
 eval(eq1,s.1)::Equation Expression Float
 eval(eq1,s.2)::Equation Expression Float
 \end{axiom}
13 Reduce commands must end with a semicolon ;
 Like this
 \begin{reduce}
 r^2+r+1;
 \end{reduce}
14 Coercion is sometimes necessary
 For example
 \begin{axiom}
 integrate((4 - x**2)**.5::Expression Fraction Integer, x)
 \end{axiom}
15 Use either 'differentiate' or the abbreviation 'D'
 Since sin(x) cannot be interpreted as a univariate polynomial,
 you must specify the integration variable.
 \begin{axiom}
 differentiate(sin(x),x)
 \end{axiom}
16 MathAction requires that Axiom library code must beging with ')abbrev'. 
 Typing ')abb' is not enough even though that works in Axiom itself.

  1. Omitting the {axiom} enviroment

    You have to use \begin{axiom} ... \end{axiom} or \begin{reduce} ... \end{reduce} before and after the command like this:

     \begin{reduce}
     int(1/(a+z^3), z);
     \end{reduce}
    

  2. Axiom commands do not end with ;

    Oh yes, note that for Axiom you don't end the command with ; and the command for integration in Axiom is integrate.

    axiom
    integrate(1/(a+z^3), z)
    Type: Union(Expression Integer,...)

  3. Reduce commands must end with a semicolon ;

    But it must be there for Reduce.

    r^2+r+1;
    reduce
    LatexWiki Image

  4. In Axiom ln is written log

    This won't work:

     \begin{axiom}integrate((x^2+2*x*ln(x)+5)/(sin(x^2+x^3-x^4)^2), x)\end{axiom}
    

    Put the \begin{axiom} and \end{axiom} on separate lines and notice that in Axiom ln is written log

    axiom
    integrate((x^2+2*x*log(x)+5)/(sin(x^2+x^3-x^4)^2), x)
    Type: Union(Expression Integer,...)

  5. Don't put a \ in front of the axiom command

    This is wrong:

     \begin{axiom}
     \sqrt{49/100}
     \end{axiom}
    

    Begin each comment with an explanation. Don't put \ in front of the Axiom command.

    Do it like this:

     Some explanation
     \begin{axiom}
     sqrt{49/100}
     \end{axiom}
    

    Some explanation

    axiom
    sqrt{49/100}
    Type: AlgebraicNumber?

  6. No $ before and after

    This is wrong:

     \begin{axiom}
     $ \sqrt{49/100} $
     \end{axiom}
    

    Don't put $ before and after $ and there is no \ in front.

    Just do it like this:

     \begin{axiom}
     sqrt{49/100}
     \end{axiom}
    

    and what you will see is this:

    axiom
    sqrt{49/100}
    Type: AlgebraicNumber?

  7. Axiom sometimes interprets commands in unexpected ways

    This command appears to work

    axiom
    integrate(x^5 ln[x],x)
    Type: Union(Expression Integer,...)

    But notice that

    axiom
    5 ln[x]
    Type: UnivariatePolynomial?(*01ln x,Integer)

    is something strange. Oddly perhaps, Axiom interprets 5 as a UnivariatePolynomial? and 'ln[x]' as a subscripted Symbol and the result is a univariate polynomial in the variable 'ln[x]'.

    So perhaps what you meant to write was:

    axiom
    integrate(x^5*log(x),x)
    Type: Union(Expression Integer,...)

  8. Use braces not parenthesis after begin and end

    The command:

     \begin(axiom)
     integrate(sin(x))
     \end(axiom)
    

    wont work.

    Use "braces" like this { } not parenthesis ( ) around {axiom}.

    Finally, unless the expression is a univariate polynomial, then you must also specify the variable with which to integrate.

    axiom
    integrate(sin(x),x)
    Type: Union(Expression Integer,...)

  9. Use parenthesis not braces in Axiom commands

    This command:

     \begin{axiom}
     solve{xy=1,x}
     \end{axiom}
    

    uses {} after the solve operation. This is syntactically correct but it probably doesn't do what you might expect.

    axiom
    solve{xy=1,x}
    Type: List Equation Fraction Polynomial Integer

    In Axiom {...,...} is executed as a block of commands which returns the result of the last command in the sequence. Compare

    axiom
    a:={xy=1,x}
    Type: Variable x

    which is just x to

    axiom
    b:=(xy=1,x)
    Type: Tuple Any

    solve normally operates on such a tuple and

    axiom
    c:=[xy=1,x]
    Type: List Any

    which is a list and finally

    axiom
    c:=set [xy=1,x]
    Type: Set Any

    which is how to construct a set.

    Also notice that multiplication must be written using *

    axiom
    solve(x*y=1,x)
    Type: List Equation Fraction Polynomial Integer

  10. Use %minusInfinity and %plusInfinity

    I'd like to see if Axiom can do my favorite definite integral:

     \begin{axiom}
     integrate(x^4/(sinh(x))^2,x,-inf,inf)
     \end{axiom}
    

    In Axiom use %minusInfinity and %plusInfinity instead of -inf and inf.

    axiom
    integrate(x^4/(sinh(x))^2,x=%minusInfinity..%plusInfinity)
    Type: Union(pole: potentialPole,...)

  11. Numeric conversions

    The results of calculations depend on the type of the inputs You can tell Axiom that you would like the result expressed as a floating point number (if possible) using @. For example:

    axiom
    asin(1/2)@Float
    Type: Float

  12. Axiom prefers symbolic calculations

    The trig functions are expressed in radians so use LatexWiki Image instead LatexWiki Image and LatexWiki Image instead of LatexWiki Image. Finally, because Axiom prefers symbolic calculations express LatexWiki Image as a rational number

    axiom
    r:Fraction Integer:=1.544 eq1:=90*%pi/180-asin(n*sin(34*%pi/180)/r)=asin(n/r) s:=solve(eq1,n) r is declared as being in Fraction Integer but has not been given a value.

    Axiom thinks there are two solutions, unfortunately only one is valid:

    axiom
    eval(eq1,s.1)::Equation Expression Float eval(eq1,s.2)::Equation Expression Float The constructor Float takes 0 arguments and you have given 1 .

  13. Reduce commands must end with a semicolon ;

    Like this

    r^2+r+1;
    reduce
    LatexWiki Image

  14. Coercion is sometimes necessary

    For example

    axiom
    integrate((4 - x**2)**.5::Expression Fraction Integer, x)
    Type: Union(Expression Fraction Integer,...)

  15. Use either differentiate or the abbreviation D

    Since sin(x) cannot be interpreted as a univariate polynomial, you must specify the integration variable.

    axiom
    differentiate(sin(x),x)
    Type: Expression Integer

  16. MathAction? requires that Axiom library code must beging with )abbrev. Typing )abb is not enough even though that works in Axiom itself.

AltStyle によって変換されたページ (->オリジナル) /