Questions tagged [expression-manipulation]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Maintain written order in expression (lexicographic sorting rules) [duplicate]

Is there any way I can get output to follow the exact order that I wrote it? For instance (simple example) x = z + a - b + c^2 comes out as ...
3
votes
3answers
275 views

How to take a part from a list without evaluating it

Consider I have a list l ...
3
votes
6answers
278 views

Making strict replacements in Mathematica

My question is quite a simple one, but I have not been able to find a solution yet. Say I have terms of the form e.g 1/n1/n2/n3/n4 and ...
4
votes
1answer
118 views

Can Mathematica reliably determine the equality of any two constructible numbers?

A constructible number is any number which can be expressed with only natural numbers and the operators $+$, $-$, $\times$, $/$, $\sqrt{}$ (square root only). Is Mathematica's ...
1
vote
1answer
160 views
1
vote
1answer
110 views

How to take a factor out of brackets?

I have an expression like this (E^(-(j + k) y) (-1 + E^(i y)))/(j k) I would like to take E^(i y) out of the brackets to get ...
0
votes
1answer
275 views

Need to evaluate a double summation which includes an integral?

Is it possible to evaluate this double summation which includes an integral with Mathematica for some given $r$? $$\sum_{m=-\infty, m\neq 0}^\infty\sum_{n=-\infty, n\neq 0}^\infty m \int_0^{2 \pi} \...
11
votes
0answers
104 views

Why does the kernel quit if I want to use minus a sum that I converted from a list?

Using Mathematica 11 when I define a list yy = {x*43, 32*y}; and then convert it to a sum yy[[0]] = Plus; yy I get, as ...
3
votes
3answers
375 views

Separate or order the positive and negative terms of an expression

I am using Mathematica to manipulate/keep track of a long series of symbol manipulations. One thing that I would like to do is separate or order the terms of an expression by positive and negative ...
1
vote
1answer
140 views

Find all the subexpressions with a given head in an expression

Given an arbitrary mathematical expression expr involving summations and multiplications I would like to find all unique instances of subexpressions with a ...
3
votes
2answers
77 views

How to set a particular element of a list to a number?

I have a list {a,b,c,d}, and I want to set the 1st element and the 3rd elements equal to 5 and 8, respectively, leaving 2nd and 4th as they are (...
2
votes
4answers
97 views

Taking Head of function in operator form (and manipulating arguments in operator form)

Is there a simple function that will take expressions of the form f[a1][a2][a3] and will output f, for an arbitrary number of ...
6
votes
2answers
258 views

How to prevent Mathematica from complete evaluation of special functions?

Recently I tried to check a result of integration which should be a linear combination of the Riemann $\zeta\;$-function at various arguments, the coefficients of the combination being of primary ...
2
votes
0answers
59 views

Create Association from Expression

I have a set of algebraic expressions of a certain form, and I would like to make them into Associations in a specified way. My expressions are formed of two heads, ...
3
votes
0answers
106 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 ...
4
votes
2answers
316 views

How to do nonlinear substitution?

Suppose, I have an expression. For example: $$\cos^5(\phi) \sin^3(\theta)$$ And I want to change variables to $(x, y, z)$, knowing that the new variables are related to $\theta$ and $\phi$, via ...
1
vote
2answers
54 views

Make two expressions look alike OR check that they are the same

I would like to compare my Mathematica calulations with the results from a paper. I get: ...
12
votes
1answer
232 views

Potential bug of function Reduce

Bug introduced in 11.1 or earlier and fixed in 11.3.0 Just a simple expression in version 11.2, Windows 10 Reduce[(-2)^n > 1, n, Integers] returns ...
2
votes
2answers
82 views

Building a replacement rule from a pattern, Assocation and RuleDelayed [duplicate]

I'm trying to create a function that builds a replacement rule from a given pattern and I have trouble understanding what's going wrong. After having written most of the question, I see that it got ...
-1
votes
1answer
146 views

How to directly/conveniently use variable names as filenames?

Purpose To use variable name as file name conveniently. Code Special thanks to @J.M.'s tips! ...
2
votes
1answer
124 views

How do I use Distribute in integral?

I use of Distribute for multiply a parameter in Integral. I write the following code: ...
2
votes
1answer
118 views

ToExpression and RowBox — orderings

With: ToExpression[RowBox[{"c", ToBoxes[Plot[Sin[x], {x, -2, 2}]], "a"}]] I get the three elements of the array, but with "a" and then "c" at the beginning. I ...
2
votes
1answer
94 views

Extracting a product of factors from an expression in unevaluated form

Suppose I have an expression like so: $\qquad {\rm expr}=2\,i\,{\rm Gamma}(4)\,\pi\, 9.93 f(x)\,g(y) \frac{h(x, 4y)^3}{11 q}$ What is best (most succinct) way to extract out only the product of ...
1
vote
1answer
51 views

About the Coefficient command after double Taylor Series

First, let me give the code. These are the matrices. ...
3
votes
2answers
102 views

Inner/Dot List Vector (Looks like `MatrixPower` but in fact not the same)

(This question comes from the last input of Converting Equations to Sparse Arrays in Wolfram Documentation.) I want to get this (by extensible code): ...
3
votes
3answers
218 views

How do I convert parentheses of a function into brackets?

Is there a method to convert the parenthesis of the argument of a function into brackets? What I mean is something like: $$(x+1)\sin\left(y*\sqrt{y\ln{\left(x^2\right)}}\right)\to(x+1)\sin\left[y*\...
0
votes
1answer
49 views

Implementing commands in the style of Factor to manipulate Trig functions.

What I would like to do is manipulate and simplify trig functions as they appear often in my calculations. What I would like to do is to use the double angle identities. Here is what I have ...
5
votes
3answers
117 views

Make a conjunction of expression from a list

I have a rather silly question, I assume: I have a (nested) list of polynomials that I made from a matrix with the Minors command and I would like to make them ...
2
votes
1answer
117 views

Replacement involving Log not working

In the following expression Log[a/6] + Log[b/7]+Log[c/7] + Log[b/8] I want $log(\frac{b}{7})$ and $log(\frac{b}{8})$ to be replaced by $log(b)-log(7)$ and $...
0
votes
2answers
120 views

Why does mathematica not recognize the equality of these two terms? [closed]

I have two expressions which I have analytically verified to be equivalent but when I check them numerically via mathematica I don't obtain numerical agreement. They are ...
3
votes
2answers
302 views

Extracting subtree for a TreeForm

How can I extract an entire subtree from a TreeForm starting from a specific point of the tree? Because with Extract or ...
6
votes
2answers
251 views

Turn single fraction into multiple fraction expression

I would like to find a way to take an algebraic fraction, where there is only a single numerator and denominator, and to turn it into multiple fractions multiplied by each other. I would like to ...
4
votes
3answers
2k views

Conjugating symbolic expression [duplicate]

I am trying to conjugate a symbolic expression, and I have explicitly stated the real terms. However, I simply can't get it to work: ...
8
votes
2answers
274 views

How to represent $f(x) = (y-x)^k \log(y-x)$ as a summation of the form $f(x) = \sum\limits_{j=0}^\infty \cdots$?

I am having a lot of trouble working with summations in Mathematica, and this is unfortunate as it is my main use case for the application My latest summation issue is the following. I am trying to ...
9
votes
3answers
208 views

How to find root-free form of an equation

Suppose you have an equation with various roots as in $\sqrt a + \sqrt b = \sqrt c$. Sqrt[a] + Sqrt[b] == Sqrt[c] Is there a Mathematica command or program ...
0
votes
0answers
48 views

Proving $d(dx)=d^2x$

Is it possible to carry out the following differential in Mathematica? $$d(dx) = d^2x$$ I tried to write: Dt[1*Dt[x]] the result is: ...
2
votes
1answer
102 views

Replace subexpression with a variable

r = (a - b + d)/(-a + b + c) Need replace (a-b) with z to get this result: (z + d)/(-z + c) I have tried Replace, ...
1
vote
1answer
74 views

Specifying orthogonality condition

I am working with a calculation that involves testing many cases. I would like to have some function that specifies certain orthogonality relations: Variables bv ...
17
votes
2answers
806 views

Transform an expression into a graph that can be plotted with TreeGraph (not TreeForm)

I would like to plot an expression (like TreeForm does), but using the new TreeGraph functionality. ...
1
vote
1answer
168 views

How can Mathematica take a prefactor in front of the relation

I have the following term in an expression $$\frac{q_B' \sin2q_B}{P_B Q_B^2}(2 Q_B P_B - \sin^2 q_B \Pi_B) q_1 q_1'$$ the prime denotes differentiation w.r.t a coordinate. Some additional ...
0
votes
3answers
118 views

Getting just the terms independent of a certain variable

I have a very long and convoluted expression with many variables and my goal is to get just the terms which are coefficients of $e^{it}$. The variable $t$ never appears outside of exponential terms (...
43
votes
3answers
23k views

How to change plot style or other options after it was created

For example: p = Plot[Sin[x], {x, 0, 1}] Is it possible to write options in Show to change the curve's color for example into ...
0
votes
1answer
105 views

approximate symbolic function to 0

I have a function which contains multiplications of symbolic constants,a[i,j], that are small, for example: ...
31
votes
2answers
2k 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: <...
5
votes
1answer
138 views

Does Mathematica have this function implemented?

Is there a function in Mathematica that can express a piecewise function in terms of the Heaviside theta function? Say, for example, the solution to this ODE.
7
votes
2answers
205 views

Efficient Search for specific Terms in symbolic Expression

I have a large symbolic expression with six variables a,b,c,d,e,f per term, roughly like this: ...
0
votes
1answer
57 views

Converting indices to expression and back

lets say I want to convert this Subscript[PSternMat, 2, 13] into this PSternMat$2$13 I have written this rule ...
1
vote
1answer
58 views

Selective replacements

I would like to replace parts of the expression, with variables p[1] and p[2], that are invariant under inversion ...

1
3 4
5
6 7
13