With my limited knowledge of Mathematica, I tried but could not figure out the issues in the following few-line code:

` mat1 = 1/2 ( { {1, -I}, {I, 1} } ); mat2[x_, t_] = {{1/2 - 1/2 Sqrt[1 - 4 x^2] - Sqrt[ 1 - 4 x^2]/(-1 + E^(t Sqrt[1 - 4 x^2])), I x}, {-I x, 1/2 (1 + Sqrt[1 - 4 x^2] + ( 2 Sqrt[1 - 4 x^2])/(-1 + E^(t Sqrt[1 - 4 x^2])))}}; intx = Integrate[mat2[x, t], {t, 0, 50}]; int0 = Integrate[mat2[0, t], {t, 0, 50}]; quantity[x_] := (Tr[ mat1.intx] - Tr[mat1.int0] )^2; Plot[quantity[x], {x, 0, 1}] `

Any help would be greatly appreciated. Thanks.