# Mathematica not Simplifying?

The function

    fun[x_, y_,
z_] = (4 y^2 - x^2 Cos[1/2 Sqrt[-x^2 + 4 y^2] z] -
x Sqrt[-x^2 + 4 y^2]
Sin[1/2 Sqrt[-x^2 + 4 y^2] z])/(\[Sqrt](2 x^2 y^2 + 16 y^4 -
8 x^2 y^2 Cos[1/2 Sqrt[-x^2 + 4 y^2] z] +
x^2 (x^2 - 2 y^2) Cos[Sqrt[-x^2 + 4 y^2] z] -
8 x y^2 Sqrt[-x^2 + 4 y^2] Sin[1/2 Sqrt[-x^2 + 4 y^2] z] +
x^3 Sqrt[-x^2 + 4 y^2] Sin[Sqrt[-x^2 + 4 y^2] z]));


when checked for different values of x,y,z always comes out to be 1, say fun[0.1, 0.2, 0.3]=1. However, Mathematica is not able to show this in the first place!

     Simplify[fun[x, y, z]]

Out= (4 y^2 - x^2 Cos[1/2 Sqrt[-x^2 + 4 y^2] z] -
x Sqrt[-x^2 + 4 y^2]
Sin[1/2 Sqrt[-x^2 + 4 y^2] z])/(\[Sqrt](2 x^2 y^2 + 16 y^4 -
8 x^2 y^2 Cos[1/2 Sqrt[-x^2 + 4 y^2] z] +
x^2 (x^2 - 2 y^2) Cos[Sqrt[-x^2 + 4 y^2] z] -
8 x y^2 Sqrt[-x^2 + 4 y^2] Sin[1/2 Sqrt[-x^2 + 4 y^2] z] +
x^3 Sqrt[-x^2 + 4 y^2] Sin[Sqrt[-x^2 + 4 y^2] z]))

• Are you making assumptions on x, y, and z? Mathematica won't know about those unless you specify them. Feb 10 at 10:35
• I even tried with assumptions that $x\ge0, y\ge0,z\ge0$, but it doesn't work!
– Mike
Feb 10 at 10:46

Look for instance at

z = 0.7; Plot3D[fun[x, y, z], {x, -3, 3}, {y, -3, 3}]


then you see why.

With

fun[x_, y_, z_] = (4 y^2 - x^2 Cos[1/2 Sqrt[-x^2 + 4 y^2] z] -
x Sqrt[-x^2 + 4 y^2]
Sin[1/2 Sqrt[-x^2 + 4 y^2] z])/(\[Sqrt](2 x^2 y^2 + 16 y^4 -
8 x^2 y^2 Cos[1/2 Sqrt[-x^2 + 4 y^2] z] +
x^2 (x^2 - 2 y^2) Cos[Sqrt[-x^2 + 4 y^2] z] -
8 x y^2 Sqrt[-x^2 + 4 y^2] Sin[1/2 Sqrt[-x^2 + 4 y^2] z] +
x^3 Sqrt[-x^2 + 4 y^2] Sin[Sqrt[-x^2 + 4 y^2] z]));


fun[x, y, z]^2 // FullSimplify