We are given:
\[
y = \cos \left( \cos^{-1} \frac{1}{2} + \cos^{-1} \frac{x}{2} \right)
\]
Since \( \cos^{-1} \frac{1}{2} = \frac{\pi}{3} \), we get:
\[
y = \cos \left( \frac{\pi}{3} + \cos^{-1} \frac{x}{2} \right)
\]
Let \( \theta = \cos^{-1} \frac{x}{2} \), so we have:
\[
y = \cos \left( \frac{\pi}{3} + \theta \right)
\]
Using the addition formula for cosine:
\[
y = \frac{1}{2} \cos \theta - \sqrt{3} \sin \theta
\]
Now, squaring both sides:
\[
y^2 = \left( \frac{1}{2} \cos \theta - \sqrt{3} \sin \theta \right)^2
\]
Expanding the squares:
\[
y^2 = \frac{1}{4} \cos^2 \theta + 3 \sin^2 \theta - \sqrt{3} \sin 2\theta
\]
Now, use the identity \( \sin^2 \theta = 1 - \cos^2 \theta \) to further simplify:
\[
y^2 = \frac{1}{4} \cos^2 \theta + 3 (1 - \cos^2 \theta) - \sqrt{3} \sin 2\theta
\]
\[
y^2 = \frac{1}{4} \cos^2 \theta + 3 - 3 \cos^2 \theta - \sqrt{3} \sin 2\theta
\]
\[
y^2 = 3 - \frac{11}{4} \cos^2 \theta - \sqrt{3} \sin 2\theta
\]
Next, for \( (x - y)^2 + 3y^2 \):
\[
(x - y)^2 + 3y^2 = 3
\]