# Questions tagged [expression-manipulation]

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

617 questions
Filter by
Sorted by
Tagged with
22 views

### Distinguishing function calls from multiplication when importing LaTeX via ToExpression and TeXForm

I'm trying to parse a LaTeX representation of a Desmos calculator (like this one) via Mathematica. Desmos exposes a JSON representation of its calculators, including a LaTeX representation of ...
39 views

### What is the difference between NSolve and N[Solve] [closed]

N[Solve] NSolve I am getting different results everytime I use these commands.
68 views

### How can I get output from Reduce assigned to a variable? [closed]

I use Reduce to solve an 3rd order equation, and the output is given as the OR'd combination the solution variable. Normally, I can do a replacement to assign the value to a variable, but that doesn'...
50 views

### Any way to automate solving problems where the answer from one question is used in the next?

I am a total Mathematica beginner. I just want to use it to do some calculations, and the reason it is so interesting and attractive to me as an engineering student is that it allows me to write maths ...
39 views

### How to eliminate a variable from coupled ODEs?

I found this question with an answer: How to eliminate variables in ODE? ...
56 views

### Computing the sum of the first row of a matrix

I wish to compute for the sum of the reciprocals of the first row of the distance matrix of a particular circulant graph. My code is as follows for the ordinary sum of the first row. ...
92 views

### Quantum bra and ket notations

Is there a way to define the above quantum expression in Mathematica. I am using an add on package in this link. http://homepage.cem.itesm.mx/lgomez/quantum/ What I have tried is: ...
134 views

### Better way to rename arguments to a functional form so that duplicate arguments are sequentially enumerated

I need to modify expressions that such as f[w, w, a, y, x, a, x, a] into f[w1, w2, a1, y, x1, a2, x2, a3]. In short, I have ...
119 views

### Simplifying expressions containing binary variables

Consider an expression with two binary variables, $a,b\in\left\{ 0,1\right\}$, given by $F=(1-a-b)^{3}(1-b)$, with truth table: ...
189 views

### Equivalent of select/remove for Mathematica?

What is the Mathematica equivalent of Maple's select/remove? To quote Maple: A typical application that uses select and remove ...
28 views

### Shorten a sum of many terms by introducing a rule for scalar product and Kronecker deltas and using repeated replacements

There is a sum of many terms that I would like to simplify by introducing a notation for scalar product of two vectors. Each term is a product of constants and of several components of 3D vectors: <...
84 views

### How to Simplify expression efficiently inside Power

How can I simplify trivial expressions under the Power? Here is one example: (z2p-z2p z3)^-ϵ ...
57 views

### How to extract terms from equation, and then set each of them to 0?

I have a long equation, namely, ...
65 views

### Collecting common powers of terms

How to collect the common powers appearing in the following function using MATHEMATICA, such that if I input (4 m^6)/((m - n)^2 (m + n)^4 (2m+n)^4) then the ...
65 views

### How to sort out/ extract positive and negative powers as list?

I have the following expression expr = x1^d1 * x2^d2 * x3^d3; where d1,d2,d3 can contain negative values/expression i.e. in ...
117 views

### Split matrix expression into multiple lines

Given a matrix expression testm = {a + b, c + d, e}; {# , testm[[ # ]] // Simplify} & /@ Range[ Length[testm] ] // MatrixForm \begin{equation}\begin{pmatrix} ...
57 views

### How to get the result in terms of a previously defined expression?

Say I have a vector X[n_] := Table[Subscript[x, i], {i, 1, n}] and a matrix of connections: ...
28 views

### Why are these expressions with shifted delta functions not equal?

I have the following equation Exp[a-t]*DiracDelta[t-a] == DiracDelta[t-a] which cannot be evaluated. However, if I plug in 0 for a: ...
38 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 ...
125 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: ...
122 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 ...
41 views

### Finding the domain in which a function is analytic with no imaginary part

I was wondering if it is easy to see if a given expression evaluates to a real number in a given domain? Let e.g. f(x,y,z) be some function depending on three ...
80 views

98 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 ...
58 views

### Extracting coefficients from a sum of exponential functions

I'm dealing with a sum of exponential functions with different exponents ...
32 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: ...
55 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. ...
54 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))} ...
62 views

### Symbolic nest expressions

I'm trying to understand how to use symbolic expressions as arguments. The following example represents my problem: ...
33 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: ...
85 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, ...
30 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 ...
30 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 ...
53 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 ...
50 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.
79 views

### How to hold the expression when using ToExpression with TeXForm

I know {1, 1} // Apply[Defer@*Plus] can return 1+1 But if I want hold the form from TeXForm,what should I do? ...
30 views

### Lexicographical Search and Conjugate

I bid you a good day. I want Mathematica to plug this assumed solution into the left hand side of a differential equation. Then collect terms of powers of $\alpha$. \$\psi (x,y)=\alpha f_1(y)e^{i x}+...
Consider the expression $$a\sin(x)-a\sin\left(\frac{x}{a}\left(a+\frac{ay}{x}\right)\right) \label{a}\tag{1}$$ which can be rewritten as $$\sin(x)-\sin\left(x+y\right) \label{b} \tag{2}$$ and ...