Step 1: Start with the given equation:
\[
\cos y = x \cos (a + y)
\]
Step 2: Differentiate both sides with respect to \( x \):
\[
\frac{d}{dx} \left( \cos y \right) = \frac{d}{dx} \left( x \cos (a + y) \right)
\]
Step 3: Using the chain rule on the left side:
\[
-\sin y \frac{dy}{dx} = \frac{d}{dx} \left( x \cos (a + y) \right)
\]
Apply the product rule on the right side:
\[
-\sin y \frac{dy}{dx} = \cos (a + y) - x \sin (a + y) \frac{dy}{dx}
\]
Step 4: Isolate \( \frac{dy}{dx} \):
\[
\left( -\sin y + x \sin (a + y) \right) \frac{dy}{dx} = \cos (a + y)
\]
Step 5: Solve for \( \frac{dy}{dx} \):
\[
\frac{dy}{dx} = \frac{\cos (a + y)}{-\sin y + x \sin (a + y)}
\]
Using the trigonometric identity, the expression simplifies to:
\[
\frac{dy}{dx} = \frac{\cos^2 (a + y)}{\sin a}
\]
Thus, the required result is proved.