How does this change of variables result in the partial derivatives (Black-Scholes PDE) 
$$ \frac{\partial C}{\partial \tau}=\frac{\sigma^{2} S^{2}}{2}
 \frac{\partial^{2} C}{\partial S^{2}}+r S \frac{\partial C}{\partial
 S}-r C $$ Step 2 Transform the PDE from variable coefficient to
constant coefficient. Starting with the PDE backward in time, make the
change of variables $$ S \mapsto \log S:=x $$ which results in the
derivatives

$$ \begin{align} \frac{\partial C}{\partial S} &=\frac{\partial C}{\partial x} \frac{1}{S} \\
\\
 \frac{\partial^{2}
 C}{\partial S^{2}} &=\frac{1}{S^{2}}\left(\frac{\partial^{2}
 C}{\partial x^{2}}-\frac{\partial C}{\partial x}\right) \end{align}
 $$
https://www.math.fsu.edu/~dmandel/Primers/Solving%20Black-Scholes%20PDE%20the%20Right%20Way.pdf

*

*Where does the $\dfrac{1}{S}$ and $\dfrac{1}{S^2}$ come from?

*Why do we subtract $\dfrac{\partial C}{\partial x}$ in the expression for $\dfrac{\partial^2 C}{\partial S^2}$?

as I understand it, we cancel out all previous instances of S by dividing by some power. I request how the change of variables implies we must divide by exponents of $S$
 A: 
$$ S \mapsto \log S:=x, $$

So we have $$\frac{\partial x}{\partial S}=\frac{1}S$$ Now by chain rule:
$$\begin{align}
\frac{\partial C}{\partial S}&=\frac{\partial C}{\partial x}\frac{\partial x}{\partial S}=\frac{\partial C}{\partial x}\frac{1}S\\
\\
\frac{\partial^2 C}{\partial S^2}&=\frac{\partial }{\partial S}\left(\frac{\partial C}{\partial S}\right)\\
\\
&=\frac{\partial }{\partial S}\left(\frac{\partial C}{\partial x}\frac{1}S \right)\\
\\
&=\frac{1}{S}\frac{\partial }{\partial S}\left(\frac{\partial C}{\partial x} \right)+\frac{\partial C}{\partial x}\frac{\partial }{\partial S}\left(\frac{1}{S} \right)\\
\\
&=\frac{1}{S}\frac{\partial }{\partial x}\left(\frac{\partial C}{\partial x} \right)\frac{\partial x}{\partial S}-\frac{1}{S^2}\frac{\partial C}{\partial x}\\
\\
&=\frac{1}{S}\frac{\partial^2 C}{\partial x^2}\frac{\partial x}{\partial S}-\frac{1}{S^2}\frac{\partial C}{\partial x}\\
\\
&=\frac{1}{S^2}\frac{\partial^2 C}{\partial x^2}-\frac{1}{S^2}\frac{\partial C}{\partial x}\\
\\
&=\frac{1}{S^2}\left(\frac{\partial^2 C}{\partial x^2}-\frac{\partial C}{\partial x}\right)
\end{align}$$
