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

learn more… | top users | synonyms

0
votes
0answers
59 views

Loop in a loop, or how to evaluate complex expressions

I need to find $h_{0j}$ for every $1\leq j\leq300$, where \begin{multline*} h_{0j} = \sum_{q=1}^{Q}g_qe^{-\lambda_q j\Delta}\frac{e^{\lambda_q\Delta}-1}{\lambda_q} + \sum_{p=1}^{P}\frac{e^{-\alpha_p ...
3
votes
4answers
120 views

Print all numbers from a sequence which don't contain the digit 7

so i have this: Cases[RecurrenceTable[{a[n + 1] == 7 a[n] + n, a[1] == 1}, a, {n, 7}], Except[7]] But i noticed that it will only exclude numbers that are 7, and ...
0
votes
2answers
56 views

Get constant term with `Coefficient` for a non-polynomial

Take a nonlinear equation such as exp = (x + 3)/4 + Exp[x] + 1 + (c + x) Note that this is not a polynomial. Now, I want to extract the coefficients of this. ...
1
vote
1answer
70 views

Work around bugs in Summation, Hypergeometric function?

I'm so confused I don't even know how to phrase the question, so here's what's happening: I need an analytic form for this: ...
4
votes
1answer
53 views

Factoring out parts of an expression

I'm looking to factor out the parts of a multiplication type of expression. For example for the expression: $$20 e^{-t^2}\frac{t^2}{\sqrt{t^2+a}} erf(b+t)$$ I'd like to get a list in the form of: ...
1
vote
2answers
50 views

Subsituting expressions for expressions

I'm trying to define functions using other functions, like so: f[a_, b_] := a/b; a[c_] := c; b[d_] := d; Now what I want to be able to do is two things: ...
1
vote
3answers
189 views

How to manage list of list of rules?

Considering we have a list: str = "{1 -> {a -> aa, b -> bb}, 2 -> {2a -> \"{b -> bb}\"}}" Bringing this to expression gives: ...
2
votes
5answers
75 views

How to convert string to integer list?

Saying we have a string: "1 2 3 4 5 6" I want to convert this to integer list. First I do: ...
1
vote
2answers
54 views

How to list variables given equation? [closed]

Given an expression, is there any means to list variables? Example: a^3 + b^2 + c -> a,b,c I need this functionality because I am manipulating large expressions of many variables (20) and would ...
0
votes
0answers
24 views

Find out domain after change of variable in integral of d dimensions

Is there a way to tell Mathematica the change of variable you want to do and getting back the corresponding domain? The specific problem I am trying to solve is $\quad \quad\int_{-1}^0 ...
2
votes
1answer
77 views

How to parse string to expression? [closed]

When trying to make a string an expression I see some wrong results: ...
2
votes
2answers
57 views

Extracting numerical coefficients from an expression

I have very large expression and I want to extract and sum up all the numerical coefficients which multiply the summands. For example, expr = x + 2*y + 3*z*w ...
2
votes
1answer
57 views

Pull out scaling factor from a denominator

How do I force mathematica to just pull out the scaling factor of 1/r from this expression. (a+b)/r edit: Sorry, perhaps my earlier formulation of the question wasn't clear enough. I would like ...
0
votes
0answers
27 views

Extract the divergent/bounded part of a certain expression

Consider I have a power series which is function of $x$. A part of this expression is bounded when $x->\infty$, some remainder is on the other hand divergent when $x$ goes to infinity. What is the ...
1
vote
1answer
39 views

How to separate linear terms by output?

I am performing a complicated summation in which fa is a Sum of a[j] over j, and terms in fa end up containing a BesselJ, a Hypergeometric0F1, or neither. ...
5
votes
5answers
126 views

Isolating cross terms

I have a set of expressions that contains terms like $\frac{1}{(x + a + b)(c+d)}$. I would like to simplify the denominator so that products of $a,b,c,d$ are dropped, but $x c$ and $x d$ are kept. ...
1
vote
1answer
40 views

Expand an expression to only built in functions

This question is hard to phrase and even harder to google. Maybe it's best to explain it with a very simple example. ...
2
votes
3answers
80 views

Drop terms in expression

Suppose I have an expression of the this type: Quantity["Epsilonzero"] a (b + c Sin[ω t])^2 where t is time. I am interested in "extracting" the non ...
0
votes
3answers
48 views

Assigning a value to specific product [closed]

I was wondering if there is a way to assign a value to a specific problem. For example if I wanted $a\cdot a$ to equal $-1$. How would I go about doing that?
0
votes
1answer
54 views

Prevent a sum from simplifying? [duplicate]

Basically, I want to prevent a sum from cancelling or summing together the individual summands and just display them separately next to each other. Example: ...
0
votes
1answer
43 views

Why returning False? [closed]

Can anyone explain the false? I'm trying to grab co-efficient in front of X^2 I think. I say I think as I'm following my tutors example using his screenshot the only difference between his question ...
0
votes
1answer
49 views

Help for properly writing simple derivative expression

I need help to write the following expression (only 1 iteration): f(x) = ...some basic function... f[X0,...,Xp] = f(p)(x0) / p! What I have so far: ...
3
votes
4answers
169 views

Simplify binary expressions

Is it possible for Mathematica to do simplifications for expressions where the variables are binary, such as: a + b = 1 + 2*c => a + b = 1 Here c must be 0 because if it is 1, the RHS is 3 but ...
3
votes
1answer
121 views

Write Integer powers as products

I need to wirte all occasions of (a+b)^3,Ftp^2, Sin[th]^2, ...etc as (a+b)*(a+b)*(a+b), Ftp*Ftp, Sin[th]*Sin[th], ...etc ...
0
votes
1answer
29 views

Obtain the values of all Sub- and/or Superscripts from an expression?

Let Expr be an expression that can be practically any combination of variables. Now I can check whether this expression contains any subscripts or superscripts with ...
2
votes
3answers
503 views

Replace all integers by 1?

Let list1 be a list of variables of the form {c1 a, c2 b, ...} where $a,b,...\in\mathbb{C}$ and $c1,c2,...\in\mathbb{Z}$. I am ...
2
votes
1answer
47 views

How can I drop the “belongs to integers” part from Reduce output?

I have this Mathematica line: Reduce[1/(E^0)^x + 1/(E^1)^x + 1/(E^3)^x == 0, x] that gives the output: ...
2
votes
2answers
57 views

How do I extract the value of a 'Style'?

I have a Style displaying an underlying Real value. For example I might have ...
10
votes
2answers
252 views

How to do algebra on summations of variable expressions?

Is there any easy, general way to handle algebra on variable Sums? For examples, Gaussian Mixtures or Fourier Series: ...
2
votes
0answers
78 views

TrigExpand Idiosyncracies

TrigExpand[Sin[x]^2 Log[y]] returns sin^2(x) log(y), as one would expect. However, ...
1
vote
1answer
82 views

Collect powers of variables and integers separately?

Let expr contain a sum of powers of x with some coefficients ci. The exponents of ...
2
votes
1answer
114 views

Derivatives of functions with arbitrary number of variables?

I am trying to define a function f[x1,x2,...,xn] with n integer but not specified. And then I would like this funktion to behave ...
3
votes
1answer
43 views

Conditional replacement of all occurrences of a variable?

I know there is functionality in Mathematica to perform replacements like: x[a] d[a,b]/.y_[z_] d[z_,p_]->y[p] Which naturally gives ...
6
votes
4answers
162 views

Expression manipulation: Explode sums and products? [duplicate]

I wonder if the functionality exists to explode a sum, or product? What I mean by that is the following. Imagine, you have input data data = a + b c - d e f ; Is ...
2
votes
2answers
208 views

How can I get Solve to combine Sin/Cos into Tan?

I want to solve an equation in x, containing Sin[x], Cos[x] and a positive real constant ...
0
votes
1answer
85 views

Factor out square root terms [closed]

How to go from Sqrt[x^3]Sqrt[x - a x]/x to x Sqrt[1 - a]? All terms inside square are positive.
2
votes
1answer
61 views

Range and decimal digits [duplicate]

When I set Plot[Sin[x], {x, -2, -1}, Frame -> True, Axes -> False, FrameTicks -> {{Automatic, Automatic}, {Range[-2, -1, 0.2], Automatic}}] I ...
6
votes
6answers
196 views

Trying to write out the prime factorization of a number with CenterDot and Superscript

I am trying to use CenterDot and Superscript, in conjunction with Apply to write out the prime factorization of any given integer. Everything works well UNLESS the prime factorization of the number ...
5
votes
4answers
251 views

Concatenating strings, unevaluated expressions and evaluated expressions/values

Maybe this is something very simple to some of you. Anyway, I think this can be useful to many others like me. I would like to build an output that involves strings, unevaluated expressions and ...
8
votes
2answers
213 views

Keep Mathematica from simplifying functions with a specified Head

I want to run Simplify and/or Refine on various expressions, but keep it from touching anything that contains a specific ...
3
votes
3answers
106 views

Unexpected Behaviour with local variables and ToExpression

I encountered an unexpected behaviour in my mathematica-code, and want to understand whether that's a mathematica bug, or a misinterpretation on my side. ...
4
votes
2answers
192 views

Time-efficient creation of matrix

I have expressions like xx1=FF[1, 1] GG[1, 1] + FF[1, 1] GG[2, 2] + FF[2, 2] GG[2, 2] xx2=2*FF[1, 2] GG[1, 1] + FF[1, 1] GG[1, 2] + FF[2, 2] GG[2, 2] and I want ...
3
votes
2answers
116 views

Time-efficient manipulation (zeroing) of expression

I have huge matrices in the form of ...
2
votes
1answer
121 views

Extracting rational coefficients from an irrational sum [closed]

I have a function that returns results that always can be represented as $p+q\,\pi^2+r\ln2+s\ln^22+t\sqrt2$ where $p,q,r,s,t\in\mathbb Q$. But the actual Mathematica expression returned not always in ...
2
votes
3answers
89 views

Problem with InverseFunction of Sqrt

I want to build a table of InverseFunctions, f.e.: ...
-1
votes
1answer
126 views

How to get solution from DSolve

How to get the solution from DSolve in such way that there is no need to copy the result. When for example solving: ...
4
votes
1answer
94 views

How do I constrain variables to a user-defined domain in ArgMax?

I am trying to ArgMax a function over x, but x is only defined between ...
8
votes
1answer
118 views

How to get a list of all expressions in a notebook matching a certain pattern?

Suppose I have a Mathematica notebook saved to a certain location on disk. Given a pattern I need to get the list of all expressions matching this pattern that appear in input, output or print cells ...
1
vote
1answer
55 views

Can someone please help me to state assumption?

I am currently trying to solve under what condition does the following term will be zero? ...