Detection Angles in Bell-type Experiments Bell-type experiments look at the violation of this inequality: $|S|\leq 2$.
where $S=E(a,b)-E(a,b')+E(a',b)+E(a',b')$ and $E$ is the correlation function.
Mathematically, the maximal violation of the inequality is reached when $|S|=4$ (because the bounds of $\cos \theta_{ab}$ are $\pm 1$).
However, wherever I look in the literature it says that experimentally, quantum states produce a violation up to $|S|\leq 2\sqrt{2}$. That is Tsirelson's bound.
The detector settings are always given in intervals of $\frac{\pi}{8}$ radians. A very common set-up in degrees is: $a = 0$, $a' = 45$, $b = 22.5$, $b' = −22.5$.
They seem to take it for granted that this is THE configuration for maximal violation, without an explanation (I think I'm missing something).  
Why can't the mathematical maximum be achieved experimentally?
Thanks in advance! :)
 A: You seem to be assuming that the four correlation functions are independent, but they are not.  Usually the correlation functions will depend on differences between the angles: $(a-b), (a'-b), (a-b'),$ and $(a'-b')$.  But $(a'-b') = (a'-b) + (a-b') - (a-b)$ so you can't freely adjust the last correlation function. You could set the three positive terms to 1 but you won't then be able to make the last term -1.
A: The Bell inequality you discuss is the CHSH inequality, named after Clauser, Horn, Shimony and Holt who found it in 1969. This is not (by far !) the only Bell inequality, but it is in some sense the optimal inequality for 2 qubit systems. That’s why it is the most discussed inequality.
You have several way to discuss it’s maximal violation, but none of them is obvious :


*

*As @adipy told in the other answer an optimization on the two qubit direction gives you the optimal angles. In full generality, such a proof should include non-planar direction. 

*A more general approach is the one taken by Tsirelson /Cirel’son / Цирельсон /  צירלסון in his 1980 paper, showing that there is now way for a 2-party quantum system with binary measurements to have $\lvert S\rvert>2\sqrt2$. This is what is known as Tsirelson’s bound and you can find a proof of it on the corresponding wikipedia page. This proof relies on generic properties of quantum observables, and is not dependent of a specific implementation, using qubits or single photons.

*The last few years have seen an even more general approach to the Tsirelson bound, linking it to an axiomatic approach to quantum mechanics. The idea is similar to the one sometimes used in thermodynamics, where people used gedanken experiment using perpetual motion in order to understand the foundations of thermodynamics. Applied here, it means showing that access to machines (often called nonlocal boxes) violating Tsirelson's bound would allow to to really surprising things. This line of research doesn’t use the algebraic of quantum mechanics, since it’s goal is to understand why quantum mechanics is the way it is. 

*

*The first paper along these lines I know is by Brassard et al., in 2005 (PRL (paywall) / arXiv (free)), where they showed that having access to boxe with $S>\frac8{\sqrt6}=3.27$ would trivialise communication complexity, $i.e.$ would allow distributed computation any boolean function $f(x,y)$ with a single bit of communication, no matter how big its inputs are or how comlex $f$ is.    

*Pawłowski et al. refound in 2009 (Nature (paywall)/arXiv (free)) refound Tsirelson’s bound ($2\sqrt2$) under a stronger condition they called Information causality : “If Alice send $m$ (classical) bits to Bob, then Bob has only access to $m$ bits of Alice”. For example, if Alice has $N$ bits and Bob want to access some of these bits without telling Alice which ones, the only possibility for ALice is to send $N$ bits of informations to Bob.


