1

I found an entry of a matrix from two different methods using mathematica. Which are given as;

g/(Sqrt[2] Sqrt[1 + g^2 - Sqrt[1 + g^2]])

and

1/Sqrt[2 + (2 - 2 Sqrt[1 + g^2])/g^2]. 

Logically these expression should be same, and they simplify to same result when i do it on paper. But when i plot these expressions for {g,-5,5}, it gives different plots on mathematica. What is happening?

Usman
  • 157
  • 7

1 Answers1

2

These are two simplifications of the same second expression with different ConplexityFunction used:

 Simplify[1/Sqrt[2 + (2 - 2 Sqrt[1 + g^2])/g^2], g > 0]

Simplify[1/Sqrt[2 + (2 - 2 Sqrt[1 + g^2])/g^2], g > 0, 
 ComplexityFunction -> (StringLength[ToString[#]] &)]

yielding the following:

(*  1/Sqrt[2 + (2 - 2 Sqrt[1 + g^2])/g^2]  *)
(*  g/(Sqrt[2] Sqrt[1 + g^2 - Sqrt[1 + g^2]])  *)

Have fun!

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96