Solution (source code)

= Solution

Where the original expression is defined, multiplication by $\cos x$ gives
$$
y=\frac{\cos x}{\cos x+\sin x}
=\frac12\left[1+\cot\left(x+\frac\pi4\right)\right].
$$
Thus the graph repeats with period $\pi$ and has vertical <asymptotes>
$$
\boxed{x=-\frac\pi4+k\pi,\qquad k\in\mathbb Z.}
$$
Between consecutive <asymptotes> the extended <cotangent> branch decreases from $+\infty$ to $-\infty$, since $y'=-1/(\cos x+\sin x)^2<0$. It passes through $(k\pi,1)$ and $(\pi/4+k\pi,1/2)$.

It is essential to <preserve the domain when simplifying a function>. At $x=\pi/2+k\pi$, the original tangent is undefined. The finite limiting value is zero, so the graph has \b[holes at $(\pi/2+k\pi,0)$], rather than actual zeros. The simplified expression extends across those points, but the original one does not.

\Image[/past-exam-of-the-mathematics-course-of-the-year-1-of-the-natural-sciences-course-of-the-university-of-cambridge/2014/paper-1-tangent-quotient.png]
{title=The periodic tangent quotient, with vertical asymptotes and the original domain's holes retained}