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

learn more… | top users | synonyms

1
vote
1answer
318 views

How can I get Mathematica to write Log instead of ArcTan?

ArcTan really bothers me, so is there a way to make Mathematica write Logarithm instead of ...
7
votes
4answers
264 views

Counting multiplications (complexity function)

I'm trying to count the number of times multiplication appears in an expression (for the purpose of constructing a ComplexityFunction that would help me simplify a terrible algebraic expression for ...
2
votes
1answer
140 views

Indexing of Large Autonomous System of Equations for Use in NDSolve

I currently have a list of ~150 autonomous DAE's (differential-algebraic equations) that I need to be able to work with using NDSolve. Fortunately I already have ...
2
votes
3answers
208 views

Symbolic manipulation of functional form

I have a functional polynomial expression of the form: ...
2
votes
1answer
112 views

Examine function parameters programmatically

I write a lot of scripts in Mathematica and I'd like to eliminate the boilerplate that parses command-line arguments and assigns them to variables of the correct type before doing the real work. I was ...
14
votes
3answers
401 views

Comparing Mathematica expressions like diff

I am looking for a way to compare (or "diff") two Mathematica expressions, similarly to how to diff utility can compare two text files and report the differences. Has anyone already written such a ...
-1
votes
1answer
85 views

How to extract the coefficient from an expression

Here is the expression. I want to extract the coefficient just as the table showing below. I can do it by hand, but I expect a code that can automatically identify how many differenct terms ...
1
vote
1answer
115 views

Trying to show an expression is always zero

I have a symbolic matrix $$m = \begin{pmatrix}A1 & B1 & C1\\A2 & B2 & C2 \\ A3 & B3 & C3\end{pmatrix}$$ and I believe that Det[m] is ...
9
votes
1answer
207 views

Why is ReplaceAll behaving like this?

I'm learning to use the ReplaceAll function and I found the behavior of which is quite confusing. For Sqrt[f[x, y]] /. f[___] -> u Mathematica returns ...
0
votes
2answers
250 views

Dropping Higher Order Terms in symbolic evaluation

I have a series of symbolic manipulations (along with some coefficients). As a sample, here is one of the intermediate forms ...
1
vote
1answer
114 views

Match and replace subexpression

I would like to replace the expresion $(n1-1)$ to $z1$ in following: In[1] := 2*n1*p[n1-1,n2] Out[1] := 2*(z1+1)*p[z1,n2] I have tried ...
1
vote
2answers
208 views
2
votes
2answers
135 views

How to change the Integer to a special form in an expression?

I have an expression. I want to change all the Integers to a new form. The rule is, x_Integer->x._f. But we should consider some special cases. For example, ...
6
votes
4answers
409 views

Extracting variables from an expression

I'm looking for a way to extract a list of variables from an expression, for example with an input like: ...
2
votes
1answer
433 views

Variable name string to expression

I'm not sure how to name this problem appropriately. But anyway. I have, say, three variables (arrays in my case), which I call: A1, A2, A3 I would like to ...
6
votes
2answers
239 views

How to get the matrix coefficient from a QuadraticForm expression in a very fast way?

As we know, QuadraticFormDistribution is the distribution of z.a.z + b.z + c for a real-valued p x p symmetric positive definite ...
15
votes
1answer
374 views

List manipulation to build a functional expression

Since Mathematica deals with Head[a, b] as an expression in this way The first Part of Head[a, b] is ...
21
votes
7answers
803 views

How do I get my equation to have the form $(x-a)^2 + (y-b)^2 + (z-c)^2-d = 0$?

I want Mathematica to express the equation $$-11 - 2 x + x^2 - 4 y + y^2 - 6 z + z^2=0$$ in the form $$(x - 1)^2 + (y - 2)^2 + (z - 3)^2 - 25=0$$ How do I tell Mathematica to do that?
4
votes
1answer
367 views

Behavior of expression evaluation in Plot

I'm confused with Mathematica's way of parsing expressions. I've been struggling with this for a while and never found an exhaustive answer, sometimes things don't parse the way I think they would ...
5
votes
2answers
187 views

How can I retrieve the point coordinates from a LOG Plot after the data points were manually moved?

I'm having problems with getting coordinates out ofa ListLogLogPlot I basically plotted a list, then selected data points on the graph, moved these points around, ...
1
vote
1answer
371 views

Graph and manipulate DSolve result

Given a DSolve example: ...
8
votes
3answers
526 views

Pattern matching a pattern with patterns

Confusing title, I know. But the question is, if we have two patterns which have the same general structure but different names used in the patterns and different names: ...
8
votes
1answer
633 views

How do I expand a sum?

I have a problem with Mathematica's symbolic manipulations. As an example, consider the following expression: $$\sum _{i=1}^n -2 x_i \left(-a x_i-b+y_i\right)=0$$ How do I get Mathematica to expand ...
2
votes
3answers
172 views

how to extract some terms out from an expression

I have an expression as below´╝Ü $-\frac{1}{2} A[a,v] A[b,h] A[c,v] A[d,h] \text{Cos}[\theta ]^2+\frac{1}{2} A[a,h] A[b,v] A[c,v] A[d,h] \text{Cos}[\theta ]^2+\frac{1}{2} A[a,v] A[b,h] A[c,h] A[d,v] ...
11
votes
1answer
160 views

What are the default TransformationFunctions used in Simplify and FullSimplify?

If I do Simplify[(c^3 - s^3)^2 - (s^3 + c^3)^2, TransformationFunctions -> Automatic] (i.e. a verbose version of default behaviour), what transformation ...
6
votes
3answers
247 views

Threading Distribute[]

I wish to use Distribute[p.(q+r)+m] to get p.q+p.r+m. However, Distribute apparently does not thread through all parts of the ...
20
votes
1answer
282 views

How can I see which transformations Simplify attempts?

The documentation for Simplify[expr] says that it performs a sequence of algebraic and other transformations on expr, and returns the simplest form it finds. How can I see which transformations it ...
9
votes
2answers
2k views

How to expand tan(x+y) as normal form?

TrigExpand@Tan[x + y] gives $\frac{\sin (x) \cos (y)}{\cos (x) \cos (y)-\sin (x) \sin (y)}+\frac{\cos (x) \sin(y)}{\cos (x) \cos (y)-\sin (x) \sin (y)}$ but I ...
1
vote
1answer
290 views

Comparing two symbolic expressions

Does Mathematica provide any way to compare two symbolic expressions and find which is the greatest? For example, I want to find which is the greatest of ...
11
votes
5answers
245 views

Construct an infix operation from a list

Inspired by this question, if I have a list {a, p, b, q, c} where p and q are binary ...
1
vote
0answers
221 views

Can mathematica simplify an expression setting simplified answer equal to zero?

Basically I want to reduce something like: Subscript[P, 4] - Subscript[P, 5] == Subscript[R, 4, 5]* Subscript[i, 4, 5] when only one of them is known (...
3
votes
0answers
143 views

Why doesn't Log[Gamma[]] simplify to LogGamma[] where it could?

I have been playing with various equations involving amount of permutations in relatively large sets. Easiest way to look at these is something like Log[10, bignumber!] . Often expressions, even ...
12
votes
1answer
319 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. ...
3
votes
1answer
154 views

Change values in equation with slider

I want to make an equation where the values adjust to my slider which I inserted with manipulate. Well, I tried, but when I use the slider the equation starts to fall apart. Actually this should ...
3
votes
2answers
105 views

Subvalue and level

I'm interested in the arguments of f in expressions like f[a]@f[b]@f[c] By argument I mean what is here ...
2
votes
1answer
103 views

How to prevent substitution?

I have a function: $\bar{u}:=u[t,x,y,z]$ (1) How do I prevent it from expanding and substituting in instructions like those following: $\partial _t {\bar u}$ (2) Thanks in advance EDIT: ...
1
vote
3answers
316 views

How to manipulate nested expressions?

I have the following expression, only slightly complicated, and I'd like to do two things: Plot the elements of the lists (though messy, all are in the same ...
11
votes
2answers
541 views

Google Code Jam: Mountain View code review

After participating in Google Code Jam 2012 Round 2, it occurred to me that the Mountain View problem boiled down to solving a set of linear inequalities, which could be done in Mathematica. I've only ...
9
votes
2answers
502 views

Displaying a series obtained by evaluating a Taylor series

Description of problem I would like to use Mathematica to display the series obtained by substituting a value for $x$ in a Taylor series expansion. The terms of the series will be rational numbers, ...
17
votes
3answers
491 views

How can I completely ban usage of some functions in output and mandate use of others?

For example, I hate that Mathematica uses Pochhammer symbol in outputs and prefer all the expressions in Gamma function. How can ...
10
votes
4answers
376 views

Extracting equations from Piecewise expressions

Say I have a PDF: PDF[LogNormalDistribution[1.75, 0.65], x] Calculating it, Mathematica gives me an expression that looks like this: I want to extract the ...
37
votes
2answers
938 views

Head and everything except Head?

I have been working on picking expressions apart using Head and Part and encountered a little mystery. Consider the canonical ...
32
votes
3answers
440 views

Replace inside Held expression

I wish to make functional replacement inside Held expression like this: ...