Show that $y^{(n)}=\frac{m!a^n}{(m-n)!}(ax+b)^{m-n}$ 
If $y=(ax+b)^m,$ then show that $$y^{(n)}=\frac{m!a^n}{(m-n)!}(ax+b)^{m-n},$$

where $y^{(n)}$ is the $n$-th derivative of $y$ with respect to $x$.
They say $$y^{(n)}=\frac{m(m-1)(m-2)...(m-n+1)(m-n)!}{(m-n)!} (ax+b)^{m-n} \cdot a^n$$
$$=\frac{m!a^n}{(m-n)!} (ax+b)^{m-n} \cdot a^n$$
I couldn't understand second line. Usually, I didn't solve many problems with factorial. That's why I don't have much more knowledge of factorial. I didn't understand what it ($(m-n)!$) was converted in second line. Where did $a$ come from?
 A: 
We start right from the beginning to better see what's going on. Differentiating $y(x)=(ax+b)^m$ we obtain
\begin{align*}
y(x)&=(ax+b)^m\\
y^{\prime}(x)&=m(ax+b)^{m-1}a\tag{1}\\
y^{\prime\prime}(x)&=m(m-1)(ax+b)^{m-2}a^2\tag{2}\\
y^{(3)}(x)&=m(m-1)(m-2)(ax+b)^{m-3}a^3\\
&\vdots\\
y^{(n)}(x)&=\color{blue}{m(m-1)\cdots (m-n+1)}(ax+b)^{m-n+1}a^n\tag{3}\\
\end{align*}

Comment:

*

*In (1) we derivate with respect to $x$ noting that the inner derivative of $ax+b$ gives a factor $a$.


*In (2) down to (3) we derivate successively and see two patterns emerging: A factor $m(m-1)\cdots (m-n+1)$ and according to $n$-times doing inner derivation a factor $a^n$.
We recall the definition of $m!=m\cdot (m-1)\cdot (m-2)\cdots 3\cdot 2\cdot 1$. We consider the inner factor $m-n+1$  of $m!$ and group $m!$ accordingly to get
\begin{align*}
m!&=m\cdot (m-1)\cdot (m-2)\cdots 3\cdot 2\cdot 1\\
&=m\cdot(m-1)\cdot(m-2)\cdots (m-n+1)\\
&\qquad\qquad\cdot\color{blue}{\left((m-n)\cdot (m-n-1)\cdots 3\cdot 2\cdot1\right)}\\
&=m\cdot(m-1)\cdot(m-2)\cdots (m-n+1)\cdot \color{blue}{(m-n)!}\tag{4}
\end{align*}

Expanding (3) with $(m-n)!$ we obtain according to (4)
\begin{align*}
\color{blue}{y^{(n)}(x)}&=m(m-1)\cdots (m-n)(ax+b)^{m-n+1}a^n\\
&=\frac{m(m-1)\cdots (m-n+1)(ax+b)^{m-n}a^n(m-n)!}{(m-n)!}\\
&\;\;\color{blue}{=\frac{m!a^n(ax+b)^{m-n+1}}{(m-n)!}}
\end{align*}
and the claim follows.

