Empirically, the Legendre functions of second kind, $Q_n(x)$, appear to be of form $$ Q_n(x)=\frac{P_n(x)}{2} \cdot\ln(\frac{1+x}{1-x})+p_n(x), $$ with $P_n(x)$ the Legendre polynomials of first kind and $p_n(x)$ some rational polynomial of degree $n-1$.

This observation came up with my current reimplementation of $Q_n(x)$ for the Sage CAS. Probably it has to do with the $Q_n(x)$ satisfying the same recurrence as the $P_n(x)$? Would it be possible to give the $p_n(x)$ in terms of $P_n(x)$? It would make this implementation much faster. Also, I haven't seen such a form in the standard literature, so this may be even new (though unsurprising).

Update: as the answer shows the form is not new. However, the $p_n=W_n$ satisfy the recurrence $$ nW_n = (2nx-x)W_{n-1} - (n-1)W_{n-2}, W_0=0, W_1=1, $$ which is not in the NIST handbook.