# Error in plotting a quantity involving integral!

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.

• Integral does not converge ? Jun 2, 2021 at 16:52
• To add to @Mariusz: Order-1 pole at t=0: Series[mat2[x, t], {t, 0, 0}, Assumptions -> 0 < x < 1]. Jun 2, 2021 at 17:02

You need to change the lower bound of the integrals. Starting from zero would set the denominators equal to zero and consequently the integrals would not converge. Try to set the lower bound to 0 + ϵ.
intx = Integrate[mat2[x, t], {t, 0.01, 50}];