<s>[INST] differential of homogeneous function I am trying to calculate the dy of:
$y+xy=x$
I know the formula $\frac{dy}{dx}=f(x)'$
My logic says to do so: $y(1+x)=x$ ->$y=\frac{x}{\left(1+x\right)}$
$dy=(\frac{x}{\left(1+x\right)})'dx$ -> $dy=\frac{1}{\left(1+x\right)^2}dx$
But my textbook has the answer:
$dy=\frac{1-y}{1+x}dx$
Where am I wrong?
Thank you
 [/INST] Same as your answer...
$\frac{1}{(1+x)^2}=\frac{1}{1+x} \cdot \frac{1}{1+x}$
and in the equation $y+xy=x$ we have:
Subtract $xy$ on both sides: $y=x-xy$
Factor the right hand side: $y=x(1-y)$
Divide both sides by $1-y$: $\frac{y}{1-y}=x$
So we can write your answer as:
$\frac{1}{(1+x)^2}=\frac{1}{1+x} \cdot \frac{1}{1+x}$
$\frac{1}{(1+x)^2}=\frac{1}{1+\frac{y}{1-y}} \cdot \frac{1}{1+x}$
$\frac{1}{(1+x)^2}=\frac{1-y}{1-y+y} \cdot \frac{1}{1+x}$ (I multiplied first fraction in product by $1-y$)
$\frac{1}{(1+x)^2}=\frac{1-y}{1} \cdot \frac{1}{1+x}$
$\frac{1}{(1+x)^2}=\frac{1-y}{1+x}$
--------------Also if you wanted the book's answer------------
Just differentiate as is instead of putting it in explicit form and then differentiating.
$y+xy=x$
$y'+xy'+1y=1$ I did the $xy$ term using product rule...
Now let's solve for $y'$
$y'(1+x)+y=1$
$y'(1+x)=1-y$
$y'=\frac{1-y}{1+x}$
</s>