Kernel Function: $K(x,y) = (b + x^Ty)^2$ is a quadratic polynomial kernel, where $x, y ∈ R^n $and $b > 0$. Provide a feature mapping $\phi(x)$ such that $K(x,y) = \phi(x)^T\phi(y)$. What is the dimensionality of $\phi(x)$ in terms of $n$?
My Answer So far is : $$\phi(x)= x^tx + \sqrt{2b}x +b $$ And Dimension = $n^2 +n +1$
Good attempt.
\begin{align}K(x,y) &= (b+x^Ty)^2\\&= b^2 + 2bx^Ty + (x^Ty)^2 \\ &= b^2 + 2bx^Ty + \left( \sum_{i=1}^n x_iy_i\right)^2\\ &= b^2 + 2bx^Ty + \sum_{i=1}^n x_i^2 y_i^2 + 2 \sum_{i < j}x_ix_jy_iy_j\end{align}
Hence a possible $\phi$ is
$$\phi(x) = \begin{bmatrix}b \\ \sqrt{2b}x \\ x_1^2 \\\vdots \\ x_n^2 \\ \sqrt{2}x_1x_2 \\ \vdots \\ \sqrt{2}x_{n-1}x_n \end{bmatrix}$$
$\phi$ maps to a space of dimension $$1+2n+\frac{n(n-1)}2$$
Comment about your attempt: $x \in \mathbb{R}^n$, $b\in \mathbb{R}$, we can't add a vector to a number.