How to calculate the probability of finding an electron in a box between 0.25L and 0.75L?
You have the reasoning correct, so I suspect you made a mistake in your integral calculation. The probably of finding the particle between $a$ and $b$, for the $n$-th state, is indeed given by:

$$P_n(a,b) = \int_a^b \left|\psi_n(x)\right|^2\, \mathrm{d}x $$

but if I do the calculation for the ground state ($n = 1$), I find the same results as your textbook:

$$ P_1\left(\frac{L}{4},\frac{3L}{4}\right) = \frac{1}{2} + \frac{1}{\pi} \approx 0.818 $$