# Green's function on the unit interval $[0,1]$

I would like to find the Green's function on the unit interval $[0,1]$. We have to solve the linear equation $$\frac{d^2f(x)}{dx}=g(x)$$ with boundary condition $f(0)=a$, $f(1)=b$. So the Green's function satisfies $$\frac{d^2G(x,x')}{dx}=\delta(x-x'),$$ where $δ$ is the Dirac delta function. Essentially, $$G(x,x') = A_1x+A_2$$ with $0 \le x \le x'$ and $$G(x,x')= A_3x+A_4$$ with $x' \le x \le 1$. At this point, I'd to find the constants $A_1$, $A_2$, $A_3$ and $A_4$. We know the boundary conditions : $$G(0,x')=A_1 \cdot 0 + A_2=a \implies A_2=2$$ $$G(1,x')=A_3+A_4=b.$$ Furthermore, $$\int_{x-\epsilon}^{x+\epsilon} \frac{d^2G}{dx^2}dx = \frac{dG}{dx}\big|_{x+\epsilon}+\frac{dG}{dx}\big|_{x-\epsilon}=\int_{x-\epsilon}^{x+\epsilon} \delta(x-x')=1 \implies A_3-A_1=1$$

Here, I have three equations for four constants. Questions : How could I find another equation to find the "last" constant? Should we involve the continuity of $G$?

$\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{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\imp}{\Longrightarrow} \newcommand{\Li}[1]{\,{\rm Li}_{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ You are missing the Green's function continuity at $x = x'$. See below. 

Write your solution as $${\rm f}\pars{x} = a + \pars{b - a}x + \int_{0}^{1}{\rm G}\pars{x,x'}{\rm g}\pars{x'}\,\dd x'$$ such that your Green's function satisfies homogeneous boundary conditions: $${\rm G}\pars{0,x'} = {\rm G}\pars{1,x'} = 0\,\qquad\forall\ x' \in \pars{0,1}$$ Then, $${\rm G}\pars{x,x'} = \left\lbrace\begin{array}{lcrcl} Ax & \mbox{if} & x & < & x' \\ B\pars{1 - x} & \mbox{if} & x & > & x' \end{array}\right.$$ Also, $$\left.\partiald{{\rm G}\pars{x,x'}}{x}\right\vert_{x\ =\ x'^{-}}^{x\ =\ x'^{+}} = 1 \qquad\mbox{and}\qquad{\rm G}\pars{x,x'^{-}} = {\rm G}\pars{x,x'^{+}}$$ yield $$\left.\begin{array}{rcrcl} A & + & B & = & - 1 \\ x'A & + & \pars{x' - 1}B & = & 0 \end{array}\right\rbrace \qquad\imp\qquad \left\lbrace\begin{array}{rcl} A & = & \phantom{-}x' - 1 \\ B & = & -x' \end{array}\right.$$

$$\begin{array}{|c|}\hline\mbox{}\\ {\rm G}\pars{x,x'} = \left\lbrace\begin{array}{lcrcl} \pars{x' - 1}x & \mbox{if} & x & < & x' \\ \pars{x - 1}x' & \mbox{if} & x & > & x' \end{array}\right. \\ \mbox{}\\ \hline \end{array}$$

• You used the Dirichlet boundary condition I guess, while I used different boundary conditions. However, your answer is amazing. I'll try to find my way by your answer.
– user316765
Commented May 15, 2016 at 21:23
• Haha, I add a question before your post which asking if we have to use the continuity of $G$. Thanks for your answer!
– user316765
Commented May 15, 2016 at 21:27
• @george I had a typo at the very beginning. I just fixed it. Thanks. Other boundary conditions are 'somehow' similar to the present one. Commented May 15, 2016 at 21:31