I'm currently studying Computational Mechanics, and an important step to solve problems is knowing how to express physical interactions in terms of mathematical equations.
Consider for example, the problem of achieving the nodal displacement of a bar that is clamped on a wall, and there's a punctual force $P$ applied in the middle of its length.
The differential equation that rules the system is:
$$\frac{d^2u}{dx^2}=-\frac{P}{EA}\delta\left(x-L\right)$$
where:
- $u$ is the displacement;
- $E$ is the Young's modulus;
- $A$ is the sectional area of the bar;
- $L$ is half of the length of the bar;
- $\delta$ is the Dirac delta function.
I intend to know if my solution of this problem is mathematically right:
I just integrated two times the differential equation and got: $$ u(x)= \begin{cases} \hphantom{-}C_1x+D_1 &\text{if x}<L,\\[2ex] \left(-\frac{P}{EA}+C_1\right)(x-L)+D_2&\text{if x}>L. \end{cases} $$ where $C_1$, $D_1$ and $D_2$ are constants of integration. Now we just need to look for boundary conditions. The clamping condition gives: $$u(0)=0$$ The continuity of the bar gives: $$u(L^-)=u(L^+)$$ The clamping is on the left side of the bar, so the force $P$ will only be applied on the immediate left surroundings of $L$, i.e. $L^-$ ($P$ it's the complement action of the reaction on the wall). So, $$P=EA\frac{du}{dx}\bigg{|}_{(x=L^-)}$$ with these conditions I got: $$ u(x)= \begin{cases} \hphantom{-}\frac{P}{EA}x &\text{if x}<L,\\[2ex] \frac{P}{EA}L &\text{if x}>L. \end{cases} $$
My main difficulty in these kind of problems is how to deal with the Dirac delta functions, and how to deal with the boundary conditions in respect to the concentrated applied forces. This requires much more than pure mathematical analysis. I'm not 100% confident of what I did because I didn't compare the results with known literature. The bibliography of my course doesn't talk about the solution of differential equations of this kind. Do you know any good books that treat this type of problems?

You have two affine solutions, one on the left half, and one on the right half. This leaves you with 4 unknown coefficients. You need four conditions. They can be listed as follows:
Then you can solve and get the solution you have shown I think.
You can also integrate directly your (normalized for the sake of conciseness) ODE using the Theory of Distributions (below, all the derivatives are understood in the sense of distributions): $$u_{,xx}=-\delta_L\;\Rightarrow\;\exists a\in\mathbb R\,|\, u_{,x}=-H(x-L)+a $$ where $H$ is the usual Heaviside function. It can thus be integrated in the usual sense on two intervals: $$u(x)=\left\{\begin{aligned}&ax+b&&0<x<L\\&(a-1)x+c&& L<x<2L\\\end{aligned}\right.$$ The two boundary conditions together with the continuity of the displacement $u$ will uniquely define the unknowns $a$, $b$ and $c$. Note that in this approach, the equilibrium condition at $x=L$ is directly satisfied when integrating. If you do not enforce continuity of $u$, you will find infinitely many solutions.