Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: issues with expression manipulation functions
Replies: 1   Last Post: Oct 3, 2012 11:39 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alex Krasnov

Posts: 15
Registered: 10/3/12
issues with expression manipulation functions
Posted: Oct 3, 2012 3:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In the process of learning Mathematica, I discovered several items of
unusual behavior. I would appreciate any clarification.

(0) Several expression manipulation functions behave correctly with
HoldComplete subexpressions but not with Hold subexpressions. Example:

In: Together[1/x+HoldComplete[1]/x]
Out: (1 + HoldComplete[1])/x

In: Together[1/x+Hold[1]/x]
Out: x^(-1) + Hold[1]/x

Another example:

In: Factor[3+3*HoldComplete[x]+HoldComplete[x]^2, Extension -> {Sqrt[3], I}]
Out: ((-3*I + Sqrt[3] - (2*I)*HoldComplete[x])*(3*I + Sqrt[3] + (2*I)*HoldComplete[x]))/4

In: Factor[3+3*Hold[x]+Hold[x]^2, Extension -> {Sqrt[3], I}]
Out: (kernel crash)

Although the last example is clearly a bug, is there some difference in
behavior between HoldComplete and Hold that generally accounts for these
issues? The documentation mentions differences with respect to Sequence,
Unevaluated, Evaluate, and upvalues. Without knowing the internals of the
expression manipulation functions, I fail to see how any of these are
relevant here.

(1) FactorTerms behaves incorrectly if the independent form is more
complex than a symbol and not contained in the expression. Example:

In: FactorTerms[x, x^2]
Out: Sqrt[x]

In my understanding, FactorTerms should always return an equivalent
expression. Is this a bug or some sort of undocumented behavior? Does
FactorTerms require the independent form to be a symbol?

I am using Mathematica 8.0.4 on Windows.

Alex




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.