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

learn more… | top users | synonyms

22
votes
7answers
894 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?
2
votes
3answers
257 views

Symbolic manipulation of functional form

I have a functional polynomial expression of the form: ...
14
votes
3answers
465 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 ...
2
votes
1answer
133 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 ...
-1
votes
1answer
109 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
119 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 ...
8
votes
1answer
822 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 ...
0
votes
2answers
404 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
137 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 ...
2
votes
2answers
164 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, ...
7
votes
4answers
724 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: ...
1
vote
1answer
505 views
2
votes
1answer
591 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
279 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 ...
6
votes
3answers
274 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 ...
4
votes
1answer
476 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
226 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, ...
9
votes
3answers
710 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: ...
2
votes
3answers
226 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] ...
9
votes
2answers
3k 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 ...
20
votes
1answer
315 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 ...
1
vote
1answer
452 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
257 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
242 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
148 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 ...
13
votes
1answer
401 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
172 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
118 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
114 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: ...
17
votes
3answers
572 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
419 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 ...
11
votes
2answers
597 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 ...