How to make sense of chain rule here Context: We are currently on topic of 1st order linear differential equations, and below there are 2 substitutions we have to perform to obtain a differential equation in the form $y'+ f(t)y = g(t)$ in order to use integrating factor to solve:

For the first one I differentiated $u$ to obtain $u' = \frac{-1}{y^2}\cdot y'$ which yielded me the correct form, but for the second one, when I differentiate u, it seems that $u' = y''$ instead of $u' = y'' \cdot y'$ because only the former yields the appropriate format. Why is it the case that chain rule doesn't apply to give $u' = y'' \cdot y'$?
 A: (1): It is also easy to see that the left side is a complete differential, so that
$$
(xy'(x))=\frac{(xy(x))^2}{x}
$$
is a separable ODE in $u(x)=xy(x)$.
(2): In principle, the same applies here, the left side is $(xy(x))''$, so that one can directly integrate twice.
Contrary to the comments, in neither case you change the independent variable to $y$. If you want to formally apply the chain rule in (1), consider the function $g(y)=\frac1y$, then the substitution is the composite function $u(x)=g(y(x))$ and thus $u'(x)=g'(y(x))y'(x)$ which results in the formula you found and used (apparently correctly).
In the equation (2) you just change the differentiation order of the dependent variable by "hiding" one differentiation, writing out the arguments it is intended to be $u(x)=y'(x)$ so that consequently $u'(x)=y''(x)$ and you find the integrating factor $x$ to get $(x^2u(x))'=12x^3$, which can again be easily integrated.
It is only in autonomous second order DE, usually non-linear, that sometimes the change of independent variable from $x$ to $y$ provides a more clear insight into the necessary and possible transformations. Under the assumption that $y$ is non-constant and locally monotonous, one sets $y'(x)=u(y(x))$ with some new unknown function $u$. Then the derivative of that relation gives $y''(x)=u'(y(x))y'(x)=u'(y)u=\frac12\frac{d(u^2)}{dy}$, which transforms the DE into a first order non-autonomous DE for $u(y)$.
