This is following a derivation found in Mandl & Shaw's QFT.
The free field generating functional for QED is $Z_0 [J_{\kappa}, \sigma, \bar{\sigma}] = Z_0 [J_{\kappa}]Z_0 [\sigma, \bar{\sigma}]$. It is separated into two parts, one with the free electromagnetic field and one with the free spinor fields. They are derived in a similar way, for instance for the electromagnetic field
$$ Z_0 [J_{\kappa}] = \frac{1}{N} \int \mathcal{D}A \text{exp}\big\{iX[J_{\kappa}]\big\},$$
where $N$ ensures normalization and $X[J_{\kappa}]$ is the action without any spinor fields defined by
$$ X[J_{\kappa}] = \int d^4x\left\{\frac{-1}{2}(\partial_{\nu}A_{\mu})(\partial^{\nu}A^{\mu}) + J_{\kappa}(x)A^{\kappa}(x)\right\}.$$
In Mandl & Shaw the generating functional is found by first manipulating the expression for the action. By defining a wave operator
$$ K^{\mu\nu}(x,x') = -g^{\mu\nu}\delta^{(4)}(x-x')\Box_{x'} $$
and its inverse by
$$ \int d^4x' K^{\mu\nu}(x,x') K_{\nu\tau}^{-1}(x',x'') = g^{\mu}_{\tau}\delta^{(4)}(x-x''), $$
the action may be expressed as
$$ X[J_{\kappa}] = \frac{-1}{2}\int d^4x ~ d^4x' A_{\mu}(x)K^{\mu\nu}(x,y)A_{\nu}(y) + \int d^4xJ_{\kappa}(x)A^{\kappa}(x). $$
By introducing a shifted electromagnetic field $A_{\mu}'(x)$ according to
$$ A_{\mu}'(x) = A_{\mu}(x) - \int d^4x'~ K^{-1}_{\mu\nu}(x,x')J^{\nu}(x')$$
and substituting it into the definition of the action, I obtain the following expression
$$ X[J_{\kappa}] = \frac{-1}{2} \int d^4x ~ d^4y \left[A_{\mu}(x) - \int d^4x' K_{\mu\tau}^{-1}(x,x')J^{\tau}(x')\right] \times K^{\mu\nu}(x,y) \left[A_{\nu}(y) - \int d^4y' K_{\nu\sigma}^{-1}(y,y')J^{\sigma}(y')\right] \\ + \int d^4x ~ J_{\kappa}g^{\kappa\mu} \big[A_{\mu}(x) - \int d^4x' ~ K_{\mu\nu}^{-1}(x,x')J^{\nu}(x')\big]. $$
Apparently, it should be possible, by only using the definition of the inverse wave operator above, to express this action in terms of the shifted potential as
$$ X[J_{\kappa}] = \frac{1}{2} \big[J^{\kappa}K^{-1}_{\kappa\lambda}J^{\lambda}\big] - \frac{1}{2}\big[A_{\mu}'K^{\mu\nu}A_{\nu}'\big].$$
I can handle some of the terms and sort of see how this might be possible. But for instance the term
$$ \frac{1}{2} \int d^4x ~ d^4x' K_{\mu\tau}^{-1}(x,x')J^{\tau}(x') \int d^4y ~ K^{\mu\nu}(x,y) A_{\nu}(y) $$
I cannot figure out what to do since the order of the wave operator and its inverse, as well as their variables, are too far off the definition given in the book and above. Could someone who is more confident with tensor calculus make this derivation or give some hints as to how it should be done?
Solving similar derivations seems to be the key to understanding the path integral formalism for not only QED but for QCD as well since the approach is always similar. This is also the key to finding expressions for the propagator functions in both QED and QCD, so this is very important.