# How to substitute value of one variable from an equation in another to get the desired result?

I have this equation

{(Sqrt[m] ((e + m)/m)^(3/2) (e^2 p0 + m^2 p0 + 2 m (p1^2 + p2^2 + p3^2) +
p0 (p1^2 + p2^2 + p3^2) + 2 e (m p0 + p1^2 + p2^2 + p3^2)))/(e + m)^(5/2)}


I want to use

p^2=p1^2+p2^2+p3^2;


and

e^2=p^2+m^2


to simplify the 1st equation. How can I replace the variables and simplify the equation? I have more equations to simply in this way, what is the most general way to approach it?

• Perhaps Eliminate? Nov 11 '20 at 12:42
• Well I cant equate my equation with 0, So, I don't think it will work. Nov 11 '20 at 15:11

## 1 Answer

Try

expr={(Sqrt[m] ((e + m)/m)^(3/2) (e^2 p0 + m^2 p0 + 2 m (p1^2 + p2^2 + p3^2) +
p0 (p1^2 + p2^2 + p3^2) + 2 e (m p0 + p1^2 + p2^2 + p3^2)))/(e + m)^(5/2)}

expr /. {p1 -> Sqrt[p^2 - p2^2 - p3^2] ,e -> Sqrt[p^2 + m^2]} // Simplify
(*{(2 Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (m^2 p0 + p^2 (Sqrt[m^2 + p^2] + p0) +
m (p^2 + Sqrt[m^2 + p^2] p0)))/(m + Sqrt[m^2 + p^2])^(5/2)}*)

• Yeah, it does simply but only to an extent. Why Simplify or even FullSimplify isn't able to cancel the sq. root terms? I would prefer more simplification. Nov 11 '20 at 15:13
• The sqrt-terms depend on m and p, e is eliminated. What kind of simplification you're looking for? Nov 11 '20 at 15:33
• I was hoping that the square root terms in the numerator and denominator would cancel. Nov 11 '20 at 19:04