find $\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$ for odd t then for even t

find $$\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$$ for $t=2n$ then for $t=2n+1$

I tried by expand $(1-x)^n(1-x)^n$, with no result.

Any Help ?

Solutions Collecting From Web of "find $\sum_{k=0}^{t}(-1)^k\binom{t}{k}^2$ for odd t then for even t"

It is better to exploit symmetry. Since $\binom{t}{k}=\binom{t}{t-k}$, we have:
$$ \sum_{k=0}^{t}\binom{t}{k}^2(-1)^k = [x^t]\left[\left(\sum_{k=0}^{t}\binom{t}{k}(-1)^k x^k\right)\cdot\left(\sum_{k=0}^{t}\binom{t}{t-k}x^{t-k}\right)\right]$$
hence:
$$ \sum_{k=0}^{t}\binom{t}{k}^2(-1)^k = [x^t]\left[(1-x)^t(1+x)^t\right]=[x^t](1-x^2)^t$$
so:
$$ \sum_{k=0}^{t}\binom{t}{k}^2(-1)^k=\left\{\begin{array}{rcl}0&\text{if}&t\equiv 1\pmod{2},\\ \binom{t}{t/2}(-1)^{t/2}&\text{if}&t\equiv 0\pmod{2}.\end{array}\right.$$

$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
\newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
\newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
\newcommand{\dd}{{\rm d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
\newcommand{\fermi}{\,{\rm f}}
\newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
\newcommand{\half}{{1 \over 2}}
\newcommand{\ic}{{\rm i}}
\newcommand{\iff}{\Longleftrightarrow}
\newcommand{\imp}{\Longrightarrow}
\newcommand{\pars}[1]{\left(\, #1 \,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\pp}{{\cal P}}
\newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
\newcommand{\sech}{\,{\rm sech}}
\newcommand{\sgn}{\,{\rm sgn}}
\newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}^{2}:\ {\large ?}}$.

\begin{align}&\color{#66f}{\large\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}^{2}}
=\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}
\oint_{\verts{z}\ =\ 1}{\pars{1 + z}^{t} \over z^{k + 1}}\,{\dd z \over 2\pi\ic}
\\[3mm]&=\oint_{\verts{z}\ =\ 1}{\pars{1 + z}^{t} \over z}
\sum_{k = 0}^{t}{t \choose k}\pars{-\,{1 \over z}}^{k}\,{\dd z \over 2\pi\ic}
=\oint_{\verts{z}\ =\ 1}{\pars{1 + z}^{t} \over z}
\bracks{1 + \pars{-\,{1 \over z}}}^{t}\,{\dd z \over 2\pi\ic}
\\[3mm]&=\pars{-1}^{t}\oint_{\verts{z}\ =\ 1}{\pars{1 – z^{2}}^{t} \over z^{t + 1}}
\,{\dd z \over 2\pi\ic}
=\pars{-1}^{t}\sum_{k=0}^{t}{t \choose k}\pars{-1}^{k}
\oint_{\verts{z}\ =\ 1}{1 \over z^{t – 2k + 1}}\,{\dd z \over 2\pi\ic}
\\[3mm]&=\pars{-1}^{t}\sum_{k=0}^{t}{t \choose k}\pars{-1}^{k}\delta_{k,t/2}
\end{align}

$$
\color{#66f}{\large\sum_{k = 0}^{t}\pars{-1}^{k}{t \choose k}^{2}}
=\color{#c00000}{\large%
\left\{\begin{array}{lcl}
\pars{-1}^{t/2}{t \choose t/2} & \mbox{if} & t\ \mbox{is even}
\\[2mm]
0 & & \mbox{otherwise}
\end{array}\right.}
$$