# Replace bunch of numbers by letter

I want to do following:

ArcTan[1/Sqrt[-1 + (4 Sqrt[2] x^2)/(5 xc^2)]] /.4 Sqrt[2]/5->a^2


I expect to have

ArcTan[1/Sqrt[-1 + x^2/(a^2 xc^2)]]


Mathematica cannot recognize 4 Sqrt[2]/5 in expression.

• Please provide a short but complete example, not just a fragment. Also explain what output you're expecting and what you actually got. – Szabolcs Feb 6 '15 at 18:49
• /.4 is ambiguous, add a space to get /. 4 – Manuel --Moe-- G Feb 6 '15 at 19:10
• I was going to say what @Manuel --Moe-- G noted. I'll add that I for one believe this was a deplorable lexing/parsing decision, made by the wrong person, and retained ever since I have no idea why. The rule everywhere else is that a lexeme is as long as it can be. I will add that this bites me particularly hard because I often need to replace zeros (why that happens I don't know, but it does happen frequently). – Daniel Lichtblau Feb 7 '15 at 22:37

Sqrt[5/3] + 1 /. Sqrt[5/3] -> a

• @belarus28 Copy this as is and execute ArcTan[1/Sqrt[-1 + (4 Sqrt[2] x^2)/(5 xc^2)]] /. 4 Sqrt[2]/5 -> a^2 – Dr. belisarius Feb 6 '15 at 19:01