# How do you find (d^2y)/(dx^2) given x^2y+xy^2=6?

Mar 30, 2017

(d^2y)/(dx^2)=(4y(2x+y)(x+y))/(x^2(x+2y)^2)-(2xy^2(2x+y)^2)/(x(x+2y))^3-(2y)/(x(x+2y)

#### Explanation:

Generally differentiation problems involve functions i.e. $y = f \left(x\right)$ - written explicitly as functions of $x$. However, some functions y are written implicitly as functions of $x$.

So what we do is to treat $y$ as $y = y \left(x\right)$ and use chain rule. This means differentiating $y$ w.r.t. $y$, but as we have to derive w.r.t. $x$, as per chain rule, we multiply it by $\frac{\mathrm{dy}}{\mathrm{dx}}$.

Here we are given ${x}^{2} y + x {y}^{2} = 6$

hence differentiating it we get

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

or $2 x y + {x}^{2} \frac{\mathrm{dy}}{\mathrm{dx}} + 2 x y \frac{\mathrm{dy}}{\mathrm{dx}} + {y}^{2} = 0$ ................(A)

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

Differentiating (A) further, we have

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

or $\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} \left({x}^{2} + 2 x y\right) + \frac{\mathrm{dy}}{\mathrm{dx}} \left(4 x + 4 y\right) + 2 x {\left(\frac{\mathrm{dy}}{\mathrm{dx}}\right)}^{2} + 2 y = 0$

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

= $4 \frac{y \left(2 x + y\right)}{x \left(x + 2 y\right)} \left(x + y\right) - 2 x {\left(\frac{y \left(2 x + y\right)}{x \left(x + 2 y\right)}\right)}^{2} - 2 y$

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

= (4y(2x+y)(x+y))/(x^2(x+2y)^2)-(2xy^2(2x+y)^2)/(x(x+2y))^3-(2y)/(x(x+2y)

Mar 31, 2017

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

#### Explanation:

There is another (often faster) approach using partial derivatives. Suppose we cannot find $y$ explicitly as a function of $x$, only implicitly through the equation $F \left(x , y\right) = 0$ which defines $y$ as a function of $x , y = y \left(x\right)$. Therefore we can write $F \left(x , y\right) = 0$ as $F \left(x , y \left(x\right)\right) = 0$. Differentiating both sides of this, using the partial chain rule gives us

 (partial F)/(partial x) (1) + (partial F)/(partial y) dy/dx = 0 => dy/dx = −((partial F)/(partial x)) / ((partial F)/(partial y))

And for the second derivative we similarly have:

$\frac{\mathrm{dy}}{\mathrm{dx}} = G \left(x , y\right) \implies \frac{{d}^{2} y}{{\mathrm{dx}}^{2}} = \frac{\partial G}{\partial x} + \frac{\partial F}{\partial y} G \left(x , y\right)$

So Let $F \left(x , y\right) = {x}^{2} y + x {y}^{2} - 6$; Then;

$\frac{\partial F}{\partial x} = 2 x y + {y}^{2} \setminus \setminus \setminus$ and $\setminus \setminus \setminus \frac{\partial F}{\partial y} = {x}^{2} + 2 x y$

And so:

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

So to get the Second derivative;
Let $G \left(x , y\right) = - \frac{2 x y + {y}^{2}}{{x}^{2} + 2 x y}$; Then:

$\frac{\partial G}{\partial x} = - \frac{\left({x}^{2} + 2 x y\right) \left(2 y\right) - \left(2 x y + {y}^{2}\right) \left(2 x + 2 y\right)}{{x}^{2} + 2 x y} ^ 2$
$\text{ } = 2 y \cdot \frac{2 {x}^{2} + 3 x y + {y}^{2} - {x}^{2} - 2 x y}{{x}^{2} + 2 x y} ^ 2$
$\text{ } = 2 y \cdot \frac{{x}^{2} + x y + {y}^{2}}{{x}^{2} + 2 x y} ^ 2$

$\frac{\partial G}{\partial y} = - \frac{\left({x}^{2} + 2 x y\right) \left(2 x + 2 y\right) - \left(2 x y + {y}^{2}\right) \left(2 x\right)}{{x}^{2} + 2 x y} ^ 2$
$\text{ } = 2 x \cdot \frac{2 x y + {y}^{2} - {x}^{2} - 3 x y - 2 {y}^{2}}{{x}^{2} + 2 x y} ^ 2$
$\text{ } = - 2 x \cdot \frac{x y + {x}^{2} + {y}^{2}}{{x}^{2} + 2 x y} ^ 2$

And so using the above formula for the second derivative:

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} = \frac{\partial G}{\partial x} + \frac{\partial F}{\partial y} G \left(x , y\right)$

$\text{ } = \frac{2 y \left({x}^{2} + x y + {y}^{2}\right)}{{x}^{2} + 2 x y} ^ 2 + \frac{2 x \left(x y + {x}^{2} + {y}^{2}\right) \left(2 x y + {y}^{2}\right)}{{\left({x}^{2} + 2 x y\right)}^{2} \left({x}^{2} + 2 x y\right)}$

Which we can simplify to get:

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

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

$\text{ } = \frac{6 x y \left({x}^{2} + x y + {y}^{2}\right) \left(x + y\right)}{{x}^{2} + 2 x y} ^ 3$