# How do you differentiate y=xcosy^2-xy?

Oct 21, 2016

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

#### Explanation:

$y = x \cos {y}^{2} - x y$

We can differentiate each component and then put it together

$y ' = \frac{\mathrm{dy}}{\mathrm{dx}}$

The next one is a chain differentiation and differentiation of a product

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

The next one is $\left(x y\right) ' = 1 \cdot y + x \frac{\mathrm{dy}}{\mathrm{dx}}$

Putting it together

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

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

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