460 views

### How to transform an expression using algebraical instead of pattern rules [duplicate]

I would like to transform rules algebraically. A very simple example would be: - k^2 - 2 k x + x^2 /. {2*k -> 1} This transforms to: - $$k^2-2 k x+x^2$$ ...
50 views

### How do you make basic substitutions in Mathematica? [duplicate]

I have an equation: e == m*c^2 + (1/2)*c^2*m*v^2 $$e==m c^2 + \frac{1}{2}c^2\space m\space v^2$$ I need to remove the $v$ variable and replace it with $p$. I also ...
36 views

### replacement rules don't account for signs [duplicate]

I would like to make a single replacement rule that disregards the sign. I have the following expression: ...
9k views

### Can I simplify an expression into form which uses my own definitions?

This seems like a simple thing to do, but I couldn't find anything relevant from Mathematica documentation. So suppose I have an expression: a*b/(a + a*Cos[a/b]) ...
14k views

### How do I replace a variable in a polynomial?

How do I substitue z^2->x in the following polynomial z^4+z^2+4? z^4+z^2+4 /. z^2->x ...
3k views

### Replace expressions with symbols

First of all: I'm new to Mathematica, so I would appreciate it if the answers are quite complete. I have the result of calculation that is expressed in $\sin$ and $\cos$. Now, all of these can be ...
468 views

161 views

### Replace an expression with a slightly tricky LHS transformation

I would like to make the substitution x^(11*y) -> r in the following equation x^(11 *y^z) - 1 to end up with: ...