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

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. 
