I need some help understanding the tensor algebra done this problem. I often see equations rearranged across an equal sign and I have no clue what tricks and reasoning they are using to arrive at these solutions. The only resources I can find on tensor algebra only show basic relations of vectors, the metric tenors and some other tensors, but in no way explain how to manipulate general equations in an algebra way. I suppose one could guess this solution but that is hardly ideal method as the problems get more complicated. 
So here's the problem 
$$
[-(k^2-m^2)g^{\mu\nu} + k^\mu k^\nu]D_{\nu \lambda}(k)=\delta^{\mu}_\lambda
$$
And the solutions is,
$$
D_{v\lambda}(k)=\frac{-g_{\nu \lambda}+k_\nu k_\lambda/m^2}{k^{2}-m^{2}}
$$
Where the Dirac symbol $\hbar=1$ and speed of light $c=1$ and $g^{\mu \nu}$ is the Minkowski metric with a $(+,-,-,-)$ signature, $m$ is mass-energy and $k^\mu$ is the momentum-energy vector.  
EDIT:
Well if I understand correctly I could guess the solution to have the form $D_{\nu \lambda}(k) = a g_{\nu \lambda}+bk_\nu k_\lambda$ where $a$ and $b$ are arbitrary constants. Then plug the solution into the equation do some rearranging and arrive at:
$$
k^{\mu}k_\lambda(a + b m^2)-a(k^2+m^2)\delta^\mu_\lambda = \delta^\mu_\lambda
$$
Since $ k^\mu k_\lambda$ for $ \mu \ne \lambda $ is not zero then $(a + b m^2)$ must equal zero. Now we know $a = -1/(k^2 -m^2)$ and all we have to do is solve for $b$.
The question I have is there better way to solve. 
 A: One thing that makes this problem feel unfamiliar is the presence of the metric tensor and the resulting need to distinguish upper/lower indices. We can make it look a lot more familiar if we swap the positions of the $\nu$ index in the first two terms:
$$[-(k^2-m^2)g^{\mu\nu} + k^\mu k^\nu]D_{\nu \lambda}=[-(k^2-m^2)\delta^{\mu}_{\;\nu} + k^\mu k_\nu]D^\nu_{\;\lambda}=\delta^{\mu}_{\lambda}$$
Here we have recognized that $g^\mu_{\;\nu}=g^{\mu \lambda}g_{\lambda\nu}=\delta^{\mu}_{\;\nu}$ since the signs from the spatial indices cancel out. So now we just have matrix multiplication written in a slightly unusual way; in more familiar terms, we have $$\left[-(k^2-m^2)I_4+\mathbf{k}\otimes \mathbf{k}\right]D=I_4$$ where $D$ is a matrix with entries $(D)_{\mu\nu}=D^{\mu}_{\;\nu}$ and $\mathbf{k}=(k_0,k_1,k_2,k_3)$.
Hence we now have the linear algebra problem of inverting the matrix
$$D=\left[-(k^2-m^2)I_4+\mathbf{k}\otimes \mathbf{k}\right]^{-1}.$$ The Sherman-Morrison formula comes to the rescue in handling the outer product $\mathbf{k}\otimes\mathbf{k}$: $$(A+\mathbf{u}\otimes\mathbf{v})^{-1}=A^{-1}-\frac{(A^{-1}\mathbf{u})
\otimes(\mathbf{v} A^{-1})}{1+\mathbf{v}\cdot A^{-1}\cdot \mathbf{u}}$$ with $A=-(k^2-m^2)I_4$ and $\mathbf{u}=\mathbf{v}=\mathbf{k}$. Some algebra gives
$$ 
D=\frac{1}{k^2-m^2}\left[-I_4 +\frac{1}{m^2}\,\mathbf{k}\otimes\mathbf{k}\right].
$$
Returning to indices, we have 
$$
D^{\mu}_{\;\nu}=\frac{-\delta^{\mu}_{\;\nu}+k^\mu k_\nu/m^2}{k^2-m^2}
\implies 
D_{\mu\nu}=\frac{-g_{\mu\nu}+k_\mu k_\nu/m^2}{k^2-m^2}.
\hspace{.5cm}\blacksquare
$$
