Differentiating $\sin(x+y)+ \cos(x+y) = \log(x+y)$ with respect to $x$. It was given that $$\sin\left(x+y\right)+ \cos\left(x+y\right) = \log\left(x+y\right)$$ and I was asked to find $\frac{dy}{dx}$ for this.
I attempted it as:
$1-$ $$\sin\left(x+y\right)+ \cos\left(x+y\right) = \log\left(x+y\right)$$
$2-$ $$\frac{d}{dx} \left(\sin\left(x+y\right)+ \cos\left(x+y\right)\right) =\frac {d}{dx} \log\left(x+y\right)$$
$3-$ $$\cos\left(x+y\right)\left(1+\frac{dy}{dx}\right) - \sin\left(x+y\right)\left(1+\frac{dy}{dx}\right) = \frac{ \left(1+\frac{dy}{dx}\right) }{x+y}$$
And now in step $4$, term $\left(1+\frac{dy}{dx}\right)$ gets cancelled from both sides and we are left with
$$\cos\left(x+y\right) - \sin\left(x+y\right)= \frac{1}{x+y}.$$
So we don't get any term containing $\frac{dy}{dx}$. So how can I find out $\frac{dy}{dx}$ if I am not getting it, same problem arises if I differentiate it again.

you can cancel $\left(1+\dfrac{dy}{dx}\right)$ only when $\left(1+\dfrac{dy}{dx}\right)\neq0$. But in this case:
\begin{align*}
\sin(x+y)+\cos(x+y)=\log(x+y)\\
\Rightarrow \dfrac{d}{dx}[\sin(x+y)]+\dfrac{d}{dx}[\cos(x+y)]&=\dfrac{d}{dx}[\log(x+y)]\\
\Rightarrow \cos(x+y)\cdot\left(1+\dfrac{dy}{dx}\right)-\sin(x+y)\cdot\left(1+\dfrac{dy}{dx}\right)&=\dfrac{1}{x+y}\cdot\left(1+\dfrac{dy}{dx}\right)\\
\Rightarrow\left(1+\dfrac{dy}{dx}\right)\left[\cos(x+y)-\sin(x+y)-\dfrac{1}{x+y}\right]&=0
\end{align*}
So either $\left(1+\dfrac{dy}{dx}\right)=0\quad$ or, $\quad\cos(x+y)-\sin(x+y)=\dfrac{1}{x+y}$.
Therefore, $\dfrac{dy}{dx}=-1\quad$ or, $\quad\cos(x+y)-\sin(x+y)=\dfrac{1}{x+y}$.
