# 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
140 views

### Neat redistribution of association values

Given an original association: original = <| "a" -> {a1, a2}, "b" -> {b1, b2}, "c" -> {c1, c2} |> and a set of redistribution rules e.g. <...
148 views

### How to write down a product with omitted terms?

I have the following term which I would like to express correctly in Mathematica: $$\prod_{j=1,j\neq i}^m(\rho_i-\rho_j)$$ Can you please help?
96 views

### Keeping specific terms in Mathematica output

Update: After solving an equation I came up with a complicated expression, is it possible to only keep some specific terms of an expression ? As an example, if the expression is: How can I keep only ...
48 views

### How do I force a fractional coefficient to exclude non-numeric symbols?

Short version of question: Suppose I have an expression: expression = a+3b; When I divide by 2, I get: expression/2 It is ...
621 views

### Custom atomic expressions - modern tutorial

Atomic but sophisticated expressions are all around for a long time: Graph SparseArray. More are coming with each new release, ...
111 views

### How do I extract the matrix from an density matrix equation?

I have a density matrix equation and I wish to put it in the form of a matrix. For example, if I have: $$\rho =Ax_{1}x_{1}+Bx_{1}x_{2}+Cx_{2}x_{1}+Dx_{2}x_{2}$$ Copy-and-paste version ...
56 views

111 views

### Factor common terms out of a sum, without changing it otherwise?

I have some expressions, that consist of rather lengthy sums such as ...
63 views

### Generating a list of 4-digit integers by simulating four dice being thrown eight times

I simulate throwing four dice and merge their values together to form a 4-digit number. This is done eight times and I want to get a list like this one: ...
62 views

### Apply on Message resolves MessageName before applying

I want to make a Message from a List. Message[LibraryFunction::argx, 1, 3] ...
70 views

### Define a bilinear function of strings

I have a linear combinations of strings, e.g. combStrings = 0.1 "a" + 0.2 "b" I want to define a function f[] which deals ...
44 views

### Move part of expression

What is the best way to take a part of an expression and put it somewhere else in the same expression? Essentially I need to combine a Extract, ...
380 views

### Simplifying a Sum of Fractions by Removing Fractions in Denominators

I have a sum of fractions of the form $x1 - \frac{(x2 + x3)}{(x4 + x5)} - \frac{(x6 + \frac{x7}{x13})}{(x8 - x9 - \frac{x10}{(x11 + x12)})}.$ How might I simplify it to remove fractions from the ...
Say I have many expressions of the form $$\text{expr} = \frac{1}{AB(C+D)^n E^m}$$ where $A,B,C,D$ and $E$ are symbols and $n,m$ arbitrary powers. In order to convert between the mathematica output and ...