Gordon, I don't see what you're trying to prove here. I'm assuming you're asking for a derivation of the CHSH inequality with your given conditions. If so, I'll give it a go:
Starting with A(a,x)=\pm 1 B(b,x)=\pm 1 andE(A,B)= \int AB p(x) dx We can write E(A,B)= \int A(a,x)B(b,x)p(x)dx Since a, a', b, b' are settings for the detector we show that E(a,b)-E(a,{b}')=\int [A(a,x)B(b,x)-A(a,x)B({b}'x)]p(x)dx =\int A(a,x)B(b,x)[1 \pm A({a}'x)B({b}'x)] p(x)dx - \int A(a,x)B({b}',x)[1 \pm A({a}',x)B({b}',x)]p(x)dx Using the first inequality, we know that the quantities [1 \pm A({a}',x)B({b}',x)]p(x) and [1 \pm A({a}',x)B({b},x)]p(x) are non-negative. Also, we will use the triangle inequality on each side \left | E(a,b)-E(a,{b}') \right |\leq \int [1 \pm A({a}',x)B({b}',x)]p(x)dx]+\int [1 \pm A(a,x)B(b,x)]p(x)dx
Since \int p(x)=1 we can simplify to \left \lfloor E(a,b)-E(a,{b}') \right \rfloor\leq 2\pm[E({a}',{b}')+E({a}',b)] Which includes the CHSH inequality, with a maximum value of 2. As per usual.
QED