How to evalute an equation

I have a simple notebook with this input:

d[x] = x + x^2 + x^3 + x^4 + x^5 + x^6

d[x]^2

When I evaluate d[x]^2, it unhelpfully throws back (x+x^2+x^3+x^4+x^5+x^6)^2 . How do I get it to actually evaluate that square and give me the coefficients of the polynomial?

You can do:

d[x]^2 // Expand

ai.png

Or only the coefficients:

DeleteCases[CoefficientList[d[x]^2, x], 0]

ai2.png

Thats perfect, thanks!