Solving Poisson's equation for $\varrho(\mathbf{r}) = \sigma \cos\left(\frac{2 \pi}{L} x\right) \, \delta(y)$ Problem statement
I took an exam, where I had the following task: Determine the electrostatic potential for the charge distribution
$$\varrho(\mathbf{r}) = \sigma \cos\left(\frac{2 \pi}{L} x\right) \, \delta(y)$$
Approach 1
Solvong the Coulomb integral is futile, as
$$
\phi(\mathbf{r})
= \int_{\mathbb{R}^3} \frac{\varrho(\mathbf{r}')}{|\mathbf{r} - \mathbf{r}'|} \, \mathrm{d}^3 r'
= \sigma \int\limits_{-\infty}^{\infty} \mathrm{d}x \int\limits_{-\infty}^{\infty} \mathrm{d}y \int\limits_{-\infty}^{\infty} \mathrm{d}z \, \frac{\cos\left(\frac{2 \pi}{L} x\right) \, \delta(y)}{\sqrt{(x-x')^2 + (y-y')^2 + (z-z')^2}}
$$
is not integrable.
Approach 2
Solving Poisson's equation is the only other possibility, that came to my mind. In electrical and magnetic units
$$
\nabla^2 \phi(\mathbf{r}) = - 4 \pi \varrho(\mathbf{r})
$$
Now I started off Fourier-transforming the equation, where $\mathbf{k}^2 = k_x^2 + k_y^2 + k_z^2$
$$
\begin{aligned}
\frac{1}{\sqrt{(2 \pi)^3}} \int_{\mathbb{R}^3}
\nabla^2 \phi(\mathbf{r}) \, \mathrm{e}^{-\mathrm{i} \mathbf{k} \cdot \mathbf{r}}
\, \mathrm{d}^3 r'
&=
- \frac{4 \pi }{\sqrt{(2 \pi)^3}} \int_{\mathbb{R}^3}
\varrho(\mathbf{r}) \, \mathrm{e}^{-\mathrm{i} \mathbf{k} \cdot \mathbf{r}}
\, \mathrm{d}^3 r'
\\
\mathbf{k}^2 \, \hat{\phi}(\mathbf{k})
&=
- 4 \pi \sigma \int_{\mathbb{R}^3}
\cos\left(\frac{2 \pi}{L} x\right) \, \delta(y) \, \mathrm{e}^{-\mathrm{i} \mathbf{k} \cdot \mathbf{r}}
\, \mathrm{d}^3 r'
\\
\mathbf{k}^2 \, \hat{\phi}(\mathbf{k})
&=
- 4 \pi \sigma
\int\limits_{-\infty}^{\infty} \cos\left(\frac{2 \pi}{L} x\right) \, \mathrm{e}^{-\mathrm{i} k_x x} \, \mathrm{d}x
\int\limits_{-\infty}^{\infty} \delta(y) \, \mathrm{e}^{-\mathrm{i} k_y y} \, \mathrm{d}y
\int\limits_{-\infty}^{\infty} \mathrm{e}^{-\mathrm{i}  k_z z} \, \mathrm{d}z
\\
\mathbf{k}^2 \, \hat{\phi}(\mathbf{k})
&=
- 4 \pi \sigma \cdot
\frac{1}{2} \left(
\delta\left(k_x - \frac{2 \pi}{L}\right) + \delta\left(k_x + \frac{2 \pi}{L}\right)
\right)
\cdot 1 \cdot
\int\limits_{-\infty}^{\infty} \mathrm{e}^{-\mathrm{i}  k_z z} \, \mathrm{d}z
\end{aligned}
$$
And here I'm stuck, because the leftover integral
$$
\int\limits_{-\infty}^{\infty} \mathrm{e}^{-\mathrm{i}  k_z z} \, \mathrm{d}z
$$
does not converge.
Résumé: What am I doing wrong? Is my approach wrong, or did I miscalculate something?
 A: Note that in the unitary definition of the Fourier transform:
$$\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} 1\mathrm{e}^{-\mathrm{i}  k_z z} \, \mathrm{d}z=\sqrt{2\pi}\delta(k_z).$$
To see why, inverse Fourier transform both sides from momentum space back to the spatial domain:
$$\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty}\left(\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} 1\mathrm{e}^{-\mathrm{i}  k_z z} \,{dz}\right)\mathrm{e}^{\mathrm{i}  k_z z} {dk_z}=\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty}\sqrt{2\pi}\delta(k_z)\mathrm{e}^{\mathrm{i}  k_z z} {dk_z}=1,$$
so this is a Fourier transform pair of functions. More generally:
$$\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \text{exp}\left[{\mathrm{i}  k_y y_0}\right]\text{exp}\left[-{\mathrm{i}  k_y y}\right] \,{dk_y}=\sqrt{2\pi}\delta(y-y_0)$$
and the previous identity follows from letting $y_0=0$.
Part 1
Lets see if your Dirac Delta function answer then checks out, define (note the corrected sign):
$$\mathbf{k}^2 \, \hat{\phi}(\mathbf{k})
=
 4\pi \sigma \hat{I_1}(k_x)\hat{I_2}(k_y) \hat{I_3}(k_z)  
,
\tag{1}$$
$$\hat{I_1}(k_x)=\sqrt{2\pi}\frac{1}{2} \left(
\delta\left(k_x - \frac{2 \pi}{L}\right) + \delta\left(k_x + \frac{2 \pi}{L}\right)
\right),$$
$$\hat{I_2}(k_y)=\frac{1}{\sqrt{2\pi}},$$
$$\hat{I_3}(k_z)=\sqrt{2\pi}\delta(k_z),$$
then Fourier transform into the spatial domain:
$$\frac{1}{(2\pi)^{3/2}}\int\limits_{\mathbb{R}^3}\mathbf{k}^2 \, \hat{\phi}(\mathbf{k})\,e^{i\mathbf{k}\cdot\mathbf{r}}{d\mathbf{k}}=$$ $$\frac{4\pi\sigma}{(2\pi)^{3/2}}\int\limits_{-\infty}^{\infty} \hat{I_1}(k_x)\,e^{\mathrm{i}  k_x x}{dk_x}\int\limits_{-\infty}^{\infty} \hat{I_2}(k_y)\,e^{\mathrm{i}  k_y y}{dk_y}\int\limits_{-\infty}^{\infty} \hat{I_3}(k_z)\,e^{\mathrm{i}  k_z z}{dk_z},$$
$$\frac{-1}{(2\pi)^{3/2}}\int\limits_{\mathbb{R}^3}\mathbf{k}^2 \, \hat{\phi}(\mathbf{k})\,e^{i\mathbf{k}\cdot\mathbf{r}}{d\mathbf{k}}=\nabla^2 \phi(\mathbf{r}),$$
\begin{aligned}\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \hat{I_1}(k_x)\,e^{\mathrm{i}  k_x x}{dk_x}&=\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \frac{\sqrt{2\pi}}{2} \left[
\delta\left(k_x - \frac{2 \pi}{L}\right) + \delta\left(k_x + \frac{2 \pi}{L}\right)
\right]\,e^{\mathrm{i}  k_x x} {dk_x}\\&=\cos\left(\frac{2\pi x}{L}\right),\end{aligned}
$$\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \hat{I_2}(k_y)\,e^{\mathrm{i}  k_y y}{dk_y}=\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi}} \,e^{\mathrm{i}  k_y y} {dk_y}=\delta(y),$$
$$\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \hat{I_3}(k_z)\,e^{\mathrm{i}  k_z z}{dk_z}=\frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \sqrt{2\pi}\delta(k_z) \,e^{\mathrm{i}  k_z z} {dk_z}=1,$$
and therefore:
$$\nabla^2 \phi(\mathbf{r}) = - 4 \pi \sigma\cos\left(\frac{2\pi x}{L}\right)\delta(y),\tag{2}$$
$$\nabla^2 \phi(\mathbf{r}) = - 4 \pi\varrho(\mathbf{r}) .$$
So it seems that works if we introduce the bit about the Fourier transform of $1$ being a delta function at zero. 
Part 2
From $(1)$ we then have:
$$\hat{\phi}(\mathbf{k})
=
 \dfrac{4\pi \sigma \sqrt{2\pi}\frac{1}{2} \left[
\delta\left(k_x - \frac{2 \pi}{L}\right) + \delta\left(k_x + \frac{2 \pi}{L}\right)
\right]\delta(k_z)}{k_x^2+k_y^2+k_z^2},$$
$$\begin{aligned}[b] \phi(\mathbf{r})&=\frac{1}{(2\pi)^{3/2}}\int\limits_{\mathbb{R}^3} \, \hat{\phi}(\mathbf{k})\,e^{i\mathbf{k}\cdot\mathbf{r}}{d\mathbf{k}},\\&=\frac{\sigma\cos\left(\dfrac{2\pi x}{L}\right)}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} \dfrac{4\pi}{\left(\dfrac{2\pi}{L}\right)^2+k_y^2}\,e^{ik_y y}{dk_y},\\&=L\,\sigma\cos\left(\dfrac{2\pi x}{L}\right)\text{exp}\left[{-\dfrac{2\pi}{L}|y|}\right]\,,L\ge0.\end{aligned}\tag{3}$$
At $y\ne0$,  $(3)$ solves the homogeneous equation:
$$\nabla^2 \phi(\mathbf{r}) =0,$$
as required and at $y=0$ the derivative of $(3)$ w.r.t $y$ is not defined in the conventional sense as the limit of the derivative is not the same from both sides, however as @O.L points out in the comments, calculating derivatives in the distributional sense leads to the $\delta$ function at $y=0$ (see below). 
