also positive definite. Note also that as a sum of powers of linear forms, $p$ is already sos-convex and sos. Let $S^{n-1}$ denote the unit sphere in $\mathbb{R}^n$ and define $$\alpha_j\mathrel{\mathop{:}}=\frac{1}{2} \min_{x\in S^{n-1}} p(x)-p(A_jx).$$ By definition of $\alpha_j$, we have that is positive definite. Furthermore, as $\alpha_j>0$ (this is a consequence of $p(x)-p(A_jx)$ being positive definite) and as $p(A_jx)$ is sos, we get that $p(A_jx)+\alpha_j (\sum_i x_i^2)^d$ is positive definite. there exist an integer $K$ such that $$\begin{aligned}
 \label{eq:claus.p}
        \left(p(x)-p(A_jx)-\alpha_j (\sum_i x_i^2)^d\right)\cdot p(x)^K
    \end{aligned}$$ is sos and an integer $K'$ such that $$\begin{aligned}
\label{eq:claus.pAj}
 \left(p(x)-p(A_jx)-\alpha_j (\sum_i x_i^2)^d\right) \cdot \left(p(A_jx)+\alpha_j (\sum_i x_i^2)^d\right)^{K'}
 \end{aligned}$$ is sos.

Take $k\mathrel{\mathop{:}}=\max\{2K+1,2K'+1\}$ and define $q(x)=p(x)^k.$ It is easy to see that $q$ is positive definite as $p$ is positive definite. We first show that $q$ is sos-convex. We have $$\nabla^2 q(x)=k(k-1)p(x)^{k-2}\nabla p(x)\nabla p(x)^T+kp(x)^{k-1}\nabla^2 p(x).$$ As $p$ is sos, any power of it is also sos. Furthermore, we have $$\nabla^2 p(x)=\sum_{i=1}^N 2d(2d-1)(a_i^Tx)^{2d-2}a_ia_i^T,$$ which implies that there exists a polynomial matrix $V(x)$ such that $\nabla^2p(x)=V(x)V(x)^T$. As a consequence, we see that $$y^T\nabla^2 q(x)y=k(k-1)p(x)^{k-2} (\nabla p(x)^Ty)^2+kp(x)^{k-1}(V(x)^Ty)^2$$ is a sum of squares and hence $q$ is sos-convex.

We now show that for $j=1,\ldots,m$, the form $q(x)-q(A_jx)$ is positive definite and 