I'm reading a physic paper with some math in it. I'm struggling following the author's mathematical equalities about differential equation. I explain:
Let $p$ a solution of $$ p''\left(x\right) - k^2 p\left(x\right) = -Q\left(x\right) $$ where $k$ is a constant and $Q$ is a function which is not known here. Let $p$ be decomposed in $$ p = p_h + p_s $$ with $p_h$ being the homogeneous solution and $p_s$ a particular solution. As the author, I've found $$ p_h = A e^{-kx} + Be^{kx} $$
Then the author writes that he computed the Wronskian, which I've done, and it gives $$W =2k$$. So far so good. Then he obtains, and I don't know how :
$$p_s = -\frac{e^{-kx}}{2k}\int_{0}^{\infty}e^{kx}Q\left(s\right)\text{d}s+\frac{e^{kx}}{2k}\int_{0}^{\infty}e^{-kx}Q\left(s\right)\text{d}s$$
which does not correspond to Wolfram's solution which still has $x$ instead of $\infty$ in the integrals upper bounds and where exponentials within the integrals depend on $s$ and not on $x$. Wolfram's solution:
$$p_s = -\frac{e^{-kx}}{2k}\int_{0}^{x}e^{ks}Q\left(s\right)\text{d}s+e^{kx}\int_{0}^{x}\frac{e^{-ks}Q\left(s\right)}{2k}\text{d}s$$
Even more intriguing, the authors finally reduce his expression to: $$ p_s = \frac{1}{2k}\int_{0}^{\infty}e^{-k\left|x-s\right|}Q\left(s\right)\text{d}s $$ where I see no clue about how this absolute value appears. What I've got is $$p_s = \frac{1}{2k}\int_{0}^{x}\left[e^{k\left(x-s\right)}-e^{k\left(s-x\right)}\right]Q\left(s\right)\text{d}s$$ and I don't see what's the trick here.
Can someone give me a bit more detail to understand how this is written.

The intended calculation seems to be a transition from the variation-of-constants formula to the Green-kernel formula.
To get from your formula to the Green-kernel formula, consider that $$ e^{kx}\int_0^xe^{-ks}Q(s)\,ds=-e^{kx}\int_x^{\infty}e^{-ks}Q(s)\,ds+e^{kx}\int_0^{\infty}e^{-ks}Q(s)\,ds $$ Now the integral factor in the last term is a constant, so that the last term can be shifted into the homogeneous/complementary solution. What then remains of the particular solution is $$ y_p(x)=-\int_0^x\frac{e^{-k(x-s)}}{2k}Q(s)\,ds-\int_x^{\infty}\frac{e^{-k(s-x)}}{2k}Q(s)\,ds =-\int_0^\infty \frac{e^{-k|x-s|}}{2k}Q(s)\,ds $$ The negative sign here is correct, it is missing in the original. The Green kernel function needs to have a $V$ or $r$ shape, thus is negative due to the zero boundary conditions.