Questions tagged [expression-manipulation]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
52 views

Symbolic PDE manipulation

I'd like to transform a PDE in a way such that I can express a temporal derivative as a spatial derivative using some known relation. Very simple example: ...
user avatar
  • 21
0 votes
1 answer
26 views

Confusing abnormalities observed when counting a specific operator in an expression [duplicate]

Recently I have met with some confusing abnormalities when trying to determine if there is a specific operator (usually Plus[] ) in an expression by programming. ...
user avatar
  • 289
4 votes
2 answers
105 views

Extracting the constant term

Finite difference problem There are a large number of variables, interacting at most five at a time. A sample term is: How to extract the constant term? In this example, the constant term is -1/4.
user avatar
  • 956
-1 votes
1 answer
46 views

Factorize expression by specific term [closed]

I am new to Mathematica but I would like to know how to force Mathematica to factorize an expression by a specific term. Exemple, imagine I have a term like this: And I have an expression like this: ...
user avatar
1 vote
0 answers
50 views

Can one collect with respect to two groups of variables?

Here is a toy example of what I want: given ...
user avatar
0 votes
2 answers
62 views

How to extract logarithmic terms in an expression?

I have some expressions of the type $f(x) \,+\, g(x) \,\log(x) \,+\, h(x) \,\log(1-x^2)$ where $f$, $g$, and $h$ can be any rational functions of $x$. I am trying to use Mathematica to extract each ...
user avatar
2 votes
2 answers
77 views

Get rid of some solutions proposed by Reduce/Solve

I would like to take the result of a Reduce function call and eliminate any solutions that depend on the value of a particular variable (call it $y$). For instance, I am trying to get the parameters ...
user avatar
2 votes
1 answer
169 views

How do I extract the component from an expression

I'm embarrassed that I don't even know the language for what I'm asking. The result of an operation I'm performing is: $$expression=-dt^2 \left(c + a t\right)^2$$ $dt$ is basically an infinitesimal in ...
user avatar
  • 1,481
1 vote
1 answer
78 views

Speclevel in Reverse

I have an expression involving several dot products, I give a simplified example: expr={A.B,C.D} I want to reverse all dot products, and try ...
user avatar
1 vote
1 answer
75 views

Separating terms in an expression with many variables by their "nature"

I have an expression like this: $f=t_1(\sin(\alpha),\cos(\beta),\cos(\gamma)^2) \cdot r_1(x,y,z)+t_n(\sin(\alpha),\cos(\beta),\cos(\gamma)^2) \cdot r_n(x,y,z)$ Where $t_i$ and $r_i$ - functions of ...
user avatar
  • 1,576
0 votes
0 answers
75 views

Can Mathematica simplify expressions with prescribed relations?

I have a linear map $T$ on a vector space which satisfies $T^4 = 1$ and want to simplify expressions of the form: $$[X,TY] + [Y,TX] + [Y,T[TX,TY]] + [X,T[TX,TY]],$$ where $[\cdot, \cdot]$ denotes the ...
user avatar
  • 1
3 votes
1 answer
93 views

How to use RightComposition efficiently in the context of one-liners?

I find myself recently writting, more often than not, code that makes heavy use of RightComposition eg. expr//f/*g/*h It is relatively straightforward to first ...
user avatar
  • 122
3 votes
0 answers
77 views

How to convert Graph atomic object back into unevaluated expression? [duplicate]

For the purposes of further development of my shortInputForm function, I wish to convert Atomic objects such as Graph into non-...
user avatar
3 votes
2 answers
99 views

Extract first term of each element in a list

Suppose I have a list of the form list={a+b,c+d,Xi+Psi*Zeta,0} How can I make a list of only the first term of each element in that list? In this case the list ...
user avatar
  • 207
1 vote
1 answer
105 views

How to convert this Mathematica expression to another, as described here?

I am working on a function of which the core will consist of something like: ...
user avatar
0 votes
0 answers
55 views

Get depth of vertices in TreeGraph

I want to get the depth of each vertex in a TreeGraph, g. I might convert g into an ...
user avatar
  • 2,588
0 votes
1 answer
37 views

How to change the location of strings inside the manipulate function?

...
user avatar
  • 129
3 votes
3 answers
178 views

Encode expression into a list

I have an expression of the form: $$c {\partial^{k+l} \Phi(\theta,\phi,n) \over \partial \theta^k \partial \phi^l}$$ $n,k,l$ are (positive) integers. $c$ is some constant. It is also possible that $c$ ...
user avatar
  • 951
1 vote
2 answers
59 views

Converting an indefinite integral to definite integral

For example, I have the following integral expression: g[x, y] = Integrate[f[x, y],x] How can I modify the above expression to achieve the following definite ...
user avatar
  • 340
1 vote
2 answers
64 views

Factoring an arbitrary power from the rest of the expression in an exponential expression

I have the following expression: Exp[r*t*x + e*r*y + t*x*r^2 + y^2*e*Sqrt[r]] I want to choose some arbitrary terms in the power and for example write the ...
user avatar
  • 340
0 votes
1 answer
89 views

Simplifying multiplies of sums into a single double sum

I have the following expression: Sum[x^n, {n, 1, Infinity}]*Sum[Log[m, x], {m, 2, Infinity}] How can I Force Mathematica to write this expression in the following ...
user avatar
  • 340
0 votes
1 answer
74 views

Transforming one exponential expression to multiplication of exponential expressions [duplicate]

I have the following expression: Exp[a * x + b * y + c * z] I want to write this expression as: ...
user avatar
  • 340
2 votes
2 answers
212 views

How to express Bessel Functions in terms of Hankel Functions

I have the following expression BesselJ[\[ImaginaryI]*m, k*r] FunctionExpand knows how to transform from ...
user avatar
  • 340
1 vote
1 answer
34 views

How can I extract a list of terms with functions in terms of a specific variable

I have an expression in the following form: a f[x] + b Exp[g[x, y]] + r[z] f[y] + f[y] Sin[h[x, y, z]^2] + r[z] Log[t[z, y]] I want to extract an expression ...
user avatar
  • 340
1 vote
0 answers
52 views

Same displayed expressions produce different outputs

I know EngineeringForm is a wrapper which prevents evaluation of content, but pasting chunks of other cells with an EngineeringForm number, got these two simple expressions w/ the same input ...
user avatar
1 vote
0 answers
54 views

How to make a function in terms of constants to inherit the attribute of being constant

I have defined two variables a and b: SetAttributes[a, Constant]; SetAtributes[b, Constant]; I have defined a function c as ...
user avatar
  • 340
1 vote
0 answers
79 views

Extracting expressions from LHS of an assignment

I need to list all variables in a notebook containing several Set assignments, lhs=rhs, and equations, ...
user avatar
  • 433
2 votes
2 answers
88 views

Equality of expressions with different variable names

I have some multivariate systems of expressions that I want to check for equality up to allowing relabelling of the variables. For example the two expressions below would be the same: ...
user avatar
  • 55
1 vote
0 answers
78 views

Coefficient works on $\pi$, $x$ and $x^2$, but not on $\pi ^2$

Consider (\[Pi] + 2 \[Pi]^2 + 3 x + 4 x^2) Executing ...
user avatar
  • 1,185
0 votes
0 answers
60 views

Manipulation of expression

Let ss2 = (γ + ν)/β; is2 = ((γ + ν)/β) (β/((γ + ν)) - 1); I wish to do the following computation but want to keep the output in terms of ss2 and is2: ...
user avatar
  • 465
10 votes
5 answers
888 views

Simplify radical expression (a + b - Sqrt[a^2 - b^2])/Sqrt[a + b]

I have the following expansions: $\frac{a+b-\sqrt{a^2-b^2}}{\sqrt{a+b}}$ and $a>b>0$ Obviously we can simplify it further by hand $\sqrt{a+b}-\sqrt{a-b}$, but Mathematica doesn't know how to ...
user avatar
  • 4,856
0 votes
0 answers
53 views

Block Behavior, but for Function Assignment instead of Variable Assignment

We can define a function using a variable b that does not appear as an argument, and then using Block, change the output of the ...
user avatar
0 votes
3 answers
69 views

How i can move the slider Below X axis and beside Y axis of plot? [closed]

I want to place this slider below the x-axis and Vertically beside the y-axis.
user avatar
  • 129
2 votes
2 answers
72 views

Cutting of terms on denominators of giant expression

I have an immense expression of the form $$ \sum_i \frac{f_i(X,Y,x,y)}{(a_iX^2+b_iY^2+c_ix^2+d_iy^2)(e_iX^2+g_iY^2+h_ix^2+k_iy^2)}, $$ where at $a_i$ or $b_i$ AND $e_i$ or $g_i$ is different from zero....
user avatar
  • 353
0 votes
0 answers
46 views

Can I specify which terms to show on the left side and which on the right side of an equality in output?

Mathematica unexpectedly moves a part of the result of the calculation to the left side where I want to display only the unknown variable. Can I prevent this?
user avatar
  • 2,705
1 vote
1 answer
53 views

Grouping together same exponent terms in a multivariate monomial

This is a rather simple question but for some reason, I am spending too much time on this. Suppose I have a monomial in 4 variables, each raised to some linear combination of 3 exponent variables: <...
user avatar
  • 181
2 votes
2 answers
76 views

Make Mathematica not to evaluate an integral?

I want the output to contain an integral, while everything under the integral sign evaluated. How can I prevent the system from evaluating the integral?
user avatar
  • 2,705
0 votes
0 answers
47 views

Input output in Wolfram Cloud

This is a starter query. I know if I enter 2+2 and press enter, I get 4. Similarly, I enter ...
user avatar
3 votes
1 answer
241 views

Manipulating an equation to isolate a term (not solve for a variable)

Consider the following minimal example of my problem: eq = (a^2 + a == b^2) I would like to manipulate this equation to achieve: ...
user avatar
0 votes
0 answers
69 views

Evaluate a function with 3 different variables for the whole list of each variable

I have a function with 3 variables f[t1,t2,t3] Each function has a list of values ...
user avatar
1 vote
1 answer
61 views

Decompose expression into specified form of partial fractions

In order to obtain the partial fractions of an expression, I used the function Apart to realize it. However the result is shown as Figure 1 which isn't what I want. ...
user avatar
  • 663
2 votes
2 answers
71 views

Formal substitution of exponential factors in an expression

Assume that we have some complex algebraic expression, like Exp[(a t + b s)/w] ( t Exp[ q t] w + q Exp[q s] Exp[-2 s] + a^2 Exp[3 s] + s t + 1 ) Now, this is just ...
user avatar
  • 143
3 votes
1 answer
92 views

Pattern matching problems involving FullForm and Plus and Times [duplicate]

I am trying to match an expression that will be a sum of more than one terms, with the last one being a product. For example, the objecta+b+x*y. I am using the ...
user avatar
0 votes
0 answers
40 views

Issues in expanding expressions with formal sums

I have a very long expression involving formal sums to infinity, unfixed functions and several variables. In this very long expression, I need a typical term, like $\frac{6 A \sigma \sum _{n=0}^{\...
user avatar
0 votes
0 answers
37 views

How to rearrange terms in an expression to a particular form (e.g. A/w-> A*(1/w)

I have a huge expression for which the numerators are a big mess, involving numbers, variables, formal sums and unevaluted function, let's call the numerators Ai, with i=1,2,...n This "beast"...
user avatar
0 votes
3 answers
121 views

How to extract a factor from equation and rearrange the equation?

I want to extract a factor from the equations, it's not a common factor, just a factor defined by myself, like this: (ac+b) --> c(a+b/c) I have tried Factor,<...
user avatar
7 votes
1 answer
135 views

Applying Operators inside complex expressions to argument with Through

I am developing some functions to help me work with Quantum Mechanics Momentum Operators. Here, for simplicity, I represent them with these simple functions because the actions of the operators ...
user avatar
  • 83
0 votes
2 answers
53 views

Approximating giant polynomial expression

Suppose I have a giant polynomial expression analogous to $$ F=a_1xX^6+a_2x^2X^5+a_3x^3X^4+a_4x^4X^3+a_5x^5X^2+a_6x^6X $$ and it is true that $X \gg x$. Let it be enough for me to approximate this ...
user avatar
  • 353
1 vote
2 answers
62 views

Converting a vector of expressions into functions with the index being an input

I am trying to generate a list of functions from a vector of expressions. I have the list $H=[1,x,x^2+1,3x^3+2x,4x^2+2x]$ and I want to define a function $f$ using two inputs such that $f(n,x)$ ...
user avatar
  • 11
1 vote
2 answers
88 views

How to delete certain terms in a polynomial with variables in subscript?

I have a polynomial in the following style, ...
user avatar
  • 1,546

1
2 3 4 5
14