We are given the differential equation:
\[
(1 + y) \, dx = (1 + x) \, dy
\]
We can separate variables to solve this equation. Rearranging the terms:
\[
\frac{dx}{dy} = \frac{1 + x}{1 + y}
\]
Next, we need to integrate both sides. First, we separate the variables:
\[
\frac{dx}{1 + x} = \frac{dy}{1 + y}
\]
Now, integrate both sides:
\[
\int \frac{1}{1 + x} \, dx = \int \frac{1}{1 + y} \, dy
\]
The integral of both sides gives:
\[
\ln |1 + x| = \ln |1 + y| + C
\]
Exponentiating both sides:
\[
1 + x = A(1 + y)
\]
Where \( A = e^C \) is the constant of integration. Now, solving for \( x \):
\[
x = A(1 + y) - 1
\]
Substituting the constant \( A = \frac{1}{2} \) for simplicity, we get:
\[
x = \frac{y^2}{2} + C
\]
Therefore, the solution is:
\[
x = \frac{y^2}{2} + C
\]
So, the correct answer is (B) \( x = \frac{y^2}{2} + C \).