Green Function in One Dimension I am supposed to solve the following:

Show that the Green function for $\dfrac{d^2}{dx^2}$ in $(0,1)$ is given by
  $$
G(x, y)=\left\{
\begin{array}{ll}
x(y-1), \ if \ \ x<y \\
y(x-1), \ if \ \ y<x \end{array} \right. .
$$

Remembering that the Green function is given by $G(x, y)=\Gamma(x-y)-\Phi(x, y)$, where $\Gamma$ is the fundamental solution and $\Phi$ is an harmonic function that coincides with $\Gamma$ in the boundary.
My question is: how am I supposed to procced in this case? The fundamental solution that I have is defined only for dimensions $\geq 2$. I tried to find a different fundamental solution, such as $cx+d$, where $c, d$ are constants. But I got stuck.
Can anyone give me a clue. Thanks in advance. 
 A: The fundamental solution to Laplace's equation in one dimension is the function $\Gamma: \mathbb{R} \to \mathbb{R}$ given by $\Gamma(x) = \frac{1}{2} \vert x \vert$.  Indeed, for $\psi \in C^\infty_c(\mathbb{R})$ we compute 
$$
\int_{\mathbb{R}} \vert x \vert \psi''(x) dx = \int_0^\infty x \psi''(x) dx - \int_{-\infty}^0 x \psi''(x) dx = \int_0^\infty -\psi'(x) dx + \int_{-\infty}^0 \psi'(x) dx
\\ = \psi(0) + \psi(0) = 2\psi(0),
$$
and hence 
$$
\int_{\mathbb{R}} \Gamma(x) \psi''(x) dx = \psi(0) = \langle \delta_0,\psi \rangle
$$
for all $\psi \in C^\infty_c(\mathbb{R})$.  This means that $\Gamma'' = \delta_0$ in the sense of distributions, and so $\Gamma$ is  the fundamental solution.
A: In 1d case, $\frac{d^2G}{dx^2} = 0$ means $G$ is linear function in $(0, y)$ and $(y, 1)$, suppose
$$ G(x, y) =\begin{cases}ax + b, 0 < x <y\\ cx + d, y < x < 1 \end{cases}$$
From the homogeneous boundary condition $G(0)=G(1)=0$ we can get $b = 0, d = -c$. For any test function $\psi \in C^{\infty}_c(0, 1)$, we have
$$ \begin{aligned}\psi(y) &= \int_0^1\frac{d^2G(x, y)}{dx^2}\psi dx \\ &= \int^1_0 G(x, y)\psi^{''}dx\\&=\int_0^yax\psi^{''}dx + \int_y^1c(x-1)\psi^{''}dx\end{aligned}$$
We can find $a=y-1$ and $c=y$, so we get the green function
$$ G(x, y) =\begin{cases}x(1-y), 0 < x <y\\ y(x-1), y < x < 1 \end{cases}$$
