# How do you differentiate (x^2)y+x(y^2)=3x?

Sep 5, 2015

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

#### Explanation:

We need to find $\frac{\mathrm{dy}}{\mathrm{dx}}$.

Start off with differentiating both sides.

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

Since $\frac{d}{\mathrm{dx}} \left(f \left(x\right) + g \left(x\right)\right) = \frac{d}{\mathrm{dx}} f \left(x\right) + \frac{d}{\mathrm{dx}} g \left(x\right)$ :

$\frac{d}{\mathrm{dx}} {x}^{2} y + \frac{d}{\mathrm{dx}} x {y}^{2} = \frac{d}{\mathrm{dx}} 3 x$

The right hand side is simpler, so let's do that first.
Given any constant $c$, $\frac{d}{\mathrm{dx}} c f \left(x\right) = c \left(\frac{d}{\mathrm{dx}} f \left(x\right)\right)$, so:

$\frac{d}{\mathrm{dx}} {x}^{2} y + \frac{d}{\mathrm{dx}} x {y}^{2} = 3 \frac{d}{\mathrm{dx}} x$

$\frac{d}{\mathrm{dx}} {x}^{2} y + \frac{d}{\mathrm{dx}} x {y}^{2} = 3 \left(1\right)$

$\frac{d}{\mathrm{dx}} {x}^{2} y + \frac{d}{\mathrm{dx}} x {y}^{2} = 3$

For the left hand side, we apply the product rule:
$\frac{d}{\mathrm{dx}} \left(f \left(x\right) g \left(x\right)\right) = f \left(x\right) \frac{d}{\mathrm{dx}} \left(g \left(x\right)\right) + g \left(x\right) \frac{d}{\mathrm{dx}} \left(f \left(x\right)\right)$

$\frac{d}{\mathrm{dx}} {x}^{2} y + \frac{d}{\mathrm{dx}} x {y}^{2} = 3$

$\left[{x}^{2} \left(\frac{d}{\mathrm{dx}} y\right) + y \left(\frac{d}{\mathrm{dx}} {x}^{2}\right)\right] + \left[x \left(\frac{d}{\mathrm{dx}} {y}^{2}\right) + {y}^{2} \left(\frac{d}{\mathrm{dx}} x\right)\right] = 3$

Differentiating the $x$ parts is straightforward:
$\left[{x}^{2} \left(\frac{d}{\mathrm{dx}} y\right) + y \left(2 x\right)\right] + \left[x \left(\frac{d}{\mathrm{dx}} {y}^{2}\right) + {y}^{2} \left(1\right)\right] = 3$

When differentiating one variable in terms of another, you have to treat the other variable as a function of the one we are differentiating.
For example: $\frac{d}{\mathrm{dx}} \left(y\right) = \frac{\mathrm{dy}}{\mathrm{dx}} = y '$
How this works for more complicated problems uses the chain rule.

For example:

$\frac{d}{\mathrm{dx}} {y}^{2}$

$\frac{d}{\mathrm{dx}} {y}^{2}$

$= 2 y \frac{d}{\mathrm{dx}} y$

$= 2 y \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right)$

A "shortcut" is simply "differentiating as normal, then multiplying a $\frac{\mathrm{dy}}{\mathrm{dx}}$ (or whatever other variable you're working with.

Going back to the problem:

$\left[{x}^{2} \left(\frac{d}{\mathrm{dx}} y\right) + y \left(2 x\right)\right] + \left[x \left(\frac{d}{\mathrm{dx}} {y}^{2}\right) + {y}^{2} \left(1\right)\right] = 3$

$\left[{x}^{2} \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) + 2 x y\right] + \left[2 x y \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) + {y}^{2}\right] = 3$

We need to isolate $\frac{\mathrm{dy}}{\mathrm{dx}}$, so we bring all the $\frac{\mathrm{dy}}{\mathrm{dx}}$ terms to one side, and bring the other terms to the other side:

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

Now we can factor out $\frac{\mathrm{dy}}{\mathrm{dx}}$.

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

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