Algebraic simplification of elements in a matrix

The matrix is defined as:

{{(Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (Sqrt[m^2 + p^2] p0 p3 + m^2 (p0 + p3) +
p^2 (Sqrt[m^2 + p^2] + p0 + p3) +
m (p^2 + Sqrt[m^2 + p^2] p3 + p0 (Sqrt[m^2 + p^2] + p3))))/(m +
Sqrt[m^2 + p^2])^(5/2), (Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (-I p2 + Sqrt[
p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/2), (I Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p0 - p3))/Sqrt[m + Sqrt[m^2 + p^2]], (Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (-p2 - I Sqrt[p^2 - p2^2 - p3^2]))/Sqrt[m + Sqrt[m^2 + p^2]]}, {(Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (I p2 + Sqrt[
p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/2), (Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (m^2 (p0 - p3) + p^2 (Sqrt[m^2 + p^2] + p0 - p3) -
Sqrt[m^2 + p^2] p0 p3 +
m (p^2 + Sqrt[m^2 + p^2] p0 - Sqrt[m^2 + p^2] p3 - p0 p3)))/(m +
Sqrt[m^2 + p^2])^(5/2), (Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p2 - I Sqrt[p^2 - p2^2 - p3^2]))/Sqrt[m + Sqrt[m^2 + p^2]], (I Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p0 + p3))/Sqrt[m + Sqrt[m^2 + p^2]]}, {-((I Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p0 + p3))/Sqrt[m + Sqrt[m^2 + p^2]]), (Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (-p2 - I Sqrt[p^2 - p2^2 - p3^2]))/Sqrt[m +Sqrt[m^2 + p^2]], (Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (m^2 (p0 - p3) + p^2 (Sqrt[m^2 + p^2] + p0 - p3) - Sqrt[m^2 + p^2] p0 p3 + m (p^2 + Sqrt[m^2 + p^2] p0 - Sqrt[m^2 + p^2] p3 - p0 p3)))/(m + Sqrt[m^2 + p^2])^(5/2), -((Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(
3/2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (-I p2 + Sqrt[
p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/2))}, {(Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p2 - I Sqrt[p^2 - p2^2 - p3^2]))/Sqrt[m + Sqrt[m^2 + p^2]], (I Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (-p0 + p3))/Sqrt[m + Sqrt[m^2 + p^2]], -((Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(
3/2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (I p2 + Sqrt[
p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/2)), (Sqrt[m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (Sqrt[m^2 + p^2] p0 p3 + m^2 (p0 + p3) +
p^2 (Sqrt[m^2 + p^2] + p0 + p3) +
m (p^2 + Sqrt[m^2 + p^2] p3 + p0 (Sqrt[m^2 + p^2] + p3))))/(m +
Sqrt[m^2 + p^2])^(5/2)}}


How to cancel the roots in the numerator and the denominator of the elements in the Matrix to get a simplified result?

• What, if any, constraints are known about the variables? Which are real or positive or larger than others or ... Commented Nov 12, 2020 at 16:20
• earlier i have used assumption to specify that p0,p1,p2,p3,e and m are reals and e,m>0. But I don't see how to specify it here. Commented Nov 12, 2020 at 19:20

Clear["Global*"]

mat = {{(Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (Sqrt[m^2 + p^2] p0 p3 +
m^2 (p0 + p3) + p^2 (Sqrt[m^2 + p^2] + p0 + p3) +
m (p^2 + Sqrt[m^2 + p^2] p3 +
p0 (Sqrt[m^2 + p^2] + p3))))/(m + Sqrt[m^2 + p^2])^(5/
2), (Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/
2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (-I p2 +
Sqrt[p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/
2), (I Sqrt[m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p0 - p3))/
Sqrt[m +
Sqrt[m^2 + p^2]], (Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (-p2 -
I Sqrt[p^2 - p2^2 - p3^2]))/
Sqrt[m +
Sqrt[m^2 + p^2]]}, {(Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/
2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (I p2 +
Sqrt[p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/2), (Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (m^2 (p0 - p3) +
p^2 (Sqrt[m^2 + p^2] + p0 - p3) - Sqrt[m^2 + p^2] p0 p3 +
m (p^2 + Sqrt[m^2 + p^2] p0 - Sqrt[m^2 + p^2] p3 -
p0 p3)))/(m + Sqrt[m^2 + p^2])^(5/2), (Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p2 -
I Sqrt[p^2 - p2^2 - p3^2]))/
Sqrt[m +
Sqrt[m^2 + p^2]], (I Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p0 + p3))/
Sqrt[m +
Sqrt[m^2 +
p^2]]}, {-((I Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p0 + p3))/
Sqrt[m + Sqrt[m^2 + p^2]]), (Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (-p2 -
I Sqrt[p^2 - p2^2 - p3^2]))/
Sqrt[m +
Sqrt[m^2 + p^2]], (Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (m^2 (p0 - p3) +
p^2 (Sqrt[m^2 + p^2] + p0 - p3) - Sqrt[m^2 + p^2] p0 p3 +
m (p^2 + Sqrt[m^2 + p^2] p0 - Sqrt[m^2 + p^2] p3 -
p0 p3)))/(m + Sqrt[m^2 + p^2])^(5/
2), -((Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/
2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (-I p2 +
Sqrt[p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/
2))}, {(Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (p2 -
I Sqrt[p^2 - p2^2 - p3^2]))/
Sqrt[m +
Sqrt[m^2 + p^2]], (I Sqrt[
m] Sqrt[(m + Sqrt[m^2 + p^2])/m] (-p0 + p3))/
Sqrt[m +
Sqrt[m^2 +
p^2]], -((Sqrt[

m] ((m + Sqrt[m^2 + p^2])/m)^(3/
2) (p^2 + (m + Sqrt[m^2 + p^2]) (m + p0)) (I p2 +
Sqrt[p^2 - p2^2 - p3^2]))/(m + Sqrt[m^2 + p^2])^(5/
2)), (Sqrt[
m] ((m + Sqrt[m^2 + p^2])/m)^(3/2) (Sqrt[m^2 + p^2] p0 p3 +
m^2 (p0 + p3) + p^2 (Sqrt[m^2 + p^2] + p0 + p3) +
m (p^2 + Sqrt[m^2 + p^2] p3 +
p0 (Sqrt[m^2 + p^2] + p3))))/(m + Sqrt[m^2 + p^2])^(5/2)}};

Variables[Level[mat, {-1}]]

(* {m, p, p0, p2, p3} *)


From your comment I assume that all variables are real and m is positive.

Assuming[{Element[{p0, p, p2, p3}, Reals], m > 0},
mat2 = mat // FullSimplify];

LeafCount /@ {mat, mat2}

(* {1331, 545} *)
`