# Plotting an integral over a range of values

I would like to evaluate the following integral

$$\int_{1}^{(x^{2}+1)/2x} dy \sqrt{y^{2}-1} \left(\frac{2x^{2}-6xy+3 + x^{2}y^{2}}{x^{2}\left(x-2y\right)^{2}}\right)$$

over a range of values of $x$ from $0$ to $2$ and plot the resulting integral.

Can you help me with this?

This integrates faster if we just integrate it as indefinite and then use FTC. Assuming the integral is proper, which I did not check.

ClearAll[x, y, k];
num = 2 x^2 - 6 x y + 3 + x^2 y^2;
den = x^2 (x - 2 y)^2;
int = Integrate[Sqrt[y^2 - 1] num/den, y]


upper = Limit[int, y -> (x^2 + 1)/(2 x)];
lower = Limit[int, y -> 1];
(upper - lower) // Simplify


f[x_] := Evaluate[upper - lower];

Plot[Chop@f[x], {x, 0, 2}, Frame -> True,
FrameLabel -> {{"integral", None}, {"x", "integral over x"}},
GridLines -> Automatic, GridLinesStyle -> LightGray,
Exclusions -> None, BaseStyle -> 14, PlotStyle -> Red]