solving the recurrence t(n)=t(n-2)+d*(n^2)/2 with iteration method
This answer assumes that $T(1) = \frac{d}{2}$



Your recurrence relation, in closed form, would be:

\begin{align}
T(n) &amp; =  \frac{d}{2} n^2 + \frac{d}{2} (n-2)^2 + \frac{d}{2} (n-4)^2 + \dots + \frac{d}{2}\\
&amp; = \sum_{i=0}^\frac{n-1}{2} \frac{d}{2}(n-2i)^2\\
\end{align}

Which, with little effort, can be simplified further:

$$\dots = \frac{d}{2} \sum_{i=0}^\frac{n-1}{2}n^2-4ni+4i^2
 = \frac{dn^2}{4}(n-1)
-2dn\sum_{i=0}^\frac{n-1}{2}i
+2d\sum_{i=0}^\frac{n-1}{2}i^2$$

For further simplification, you can use the facts that:

$$\sum_{i=1}^n i=\frac{n(n+1)}{2}$$

$$\sum_{i=1}^n i^2=\frac{n(n+1)(2n+1)}{6}$$

But I'll leave that to you.