Question: Replacing sub-expressions inside an expression by a variable

Hello,

Attached is my code where the output of interest is the variable X. What I am trying to do is replace anywhere in this expression that I see "sqrt((nx^2+ny^2+nz^2)c^2) by the variable phi in order to make the expression easier to look at and interpret. This should be a relatively easy thing to accomplish, however I have had problems with doing this. Ive tried using algsubs etc. but nothing seems to work. Could anyone show me how to do this? Is there an easy method that works for doing this for similar problems in the future? I have run across this problem before so I would love to know how to solve it for the future. Thanks in advance.

Also pretty new to maple so thanks for your patience.

 

 

Please Wait...