# How do you find dy/dx by implicit differentiation given y=cos(x+y)?

Dec 21, 2016

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \frac{x + y}{1 + \sin \left(x + y\right)}$

#### Explanation:

Method 1: Expand and use the product rule

We expand using the formula $\cos \left(A + B\right) = \cos A \cos B - \sin A \sin B$.

$y = \cos x \cos y - \sin x \sin y$

$\frac{d}{\mathrm{dx}} \left(y\right) = \frac{d}{\mathrm{dx}} \left(\cos x \cos y - \sin x \sin y\right)$

$\frac{d}{\mathrm{dx}} \left(y\right) = \frac{d}{\mathrm{dx}} \left(\cos x \cos y\right) - \frac{d}{\mathrm{dx}} \left(\sin x \sin y\right)$

Remember that we are differentiating with respect to $x$ here.

$1 \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) = - \sin x \left(\cos y\right) - \sin y \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) \left(\cos x\right) - \left(\cos x \left(\sin y\right) + \cos y \left(\sin x\right) \frac{\mathrm{dy}}{\mathrm{dx}}\right)$

Solve for $\frac{\mathrm{dy}}{\mathrm{dx}}$:

$1 \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) + \sin y \cos x \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) + \cos y \sin x \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) = - \sin x \cos y - \cos x \sin y$

$\frac{\mathrm{dy}}{\mathrm{dx}} \left(1 + \sin y \cos x + \cos y \sin x\right) = - \left(\sin x \cos y + \cos x \sin y\right)$

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \frac{\sin x \cos y + \cos x \sin y}{1 + \sin y \cos x + \cos y \sin x}$

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \frac{\sin \left(x + y\right)}{1 + \sin \left(x + y\right)}$

Method 2: Use the chain rule

Let $y = \cos u$ and $u = x + y$. Then $\frac{\mathrm{dy}}{\mathrm{du}} = - \sin u$ and $\frac{\mathrm{du}}{\mathrm{dx}} = 1 + \frac{\mathrm{dy}}{\mathrm{dx}}$.

The derivative is given by color(magenta)(dy/dx= dy/(du) xx (du)/dx.

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin u \times \left(1 + \frac{\mathrm{dy}}{\mathrm{dx}}\right)$

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin u - \frac{\mathrm{dy}}{\mathrm{dx}} \sin u$

$\frac{\mathrm{dy}}{\mathrm{dx}} + \frac{\mathrm{dy}}{\mathrm{dx}} \sin u = - \sin u$

$\frac{\mathrm{dy}}{\mathrm{dx}} \left(1 + \sin u\right) = - \sin u$

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \frac{u}{1 + \sin u}$

Since $u = x + y$:

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \frac{x + y}{1 + \sin \left(x + y\right)}$

Hopefully this helps!