# Tagged Questions

Questions about Mathematica's rule-based replacement functionality, including functions such as Rule (->), Replace, ReplaceAll (/.) and ReplaceRepeated (//.).

62 views

### Can't operate on vector within a list of rules

I'm trying to set up a list of rules which includes the following: ...
45 views

### Unevaluated derivatives of known functions after replacement

I want to make the following replacement work correctly: Array[(2 D[xM[[#1]][t], t] * D[xM[[#2]][t], t]) &, {3, 3}] /. {xM -> {Sin[ω t], Cos[ω t], 0}} ...
37 views

### Replace function and its derivatives [duplicate]

When I have a complicated expression that depends on some variable, say, $f$, the following usually works ok: Expression ./ { f-> x^2 } But if $f$ is a ...
936 views

### Replacing Tan[x] with Sin[x]/Cos[x]

Why doesn't this work? (1 - Tan[x])/(Sin[x] - Cos[x]) /. Tan[x] -> Sin[x]/Cos[x] I get back: ...
101 views

### Replace and Association

I'm surprised that I can't find this question already, so perhaps I'm missing something obvious. I would like to take a list of associations and remove any with value ...
48 views

### Solving a trigonometric equation for all $x$ using constant coefficients

I want to find the coefficients $a$, $b$, $c$, etc. that make an equation like $a+bx=x$ true for all $x$, but for trigonometric functions of $x$. For example ...
63 views

### Composition of rules: a->b + b->c = a->c

I am trying to compose two rules to form a new one: {a -> b, b -> d} and {b -> c} should become ...
69 views

### Convert an expression to use a specific analytic form

I have an expression that evaluates to an expression containing multiple ExpIntegralEi expressions. However, I would prefer that Mathematica use ...
43 views

### Pattern matching for product of two terms fails if one factor is 1

I have a long set of replacement rules that I utilize to solve some longish integrals over trigonometric functions. Just look at this snippet (from this answer): ...
139 views

### ReplaceRepeated as a Looping construct?

There are a lot of discussions about looping constructs (notable example here). Wolfram language guides, as usually, contain most relevant links. Looping constructs guide has the following part on ...
45 views

186 views

### How to replace an element in a list with an element in another list with matching indices

I have a list like this l = {1 + 2*s, 2 + 3*s, 4 + 1*s}, and I have calculated s = {1, 2, 3}. I need to replace ...
96 views

### How avoid error message with Range?

Evaluating Range[1, n] /. n -> 3 produces an error message ...
186 views

### Approximate UnitStep for use in Enterprise CDF

The following Manipulate code displays the VectorPlot for all functions. (This code is a subset of a more extensive notebook which is based on the structure you see below. Consequently, I need to ...