Here is a problem I am not sure how the solution is arrived. It would be great if you could show how to obtain the given solution as in the question. Given the ODE, and the boundaries conditions, obtain P(r) in terms of W(r).
For those who are interested, the full questions is as such,


Obviously, you can verify that the expression given for $P(r)$ satisfies the ODE.
To solve without the benefit of seeing the solution first define $F(r) = rP(r)$ and $G(r) = r W(r)$. The ODE becomes $F^{(4)}(r) = G(r)$ and upon integration from $r$ to $R>r$ we get after rearranging,
$$\tag{1}F'''(r) = F'''(R)-\int_r^RG(y) \, dy$$
Integrating (1) and rearranging again we have
$$\tag{2}F''(r) = F''(R) - F'''(R)(R-r) + \int_r^R\left(\int_x^RG(y) \, dy \right)\, dx$$
In the double integral, the integration variable $x$ lies in the interval $[r,R]$ and we can introduce the indicator function
$$\mathbf{1}_{y \geqslant x} =\begin{cases} 1, & y \geqslant x \\0, & y < x\end{cases}$$ and manipulate the integral as
$$\begin {align} \int_r^R\left(\int_x^RG(y) \, dy \right)\, dx &= \int_r^R\left(\int_r^R\mathbf{1}_{y \geqslant x} G(y) \, dy \right)\, dx \\&= \int_r^R\left(\int_r^R\mathbf{1}_{y \geqslant x} G(y) \, dx \right)\, dy \\ &= \int_r^R\left(\int_r^y G(y) \, dx \right)\, dy \\ &= \int_r^R (y-r)G(y) \, dy\end{align}$$
Using this result in (2) we get,
$$\tag{3}F''(r) = F''(R) - F'''(R)(R-r) + \int_r^R(y-r)G(y) \, dy $$
These steps can be repeated two more times to obtain
$$\tag{4}F(r) = F(R) - F'(R)(R-r) + \frac{1}{2}F''(r) (R-r)^2 - \frac{1}{6} F'''(R)(R-r)^3 \\+ \frac{1}{6}\int_r^R(y-r)^3G(y) \, dy $$
Assuming sufficient regularity, i.e., $\lim_{R \to \infty} R^kF^{(k)}(R) = 0$, we can take the limit of both sides of (4) as $R \to \infty$ to obtain
$$rP(r) = F(r) =\frac{1}{6}\int_r^\infty(y-r)^3G(y) \, dy =\frac{1}{6}\int_r^\infty(y-r)^3yW(y) \, dy,$$
and, thus,
$$P(r) =\frac{1}{6r}\int_r^\infty y(y-r)^3W(y) \, dy$$