Solution (source code)

= Solution

The <logarithm> requires $y>0$, and $x>0$ is given. Set $z=\log(y/x)$, so $y=xe^z$ and the <chain rule> yields $xy'/y=1+xz'$. Dividing the <ordinary differential equation> by $y$ therefore gives
$$
1+xz'=1+z,\qquad xz'=z.
$$
Since $(z/x)'=(xz'-z)/x^2=0$, we obtain $z=Cx$, including the case $z=0$. Thus the general positive solution is $y=xe^{Cx}$. The <initial condition> $y(1)=e$ gives $C=1$:
$$
\boxed{y(x)=xe^x.}
$$
For the separate decay requirement, $xe^{Cx}\to0$ precisely when $C<0$: if $C=0$, the result is $x$, and if $C>0$, it grows. Consequently the full family with the stated <limit> is
$$
\boxed{y(x)=xe^{-ax},\qquad a>0,\quad x>0.}
$$
This latter family does not also satisfy $y(1)=e$; the solution selected by that <initial condition> grows. The identically zero <function> is excluded by the original <logarithm>.