To expand $\displaystyle (ax+b)^n$ you will need to use the binomial theorem.

$\displaystyle (ax+b)^n=\sum_{i=0}^{n}\begin{pmatrix}n \\ i\end{pmatrix}(ax)^{i}b^{(n-i)}$

$\displaystyle \begin{align*}\implies (ax+b)^n &=\begin{pmatrix}n \\0\end{pmatrix}b^n+\begin{pmatrix}n \\1\end{pmatrix}(ax)b^{n-1}+ \cdots +\begin{pmatrix}n \\n-1\end{pmatrix}(ax)^{n-1}b+\begin{pmatrix}n \\n\end{pmatrix}(ax)^{n}\end{align*}$

$\displaystyle \begin{align*}\implies \frac{d(ax+b)^n}{dx}&=0+\begin{pmatrix}n \\1\end{pmatrix}ab^{n-1}+\cdots+\begin{pmatrix}n \\n-1\end{pmatrix}a^{n-1}{\color{red}b}(n-1)x^{n-2}+\begin{pmatrix}n \\n\end{pmatrix}a^{n}(n)x^{n-1}\end{align*}$

$\displaystyle \begin{align*}\implies \frac{d(ax+b)^n}{dx}&=a\left[0+ \begin{pmatrix}n \\1\end{pmatrix}b^{n-1}+\cdots+\begin{pmatrix}n \\n-1\end{pmatrix}a^{n-2}{\color{red}b}(n-1)x^{n-2}+\begin{pmatrix}n \\n\end{pmatrix}a^{n-1}(n)x^{n-1} \right]\end{align*}$

$\displaystyle \begin{align*}\implies \frac{d(ax+b)^n}{dx}&=a\cdot n\left[0+ \begin{pmatrix}n-1 \\0\end{pmatrix}b^{n-1}+\cdots+\begin{pmatrix}n-1\\n-2\end{pmatrix}a^{n-2}{\color{red}b}x^{n-2}+\begin{pmatrix}n-1 \\n-1\end{pmatrix}a^{n-1}x^{n-1} \right]\end{align*}$

$\displaystyle \begin{align*}\implies \frac{d(ax+b)^n}{dx}&=a\cdot n\left[\sum_{i=0}^{n-1}\begin{pmatrix}n-1\\i \end{pmatrix}(ax)^{i}b^{(n-1-i)}\right]\end{align*}$

$\displaystyle \begin{align*}\implies \frac{d(ax+b)^n}{dx}&=a\cdot n(ax+b)^{n-1}\end{align*}$