# Tag Info

Accepted

### How to force Mathematica to simplify in terms of half angles?

Clear["Global*"] expr = Sinh[x]/(Sqrt Sqrt[1 + Cosh[x]]) (expr /. x -> 2 θ // TrigExpand // Simplify) /. θ -> (x/2) // PowerExpand Sinh[x/...
Accepted

### How to make ReplaceAll recognize what to be replaced in a situation like this?

Instead of x + y -> 1 replace only one of the variables x->1-y or y->1-x, it does ...
Accepted

...
Accepted

### With function replace rule does not work in

try this: sumT = TA + TE; With[ {TA = 0.1, TE = 0.2}, Evaluate@{TA + TE, sumT} ]
Accepted

### Different answers when attempting replacement of function argument

Look at: fib1[n] -1 + n fib1[n] /. n->10 9 And for fib2: fib2[n] 2 Here the ReplaceAll does nothing.

### With function replace rule does not work in

In answer to Could you give some explanation ? Just follow the evaluation process With[ {TA = 0.1, TE = 0.2}, {TA + TE, sumT} ] ...

### With function replace rule does not work in

Replace With with Block: sumT = TA + TE; Block[{TA = 0.1, TE = 0.2}, {TA + TE, sumT}] {0.3,...

### How to make ReplaceAll recognize what to be replaced in a situation like this?

New answer based upon your revised question: rep[f_] := Expand[f] /. Plus[Times[a_, _Symbol], Times[b_, _Symbol]] :> a 2 x + 2 y // rep 2 ...
Accepted

### Why is replacement so slow for long sums?

I believe the code is slow because Integrate will try to evaluate the intermediate expressions before they are fully resolved. You may try using ...

### How to make ReplaceAll recognize what to be replaced in a situation like this?

Another way to do this is as follows: rep = # /. s_Symbol /; Attributes[s] === {} -> 1 &; rep@(2 x + 2 y) (*4*) rep@Exp[I Pi (2 a + 2 b + 5)] (*-1*)
1 vote

### How to make ReplaceAll recognize what to be replaced in a situation like this?

ReplaceAll simply replaces pattern, not the value. And you have no x+y pattern in that expression. Try ...
1 vote
Accepted

### ReplaceAll that works inside Rational?

...

Only top scored, non community-wiki answers of a minimum length are eligible