Solving $-u''(x) = \delta(x)$

A question asks us to solve the differential equation

$-u''(x) = \delta(x)$

with boundary conditions

$u(-2) = 0$ and $u(3) = 0$ where $\delta(x)$ is the Dirac delta function. But inside the same question, teacher gives the solution in two pieces as $u = A(x+2)$ for $x\le0$ and $u = B(x-3)$ for $x \ge 0$. I understand when we integrate the delta function twice the result is the ramp function $R(x)$. However elsewhere in his lecture the teacher had given the general solution of that DE as

$u(x) = -R(x) + C + Dx$

So I dont understand how he was able to jump from this solution to the two pieces. Are these the only two pieces possible, using the boundary conditions given, or can there be other solutions?

Full solution is here (section 1.2 answer #2)

http://ocw.mit.edu/courses/mathematics/18-085-computational-science-and-engineering-i-fall-2008/assignments/pset1.pdf

Both describe the same type of function. The ramp function is nothing but \begin{align} R(x) = \begin{cases}0 & x \leq 0 \\ x & x \geq 0\end{cases} \end{align} If you use the general solution and plug in the same boundary conditions, \begin{align}u(-2) &= -R(-2) + C -2D = C - 2D = 0 \\ u(3) &= -R(3) + C + 3D = -3 + C +3D = 0\end{align} with the solution $C=6/5$, $D=3/5$, and then split it at $x=0$ to get rid of the ramp function and you obtain; \begin{align}u(x) = \begin{cases} \frac65 + \frac35 x & x \leq 0\\ -x + \frac65 + \frac35 x = \frac65 - \frac25 x &x \geq 0\end{cases}\end{align}

which is exactly the same expression you got by splitting the function earlier (pratically, there is no difference, but its shorter when written with the ramp function).

This is a good example of a question to which one can answer at some very different levels of mathematical sophistication... Since you say nothing about this, let me try an elementary approach.

What you call the Dirac delta function (which is not a function, at least not in the sense of a function from $\mathbb R$ to $\mathbb R$) is a strange object but something about it is clear:

One asks that $\displaystyle\int_y^z\delta(x)\mathrm dx=0$ if $y\leqslant z<0$ or if $0<y\leqslant z$ and that $\displaystyle\int_y^z\delta(x)\mathrm dx=1$ is $y<0<z$.

We will not use anything else about the Dirac $\delta$.

If one also asks that $\displaystyle\int_y^zu''(x)\mathrm dx=u'(z)-u'(y)$ for every $y\leqslant z$, one can integrate once your equation $\color{red}{-u''=\delta}$, getting that there exists $a$ such that $$u'(x)=a-[x\geqslant0],$$ where we used Iverson bracket notation. Now let us integrate this once again.

Using the facts that $\displaystyle\int_y^zu'(x)\mathrm dx$ should be $u(z)-u(y)$ for every $y\leqslant z$, and the value of $\displaystyle\int_y^z[x\geqslant0]\mathrm dx$, one gets that for every fixed negative number $x_0$, $$u(x)=u(x_0)+a\cdot (x-x_0)-x\cdot[x\geqslant0].$$ This means that $b=u(x_0)-a\cdot x_0$ does not depend on $x_0<0$, hence finally, for every $x$ in $\mathbb R$, $$\color{red}{u(x)=a\cdot x+b-x\cdot[x\geqslant0]}.$$ (And, in the present case, the condition that $u(-2)=u(3)=0$ imposes that $a=3/5$ and $b=6/5$.)

This is the general solution of the equation $-u''=\delta$. Note that every solution $u$ is $C^\infty$ on $\mathbb R\setminus\{0\}$ but only $C^0$ at $0$ hence $u'$ and $u''$ do not exist in the rigorous sense usually meant in mathematics. Note finally that $u$ is also $$u(x)=a\cdot x+b-x\cdot[x\gt0].$$

I guess now I understand why and how the teacher came up with the two pieces. Since the form of the solution $u(x)$ is known (it is linear) and because of the presence of the ramp function, one could conclude two pieces could be in the form of $A(x+2)$ and $B(x-3)$ because both these functions are zero at the boundaries left and right respectively.

About the why: Then he can use simpler integration and derivation:

$-\int u''(x) = \int \delta(x)$

$-[u'(x)]_L^R = 1$

$u_R'(x) - u_L'(x) = -1$

Since we know the pieces, and they are in pretty simple form we can apply the derivatives above and substitute

$B - A = -1$

The pieces meet at $x=0$, and we know that due to the ramp function, continuing

$A(0+2) = B(0-3)$

$A = -\frac{3}{2}B$

Combining

$B - (-3/2 B ) = -1$

$B = -0.4$

$A = 0.6$

I copied this from the solution link I shared above. Does the reasoning make sense? It does look like a shortcut of sorts I guess.

$$u’’(x)=-\delta(x)$$

Integrating:

$$u’(x)=-H(x)+C_1$$, where $$H(x)$$ is the Heaviside distribution.

Integrating again:

$$u(x)=-x H(x)+C_1x+C_2$$

In the question, you say …”I dont understand how he was able to jump from this solution to the two pieces.”

You can see why:

If, in the expression $$u(x)=-x H(x)+C_1x+C_2$$, we ​​do $$C_1=0.5$$ and $$C_2=0$$,

it will remain $$u(x)=-x H(x)+0.5x$$.

So, the expression of $$u (x)$$ will be formed by $$2$$ rays whose slope will be:

$$m=0.5$$, if $$x<0$$

$$m=-0.5$$, if $$x>0$$

Specifically, in this case it will be $$u(x)=-x H(x)+0.5x=-\frac{1}{2}\vert x \vert$$

Returning to $$u(x)=-x H(x)+C_1x+C_2$$, we apply the boundary conditions:

$$u(-2)=0 \rightarrow 0=2H(-2)-2C_1+C_2$$, where $$H(-2)=0$$

$$u(3)=0 \rightarrow 0=-3H(3)+3C_1+C_2$$, where $$H(3)=1$$

Hence:
$$C_1=\frac {3}{5} , C_2=\frac {6}{5}$$

Finally, with boundary conditions, the solution is:

$$u(x)=xH(x)+\frac{3}{5} x+\frac{6}{5}$$

Its graphical representation in Mathematica is done with:

Plot[-x*HeavisideTheta[x]+3/5*x+6/5,{x,-3,4}] [Plot of u(x)]1

• Welcome on the MathSE! – peterh Aug 15 '18 at 23:15
• Welcome to MSE. You appear to have posted your answer twice, seemingly to add the "Plot of $u(x)$" description. You can add extra stuff to a post, after you have submitted, by using the edit option. You should also see a delete option so you can delete one of your posts. – Daniel Buck Aug 17 '18 at 16:54