How to manipulate expressions structurally, not necessarily complying with the rules of algebra.

learn more… | top users | synonyms

8
votes
2answers
168 views

Keep Mathematica from simplifying functions with a specified Head

I want to run Simplify and/or Refine on various expressions, but keep it from touching anything that contains a specific ...
3
votes
3answers
73 views

Unexpected Behaviour with local variables and ToExpression

I encountered an unexpected behaviour in my mathematica-code, and want to understand whether that's a mathematica bug, or a misinterpretation on my side. ...
4
votes
2answers
182 views

Time-efficient creation of matrix

I have expressions like xx1=FF[1, 1] GG[1, 1] + FF[1, 1] GG[2, 2] + FF[2, 2] GG[2, 2] xx2=2*FF[1, 2] GG[1, 1] + FF[1, 1] GG[1, 2] + FF[2, 2] GG[2, 2] and I want ...
3
votes
2answers
102 views

Time-efficient manipulation (zeroing) of expression

I have huge matrices in the form of ...
2
votes
1answer
86 views

Extracting rational coefficients from an irrational sum [closed]

I have a function that returns results that always can be represented as $p+q\,\pi^2+r\ln2+s\ln^22+t\sqrt2$ where $p,q,r,s,t\in\mathbb Q$. But the actual Mathematica expression returned not always in ...
2
votes
3answers
80 views

Problem with InverseFunction of Sqrt

I want to build a table of InverseFunctions, f.e.: ...
-1
votes
1answer
56 views

How to get solution from DSolve

How to get the solution from DSolve in such way that there is no need to copy the result. When for example solving: ...
4
votes
1answer
70 views

How do I constrain variables to a user-defined domain in ArgMax?

I am trying to ArgMax a function over x, but x is only defined between ...
8
votes
1answer
85 views

How to get a list of all expressions in a notebook matching a certain pattern?

Suppose I have a Mathematica notebook saved to a certain location on disk. Given a pattern I need to get the list of all expressions matching this pattern that appear in input, output or print cells ...
1
vote
1answer
52 views

Can someone please help me to state assumption?

I am currently trying to solve under what condition does the following term will be zero? ...
1
vote
2answers
63 views

How does one go from a string to the contents of a variable with the same name?

What command should I use if I want to convert a string to the contents of a variable with the same name as the contents of that string withing a function. ToExpression[] doesn't seem to do it. ...
0
votes
3answers
86 views

List of Coefficients of Expression with symbolic Terms

(I am affraid that this is a duplicate, but I read several already asked questions and non of them helped me. If it's already answered, please tell me) I have expressions like this ...
0
votes
1answer
56 views

Is there a command returning information about a particular object? [closed]

Suppose I have a variable var1, a function MyFunction, and a graphic SomePlot. I remember ...
1
vote
2answers
117 views

Stopping Mathematica from reordering expressions [duplicate]

I want Mathemtica to stop manipulating my polynomials! I mean, I want the output of Print[3 x + 5 + x^2] to be just $3x+5+x^2$, not $5+3x+x^2$ as Mathematica ...
0
votes
2answers
65 views

Convert an expression from one form to another

I have this expression -0.433284-0.758719 x+0.00289158 x^2-0.443672 y+0.00149027 y^2 I want to express it in terms of ...
1
vote
1answer
29 views

Adding various combinations of rational expressions [closed]

as a newbie to Mathematica I wonder if someone can help... I'm generating a puzzle worksheet for some students and wish to add linear rational expressions, three at a time from a pool of six. e.g. ...
3
votes
1answer
70 views

Convert an expression's symbols of form a$x to a[x]

I want a function that takes expressions of the following form: a$x and converts them to a[x]. In particular, consider the ...
0
votes
1answer
91 views

How can I obtain Wolfram Alpha's “alternative forms” of an expression inside Mathematica?

When I type in Wolfram Alpha, say, cos(a+b) or cos(a+b)^2 or (OK this next one can easily be obtained in Mathematica, ...
2
votes
4answers
306 views

How to completely delete the head of a function expression

Is there any way to completely remove the head of an expression function? For example, how would I remove the head Cos from ...
7
votes
3answers
126 views

Thread over uneven (ragged) expressions with full functionality?

There are a number of questions on this site about "threading" including several relating to uneven (ragged) lists. However, none that I could find deal with the full functionality of ...
0
votes
1answer
51 views

Converting expression to C

I have an expression of the form ...
2
votes
1answer
44 views

Quoting definition explicitly

I'm trying to quote a definition using DownValues, OwnValues, etc. Everything seems to be fine, except for temporary symbols' ...
8
votes
2answers
184 views

The most external subexpression with given pattern

Suppose there is a deep expression with several instances of some _f. I want to get the most external case of _f from it (I also ...
1
vote
1answer
34 views

Converting an expression to modular arithmetic automatically

I have the expression $\frac{1}{15} \left(-(-1)^n-5\times 2^{n+2}+3\times 2^{2 n+1}+15\right)$ which I want to calculate mod m for a very large n. My current method is to ask for this exression in ...
10
votes
1answer
266 views

List of atomic expressions

I was surprised to see Graph objects are atomic. Is there a way (through documentation or programmatically) to find all atomic heads? The ones I know of are: ...
2
votes
1answer
105 views

Truncate High order terms

Suppose I want to compute this : Series[Sin[1/f], {f, Infinity, 10}] but finally I prefer Sin[1/f] up to the fourth order in ...
5
votes
1answer
80 views

MapIndexed stops at levelspec 1 if only the index is passed?

If the function passed to MapIndexed references the first (or data) argument, the following performs as expected: ...
0
votes
2answers
60 views

Expand expression into quotient of negative power series

I have a function T(z) and want to expand it to the following form: At the end I want to have a list of equations, which can calculate a0, a1, a2, b0, b1 and b2 with different values of h1, h2, ...
1
vote
1answer
42 views

expression contained across multiple cells

Is it possible to span one expression across multiple cells? E.g. long if statement or function evaluation. I looked in documentation and searched forum/google and could not find.
3
votes
2answers
191 views

Replace every Minus to Plus in Expression

Thought this is a rather simple thing, but I was not able to find a solution: I have a polynomial expression like: expr1=a^2-b+c*d expr2=a-b expr3=-a+b-c and ...
0
votes
1answer
76 views

Decompose Expression into Segments

Say I have an expression test = 3 x1^2 - 2 x3^-3 and I would like to decompose the expression into {3 x1^2, -(2/x3^3)}, I can do ...
0
votes
1answer
86 views

Working with functions

I am required to write a function that takes a function as a parameter. ...
0
votes
1answer
127 views

Patterns of function-arguments in expressions

I want a function that compares an expression with a specific pattern. The expression has always the following form: ...
3
votes
1answer
177 views

Extracting function calls from an expression

I have an expression like this: expr = F[0, 1] + 2 F[0, 0] - 17*F[2, 0] and I want to transform it to a list consisting of all function calls with its arguments: ...
2
votes
2answers
90 views

Merging two held expressions into a held compound expression

Consider e1 = Hold[a = x + x; b = y + y + y]; e2 = Hold[c = a + a + b + b + b; c^2]; How can I obtain the following? ...
3
votes
1answer
94 views

Why is ^^ff not the same as ^^ToExpression[“ff”]?

I want to convert a hexadecimal string to a decimal (base 10) number: 16^^ff 16^^ToExpression["ff"] The 1st line returns the correct answer of 255, while the 2nd ...
3
votes
1answer
112 views

Set gives an unexpected error message (Set::partw)

Here is a minimal example: s = 1 /(a + b[3]) + 1 /(2 a + b[3]); s[[1]] = Sum[s[[1]] /. b[3] -> k, {k, 3}] s[[4]] s[[4]] = Sum[s[[4]] /. b[3] -> k, {k, 3}] ...
0
votes
1answer
84 views

How to convert the expression '{a->a0, b->b0}' to the expression 'a=a0; b=b0'? [duplicate]

How to convert the expression '{a->a0, b->b0}' to the expression 'a=a0; b=b0'? I think this is a common question and do not know if someone has asked it before. Any help or suggestion will be ...
8
votes
3answers
381 views

How to extract expression from ConditionalExpression

p1 := y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]} ...
4
votes
1answer
134 views

Selecting expressions from a sequence that are not subexpressions of earlier elements

I have a While loop that generates and prints an expression on each iteration (there can be thousands of iterations). UPDATE: Some expressions are generated in ...
6
votes
2answers
112 views

Partial result of aborted evaluation of FullSimplify

When FullSimplify invoked on a large expression, it can run for hours. If I do not have time to wait, and abort the evaluation, I get no result, although, ...
11
votes
3answers
186 views

How to collect expressions from cells created by Print?

I have a notebook where evaluation of a certain cell produced hundreds of adjacent output cells using Print. I need to create a list containing all expressions from ...
1
vote
1answer
68 views

check if the expression is a equation

I need to check if the expression is a correct equation with only 1 variable x and without functions, that are not build into Mathematica. For example Sin[x]==0 ...
6
votes
1answer
124 views

Is it possible to disable assumptions used by FullSimplify for zero testing [closed]

Sometimes when I invoke FullSimplify on a large expression, I get a series of messages like this: ...
3
votes
0answers
56 views

How to combine DifferenceRoot objects for odd and even-indexed terms

I'm trying to analyze a certain infinite sequence $S$, indexed by positive integers starting from $1$. It can be split into two subsequences: $S^{odd}$ by removing all even-indexed elements and ...
5
votes
1answer
65 views

How to bail out from a non-applicable transformation function?

I provide a custom function in TransformationFunctions options of FullSimplify that can do a transformation only for some values ...
6
votes
0answers
134 views

Using FunctionExpand to evaluate symbolic derivatives

Some symbolic derivatives of certain special function are not expanded automatically, but FunctionExpand often helps to get a derivative-free closed form ...
0
votes
2answers
132 views

Replace doesn't replace the denominator [duplicate]

I have the following expression in Mathematica -((E^(2 - 2 Sqrt[(x[1] - x[2])^2]) (x[1] - x[2]))/Sqrt[(x[1] - x[2])^2]) I want to replace anything of the ...
4
votes
1answer
233 views

How to extract a possible closed form from WolframAlpha[] output

To find a possible closed form of a number, I can use the function WolframAlpha["6.38905609893065", IncludePods -> "PossibleClosedForm"] It returns a result ...
0
votes
2answers
80 views

I want to define a function that has integer power [closed]

I am defining this function: f[x_] = kr*g[x] + (c^l*x^l)/(KIR + c^l*x^l) But I want to make l bigger than 0, so if I evaluate ...