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

Mar 19, 2016

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

#### Explanation:

Implicit differentiation is used when a function, here $y$, is not explicitly written in terms $x$. One will need the formula for differentiation of product & ratios of functions as well as chain formula to solve the given function.

For this, we take differential of both sides of the function $y = {x}^{2} y - {y}^{2} - x y$ and differentiating we get

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

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

Transposing terms containing $\frac{\mathrm{dy}}{\mathrm{dx}}$ to LHS we get

$\frac{\mathrm{dy}}{\mathrm{dx}} - {x}^{2} \frac{\mathrm{dy}}{\mathrm{dx}} + 2 y \frac{\mathrm{dy}}{\mathrm{dx}} + x \frac{\mathrm{dy}}{\mathrm{dx}} = 2 x y - y$ or

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

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

Mar 19, 2016

Simplify then differentiate to find:

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 x - 1$ when $y \ne 0$

Multiply by $\frac{y}{{x}^{2} - x - 1}$ to cover the case $y = 0$ and find:

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

#### Explanation:

graph{y=x^2y-y^2-xy [-10, 10, -5, 5]}

Notice that all of the terms are divisible by $y$, so do that first to find:

$1 = {x}^{2} - y - x$

with exclusion $y \ne 0$

We can rearrange this as:

$y = {x}^{2} - x - 1$

Hence:

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 x - 1$

with exclusion $y = 0$

What happens in the case $y = 0$?

The original equation is satisfied, so its graph consists of the parabola $y = {x}^{2} - x - 1$ together with the x-axis $y = 0$ for which the derivative is $0$.

So to cover the case $y = 0$ we can multiply $2 x - 1$ by $\frac{y}{{x}^{2} - x - 1}$, since this has value $1$ for all points on the curve where $y \ne 0$ and value $0$ when $y = 0$ (and ${x}^{2} - x - 1 \ne 0$).

So: $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\left(2 x - 1\right) y}{{x}^{2} - x - 1}$