460 views

### Replace expression, but only “outside” of a function [duplicate]

I have a horrid expression, which is basically a sum of exponents with coefficients. Here's a taste: What I want to do is to replace ks with another expression, ...
33 views

### Substituting variables in only certain environments? [duplicate]

I was integrating a function and got something essentially like E^(mu beta) * (1/beta) There beta is defined as ...
2k views

### How to perform a depth-first preorder traversal of an expression?

Mathematica provides functions that perform a depth-first postorder traversal, or which use such a traversal, including: Scan, ...
2k views

### ReplaceAll is not working correctly

The line of code -E^(-I k) x /. {-x -> -x, -E^(-I k) x -> -E^(I k) x} is not properly replacing the exponential of (-I k) with the exponential of (I k), as ...
440 views

### Pattern to match L, but not L[_]

I have an expression where I want to replace L but not L[_] For example, the following doesn't work and ...
765 views

### Why does {2, 9, 3, 16, 81, 0.09} //. {x_Integer -> Sqrt[x]} evaluate infinite times? [closed]

Here is my code. {2, 9, 3, 16, 81, 0.09} //. {x_Integer -> Sqrt[x]} The pop-up message ReplaceRepeated::rrlim suggests ...
230 views

### How to define a Rule to match a Head except if it is a Part of another?

I have an expr which has List at various levels and I want to display them nicely as a column inside a frame but my problem is ...
430 views

### Replace x, but not x[a] [duplicate]

I want to replace all occurences of the symbol x with x[a], as long as it is not in the form ...
594 views

### Embedding StreamPlot in Graphics3D

I am trying to visualise the action of the infinitesimal generator of a Lie group on the solution of a 2-ODE system drawn in the 3D space (t,y1,y2): t is time and y1,y2 are the two dependent variables....