Differentiate $y^{1-n}=z$? How can I differentiate $y^{1-n} = z$ to obtain $$(1-n)y^{-n}\frac{dy}{dx} = \frac{dz}{dx}$$ 

I am stuck at why differentiation of $y$ is done here, if differentiation is w.r.t. $x$, as $y$ should be treated as constant .
 A: Based on your recent question, I assume the reason you are asking this is because you are solving a Bernoulli differential equation. When solving these, we assume that $y$ and $z$ are functions of $x$. Therefore, you should not be considering $y$ as a constant, but you should be considering $y:=y(x)$, $z:=z(y)$.

$$z:=z(y), y:=y(x) \implies z:=z(y(x))$$
Therefore, it becomes evident that we should use the chain rule!

In Leibniz Notation, this is:
  $$\frac{dz}{dx}=\frac{dz}{dy}\cdot \frac{dy}{dx} \tag{1}$$

We can find $\frac{dz}{dy}$ by using the Power Rule of Differentiation:
$$\frac{d}{dy}(y^\alpha)=\alpha y^{\alpha-1}$$
Hence, in our case where $\alpha=1-n$, this would be:
$$\frac{dz}{dy}=\frac{d}{dy}\left(y^{1-n}\right)=(1-n)y^{1-n-1}=(1-n)y^{-n}$$
Substituting into $(1)$, we get the result required:
$$\bbox[5px,border:2px solid #C0A000]{\frac{dz}{dx}=(1-n)y^{-n}\cdot \frac{dy}{dx}}$$
A: I'm sure you know $(y^k)'= ky'y^{k-1}$. To answer your wonder: why we should differentiate $y$.
The question did not explicitly say that, but according to the convention, the most reasonable inference is that both $y$ and $z$ in the equation are functions of $x$, i.e. $y(x)^{1-n} =z(x)$
