# Questions tagged [expression-manipulation]

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

600 questions
Filter by
Sorted by
Tagged with
29 views

### Substitute an expression iteratively

I have defined this function replaceIteratively[expr_, x_, list_] := Module[{n = 0}, expr /. x :> (n++; list[[n]])] which does the following job ...
111 views

### How can I obtain the matrices of coefficients of quadratic form?

I'm trying to find the matrices of coefficients of a quadratic form: ...
117 views

### How can I emulate Orderless attribute?

Suppose I want an expression to automatically sort its arguments. This can be done via SetAttributes[f, Orderless] f[3, 2, 1] (*output is f[1, 2, 3]*) Just as an ...
76 views

77 views

### Fixed Point Iteration - Finding Iteration Functions

When we use Solve, it attempts to solve the system for the variables, for example Solve[x^3 + 4 x^2 - 10 == 0, x] If we want to use Fixed Point Iteration to ...
53 views

### Extracting coefficients from a sum of exponential functions

I'm dealing with a sum of exponential functions with different exponents ...
30 views

### Problem with recursive relations

Continuing the topic of my previous questions (link1 and link2), let me ask one more question. I have problems with the following code: ...
54 views

### check if one expression can be transformed into another

My question is how to use Mathematica to check if one expression can be transformed into another: Example 1: $ax^2+bx+c$ into $K\cdot(x+\alpha)^2+\beta$, and then show me $K(a,b,c)$ and so on. ...
53 views

### Replace a family of coefficients by a function in a sum

I would like to do something very simple, i.e. replace the coefficients in a sum by a function: c + c + c /. {c[s] -> (s + 1)/(2 (2 s + 1))} ...
60 views

### Symbolic nest expressions

I'm trying to understand how to use symbolic expressions as arguments. The following example represents my problem: ...
32 views

### using pattern matching to separate coefficients and functions

I want to find out the coefficients and functions from an expression and possibly save them in separate files with same order. I have the following toy example: ...
1k views

### How to do algebra on summations of variable expressions?

Is there any easy, general way to handle algebra on variable Sums? For examples, Gaussian Mixtures or Fourier Series: ...
79 views

### Collect with linear combinations

Is there a way to collect coefficients on specific linear combinations of variables? Consider the example below: ...
32 views

### Expanding complex expression and replacing variables in the result

When I'm finished expanding my expression I would like the result to be expressed again in terms of the original variables (like α, S1, T1, T2). I've tried replace, ...
44 views

### Optimizing an equation - show the length of an equation, including operators

A simple, but I think useful question to know the answer for. How can I quickly count the length in my equation, including +,-, and so on? For example, $x^2+1$ has a length of 4.
27 views

### Computations with OptimizedExpressions without completely expanding them

I have to manipulate huge expressions that are rational functions of many (∼30) variables with integer coefficients. Storing them just as a ratio of two polynomials would be impractical. But they can ...
38 views

### Rearranging expressions by DragAndDrop

I see that the DragAndDrop option for editing is not supported anymore. However, I think this could be a really useful feature, for instance to rearrange the terms of an expression in the form we ...
29 views

### Applying function to both coefficients and variables in Collect

I am dealing with expressions schematically of the form expr = c G + c[3,8] G[3,8] + ... + c G + ... where the Gs are fixed objects, and the cs some ...
156 views

### Extracting parts of an expression

I have lists with expressions like this one: {-DTMomentum2[{0, 0, 1}], DTMomentum2[{0, 0, 0}]}. DTMomentum2 is just an undefined ...
6k views

### How can I transfer mathematical expressions between Mathematica and Maple?

Is there a simple way to copy mathematical expressions between Mathematica and Maple (or at least in one direction)? I mean only expressions built from numbers and predefined mathematical functions, ...
49 views

### Fast way to apply permutations in large list?

I have one Polynomial in the form of FF[x1,x2,x3,x4,x5,x6,x7,x8], where xi pick numbers from ...