From this previous question I gained understanding of why the chain rule for a function $u(x,y)=f(p)$ is expressed as $$\frac{\partial u}{\partial x}=\frac{\mathrm{d}f(p)}{\mathrm{d}p}\times \frac{\partial p}{\partial x}$$ where $p=p(x,y)$
Now suppose that $u(x,y)=f(ax+by)$ therefore $$\color{blue}{\frac{\partial u}{\partial x}=a\frac{\mathrm{d}f(p)}{\mathrm{d}p}\tag{A}}$$ where $p=ax + by$
I need to compute $$\frac{\partial^2 u}{\partial x^2}$$
So my attempt is to recognize that $$\frac{\partial^2 u}{\partial x^2}=\frac{\partial}{\partial x}\left(\frac{\partial u}{\partial x}\right)$$ Therefore from equation $\color{blue}{\mathrm{(A)}}$ it should follow that $$\frac{\partial^2 u}{\partial x^2}=\frac{\partial}{\partial x}\left(a\frac{\mathrm{d}f(p)}{\mathrm{d}p}\right)$$ but according to my book source this is wrong and the correct answer is $$\frac{\partial^2 u}{\partial x^2}=\color{#A0F}{a^2}\color{#F80}{\frac{\mathrm{d^2}f(p)}{\mathrm{d}p^2}}$$
Could someone please kindly explain how this equation was obtained?
Specifically, I have no idea where the $\color{#A0F}{a^2}$ and the $\color{#F80}{\dfrac{\mathrm{d^2}f(p)}{\mathrm{d}p^2}}$ came from.
$\color{red}{\text{For some more context here is an image of the book source:}}$
