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

learn more… | top users | synonyms

-1
votes
0answers
71 views

Rudimentary/basic simplifications of expressions not carried out--very puzzling!

Here's the raw input cell form--trying to follow MarcoB's suggestion--of the "offending" expression "g2": g2 = Piecewise[ {{(1/(1435*ra))(2(-1 + ra)^6*(11*ra^3*(-896*(201 + 16*rb) + .10*(368699 ...
7
votes
2answers
73 views

Reading Cells or Boxes expression by expression

Let's say we have a cell: (*newline*) (*newline*) Plot[ x, {x, 0, 1} ] (*newline*) Plot[x, {x, 0, 2}] How to read it expression by expression? ...
2
votes
1answer
69 views

Replace pattern for exponentials

Ultimately, I want to replace every Exp[(const) w[i,j]] to T[i,j] and Exp[-(const) w[i,j]] to 1/T[i,j] in the following expression ...
4
votes
2answers
532 views

Simplifying expressions involving Sum

I am trying to use Mathematica to simplify a symbolic expression involving Sum. The expression is defined as follows: ...
3
votes
3answers
144 views

How to get the long logic expression with a terse method

I have a long logic expression (x==2||x==3||x==4)&&(y==2||y==3||y==4)&&(z==2||z==3||z==4)&&(m==2||m==3||m==4) How to get it by a terse ...
0
votes
0answers
44 views

Force expression in certain form

Is there a function in Mathematica to force an expression to be transformed into a given form. For example f[x] is a function of ...
4
votes
2answers
100 views

Efficiently strip off coefficients in front of variables?

I am working with multivariate polynomials and need a very efficient way to decompose monomials into coefficients and pure monomials. for instance consider variables ...
2
votes
2answers
112 views

How to extract the structure of relationships amongst variables in a system of equations? [closed]

Mathematica being a CAS, I would have thought what I'm trying to do a natural task. But I have not been able to find any information on this in the Internet. Basically, I have a large collection of ...
3
votes
0answers
67 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 ...
6
votes
2answers
109 views

What is the Difference Between Rule (->) and RuleDelayed (:>)?

I am new to Mathematica so this question may seem rudimentary. Sorry for that! :) I want to implement the well-known property of Kronecker's Delta $$\Sigma_{i=1}^{n} a_i \delta_{ij}=a_j,\quad 1 \le ...
1
vote
1answer
75 views

Deriving the Fourier Coefficients Formulas with a Manual Procedure

I already know that there are built-in functions to compute the Fourier coefficients but I want to derive their formulas manually. In fact, I want to obtain the final well-known formulas for the ...
58
votes
3answers
2k views

Replacement inside held expression

I wish to make a replacement inside a held expression: f[x_Real] := x^2; Hold[{2., 3.}] /. n_Real :> f[n] The desired output is ...
0
votes
1answer
42 views

Error: Recursion Depth of 1024 Exceeded During Evaluation

I wrote a function that exchanges integration and summation in an expression. ...
0
votes
1answer
66 views
3
votes
2answers
65 views

Creating Boolean expressions over a set of indexed variables

I've read lots of examples here on how to set one matrix Equal to another, but how do you nest And and ...
12
votes
1answer
135 views

A weird issue with Interval[$MaxNumber]

From the Interval documentation: For approximate machine- or arbitrary-precision numbers x, Interval[x] yields an interval reflecting the uncertainty in x. ...
1
vote
2answers
128 views

Express roots of quadratic equation in a specific form [closed]

By solving this equation, I got two roots as follows: Solve[1 + Subscript[a, 1]*s + Subscript[a, 2]*s^2 == 0, s] Is there a way to express it in the form below ...
0
votes
2answers
41 views

Substituting a Value into an Expression

I am new to Mathematica so pardon me for the elementary question. Can some one kindly explain that what is happening in the simple code below? The With command ...
1
vote
0answers
28 views

How can PowerExpand be made to evaluate the ArcTan form that takes two arguments?

Consider c = Cos[phi]; s = Sin[phi]; ArcTan[c, s] // PowerExpand ArcTan[s/c] // PowerExpand which yields ...
0
votes
0answers
70 views

Using Mathematica to derive an equation

My goal is to obtain Eq. (5) given in this Paper using Mathematica. First we need to define Eqs. (2) and (3) ...
12
votes
5answers
1k views

How to completely delete the head of a function expression

Is there any way to completely remove the head of an expression function? For example, how would I remove the head Cos from ...
1
vote
2answers
102 views

Extract all elements from a list that belong to a set or have a set element as an argument

EDIT: Added that I want to extract not only the variables from a specific set, but also functions involving variables from a specific set. Given the set ...
1
vote
1answer
46 views

Formatting the prime factorization of expressions

I have a series expansion in $x$ and $a,b$ are constants which I want to type in $\LaTeX$. But the numbers/integers are pretty large (have a lot of digits) so it becomes a bit messy in $\LaTeX$. ...
1
vote
1answer
40 views

Rearranging dynamic equations

I'm deriving dynamic equations for a simple system, this is what I get: How can I rearrange these 2 equations into the form like this: My code is: ...
2
votes
1answer
62 views

Separation of variables in an expression

I am looking for the function equivalent of Sympy's function: as_independent (*deps, **hint) in Mathematica. The function naively separates an expression into arguments that are not dependent on deps. ...
3
votes
1answer
32 views
6
votes
1answer
195 views

How to efficiently find all combinations of the letters in an alphabet given a condition

Problem: I want to find all unique expressions with n number of terms that contain all the digits (or characters) in alphabet. ...
3
votes
2answers
234 views

Is there a function in Mathematica which removes brackets wrapping an expression?

Is there a function in Mathematica which removes brackets from an expression? RemoveBrackets[ {3} ] 3 Note: inspired by @garej's answer to this question ...
11
votes
4answers
191 views

Evaluation of Alternatives

I recently stumbled upon a few examples that suggest patterns containing Alternatives do not evaluate for individual alternatives. For example: ...
2
votes
2answers
71 views

intermediate steps of simplification of algebraic expression without evaluation [closed]

I am using MMA do do some algebra and I need to do some simplification. For example, I have the following expression $$ x^2 \left( \frac{6 \left(2 c_1 x^6+c_2\right)}{x^4} \right)-x \left( 4 c_1 ...
1
vote
2answers
79 views

What's the easiest way to remove overall factors from polynomials?

I have code that outputs polynomials (in #1) such as the ones below (note that the trailing Function character ...
4
votes
1answer
147 views

How do I disable that Mathematica orders terms in lexicographic order?

I have matrices with entries where the order of the entries is important. Unfortunately Mathematica resorts terms in products in a lexicographic order. For example, ...
0
votes
1answer
48 views

Simple grouping equations [closed]

I'm new in the Mathematica world. A very basic question. I have been using the command Eliminate on a set of equations as follow: ...
0
votes
1answer
56 views

Eliminate variable on multiple equations [closed]

I'm pretty new with Mathematica. I have to perform a really simple operation, but I'm really struggling with that. I have a set of 4 equations, for example (they can also be more complex): $ AA = 2 ...
5
votes
1answer
70 views

Display position of expression as Tooltip

How could we display the position of any sub expression in an expression using Tooltip? This would be useful for example in order to locate the position of an ...
4
votes
2answers
55 views

Is it possible to match a sequence with multiple heads without using Condition

Suppose I have: expr = Times[2, a[x,r], a[y,1], c[z,0,0], d[w,m]]; If I want to match a sequence of expressions with the same head ...
3
votes
5answers
188 views
5
votes
1answer
75 views
2
votes
1answer
64 views

Is there some way to implement automatic TimeSeries extrapolation or series continuation?

I am working with a large number of TimeSeries of irregular length. This means that if I sum them, or compute the mean, it cuts off at the terminus of the shortest ...
5
votes
2answers
148 views

How to name a repeated pattern sequence inside Plus?

Here is a sample expression that contains a bunch of f and some other stuff: ...
0
votes
0answers
57 views

How do I use Replace All? [duplicate]

I have an expression: a + b 2^(1/2) + (c + d 2^(1/2))*I I want to replace each occurrence of 2^(1/2) with ...
7
votes
3answers
90 views

How to organize expression by symbols (like Collect), but apply different functions to each coefficient

I want to mimic the functionality of Collect[expr, {vars}, func], but with the following modification: The function f that is ...
0
votes
0answers
36 views

Replace function and its derivatives [duplicate]

When I have a complicated expression that depends on some variable, say, $f$, the following usually works ok: Expression ./ { f-> x^2 } But if $f$ is a ...
0
votes
1answer
43 views

Solving a trigonometric equation for all $x$ using constant coefficients

I want to find the coefficients $a$, $b$, $c$, etc. that make an equation like $a+bx=x$ true for all $x$, but for trigonometric functions of $x$. For example ...
1
vote
1answer
68 views

Count number of summands?

Consider fun = a+b+c+d/e If we want to get the number of summands, we can use Length[fun], which properly gives ...
1
vote
1answer
74 views

Extract coefficients from trigonometric polynomial [closed]

Suppose I have: f[r_, ϕ_] = C1 Cos[ϕ]r + C3 Sin[3 ϕ] r + C4 Sin[4 ϕ] r^4; How do I extract the coefficient of a chosen trigonometric term, let's say ...