Step 1: Check by differentiation
Take $\tan\frac{x+y}{2} = x + c$ and differentiate: $\frac{1}{2}\sec^2\frac{x+y}{2}\left(1 + y'\right) = 1$.
Step 2: Solve for y'
$1 + y' = 2\cos^2\frac{x+y}{2} = 1 + \cos(x + y)$, so $y' = \cos(x + y)$.
Step 3: Conclusion
This matches the given equation, so (B) is a solution.
Step 4: Other options
For option (A), differentiating $\cot\frac{x+y}{2} = x + c$ gives $-\frac{1}{2}\csc^2\frac{x+y}{2}(1 + y') = 1$, which would make $1 + y'$ negative, so it fails.
Final Answer:
The solution is tan((x + y)/2) = x + c. This is option (B).
\[ \boxed{\text{(B) }\tan\frac{x+y}{2}=x+c} \]