0

I have the Differential Equation:

$$u_{xx} = \cases{1; \ -1\le x \le1\\ 0;-\infty<x<-1,1<x<\infty} \\ u(-1) = -1,u(1) =1$$The forcing term on the right hand side is a square wave from x = -1 to 1.

If we are finding Green's function we want to find a function which satisfies the following differential equation $\frac{\partial^2 G(x,x')}{\partial x^2} = \delta(x-x')$ with the following Boundary Conditions $G(-1,x') = -1,G(1,x') =1$.

As I understand it, we have an impulse at some point $x'$ and there is an impulse response at all points $x>x'$ and $x<x'$ which gives us 2 separate equations for Green's function for each case. Using the homogeneous equation, we get the two equations for Green's function:

$$G(x,x') = Ax + B; x<x' \\ G(x,x') = Cx +D;x>x'$$ Applying the Boundary Condition for $x=-1$ gives $G(-1,x') = -A+B = 0 \rightarrow A = B \rightarrow G(x,x') = A(x+1); x<x'$,

Applying the Boundary Condition for $x=1$ gives $G(1,x') = C+D = 0 \rightarrow C = -D \rightarrow G(x,x') = D(1-x);x>x'$,


NEW WORKINGS

Combining these BCs with the conditions that (i) $G(x'+0,x') = G(x'-0,x')$ and (ii) $\frac{\partial G(x'+0,x')}{\partial x} - \frac{\partial G(x'-0,x')}{\partial x} = 1$ gives the following: $$(i):A(x'+1) = D(1-x') \rightarrow A = \frac{D-A}{x'}-D \\ (ii):A+D=1 \rightarrow A = 1-D$$

And plugging in (ii) into (i) gives: $1-D = \frac{D-(1-D)}{x'}-D \rightarrow 1 = \frac{2D-1}{x'} \rightarrow D = \frac{1+x'}{2}$ And plugging this result back (ii) gives: $A = 1 + \frac{1+x'}{2}$. This gives the final forms of Green's function as: $$G(x,x') = (1+\frac{1+x'}{2})(1+x); x<x' \\ G(x,x') = (\frac{1+x'}{2})(1-x);x>x'$$


So our integral for $u(x) = \int_{-\infty}^{\infty}G(x,x')f(x')dx'$ becomes:

$$u(x) = \int_{-1}^x(1+\frac{1+x'}{2})(1+x)*1dx'+\int_x^1(\frac{1+x'}{2})(1-x)*1dx'$$

$$u(x) = (1+x)\int_{-1}^x 1+\frac{1+x'}{2} dx' + (1-x)\int_x^1 \frac{1+x'}{2}dx' = (1+x)(x'|_{-1}^{x}+\frac{1}{2}(x'^2/2+x')|_{-1}^{x}) + \frac{(1-x)}{2}(x'+x'^2/2)|_x^1 \\ = (1+x)\bigg((1+x)+\frac{1}{2}\Big(\frac{x^2-1}{2}+(1+x)\Big)\bigg) + \frac{(1-x)}{2}\bigg((1-x)+\frac{1-x^2}{2}\bigg)$$

I slightly modified this from THIS EXAMPLE, but they had $x'$ in one of their 2 equations for Green's function, but I didn't see an explanation or working for how $x'$ got in there. I'm assuming if I made a mistake, it would be with respect to that, but please let me know if that and/or something else was an issue. Thanks!

  • 1
    In addition to the boundary conditions, the Green's function must satisfy two more conditions: (i) $G(x'+0,x')=G(x'-0,x')$, and (ii) $\partial_xG(x'+0,x')-\partial_xG(x'-0,x')=1$. These conditions fix the values of $A$ and $D$ (which, by the way, are functions of $x'$). – Gonçalo Sep 16 '23 at 04:23
  • @Gonçalo Do you have a link for the rules you are referencing so that I can take a look at them a bit more closely? Is this on the wiki page for Green's Function or some other online resource? Or perhaps a textbook? Thank you! – Researcher R Sep 16 '23 at 07:00
  • @Gonçalo Also, just to clarify $\partial_x$ is a shorthand for saying $\frac{\partial}{\partial x}$, correct? I'm not all that knowledgeable of various mathematical notations so I figured I'd make sure. Sorry! – Researcher R Sep 16 '23 at 07:04
  • 1
    Yes, that's correct. – Gonçalo Sep 16 '23 at 07:32
  • @Gonçalo (i) would give: $A(x'+1) = D(1-x')$ and re-arranging would give $A = \frac{D-A}{x'}-D$ and (ii) from the derivatives would give $A-(-D) = 1$ which would give $A = 1-D$ and then I'd plug in the result from (i) into (ii), and solve for constants A and D, correct? – Researcher R Sep 16 '23 at 09:42

1 Answers1

2

Since the boundary conditions $u(\pm 1)=\pm 1$ are inhomogeneous, the solution to the ODE $$ u_{xx}=f(x) \tag{1} $$ is not given by$^{(*)}$ $$ u(x)=\int_{-1}^{1} G(x,x')f(x')\,dx', \tag{2} $$ where $G(x,x')$ is the solution to $$ G_{xx}(x,x')=\delta(x-x') \tag{3} $$ satisfying the boundary conditions $G(\pm 1,x')=\pm 1$. Here is the reason: if we take, for instance, $x=1$ in $(2)$, we obtain $$ u(1)=\int_{-1}^{1} G(1,x')f(x')\,dx'=\int_{-1}^{1} f(x')\,dx', \tag{4} $$ which, in general, does not satisfy $u(1)=1$. Instead, the solution to $(1)$ is given by $$ u(x)=u_0(x)+\int_{-1}^{1} \tilde{G}(x,x')f(x')\,dx', \tag{5} $$ where $u_0(x)$ is the solution to the homogeneous ODE $u_{xx}=0$ satisfying the inhomogeneous boundary conditions $u(\pm 1)=\pm 1$, and $\tilde{G}(x,x')$ is the solution to $(3)$ satisfying the homogeneous boundary conditions $\tilde{G}(\pm 1,x')=0$. A straightforward calculation then shows that $$ u_0(x)=x \tag{6} $$ and$^{(\dagger)}$ $$ \tilde{G}(x,x')=\begin{cases} \frac{1}{2}(x+1)(x'-1) &\text{if $x<x'$,} \\ \frac{1}{2}(x-1)(x'+1) &\text{if $x>x'$.} \end{cases} \tag{7} $$ Applying these results to $(1)$ in the case $f(x)=1$, we obtain \begin{align} u(x)&=x+\frac{1}{2}(x-1)\int_{-1}^x(x'+1)\,dx'+\frac{1}{2}(x+1)\int_x^1(x'-1)\,dx' \\ &=x+\frac{1}{2}(x-1)\left(\frac{x^2}{2}+x+\frac{1}{2}\right)+\frac{1}{2}(x+1)\left(-\frac{x^2}{2}+x-\frac{1}{2}\right) \\ &=x+\frac{1}{2}(x^2-1). \tag{8} \end{align} One can readily check that $(8)$ satisfies $u_{xx}=1$ and $u(\pm 1)=\pm 1$.


$^{(*)}$ I'm assuming that $f(x)$ has support in the interval $[-1,1]$; likewise, the results presented are only valid for $x\in[-1,1]$.

$^{(\dagger)}$ One can readily verify that (i) $\tilde{G}(\pm 1,x')=0$, (ii) $\tilde{G}(x'+0,x')=\tilde{G}(x'-0,x')$, and (iii) $\tilde{G}_x(x'+0,x')-\tilde{G}_x(x'-0,x')=1$.

Gonçalo
  • 9,312
  • I can see I flubbed A as well. And I think (4) should be integrated wrt $dx'$. Thank you for this well made and concise answer. It answers a lot of confusions that I've been having about how to use it for inhomogeneous DEs with inhomogeneous BCs. Also, I should have made the BC for $u(-1)$ since I wanted to make the forcing term an entirely positive square wave, whoops. – Researcher R Sep 17 '23 at 22:22
  • Your are correct about the integrals in $(4)$. I have edited my answer accordingly. Thank you. – Gonçalo Sep 17 '23 at 22:26
  • 1
    So it looks similar to how we want solution = general + particular i.e. $y=c_1x_h + c_2x_p$ where $c_1x_h$ is the the solution to the homogeneous differential equation with inhomogeneous BCs, and $c_2x_p$ is the solution to the inhomogeneous differential equation with homogeneous BCs. And we're just doing this in the context of using Green's function instead, Is that correct? – Researcher R Sep 17 '23 at 22:35
  • 1
    It's absolutely correct. – Gonçalo Sep 17 '23 at 22:42