Starting from Legendre's Differential Equation $$\begin{align*} (1-x^2)y^{\prime\prime}-2xy^{\prime}+L(L+1)y=0\tag{1} \end{align*}$$
In the text that follows $P_L(x)$, $P_M(x)$ represent general Legendre Polynomials.
We can rewrite $(1)$ in the form $$\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_L\acute (x)\Big)+L(L+1)P_L(x)=0\tag{2}$$
Now after writing the same for $P_M(x)$ $$\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_M\acute (x)\Big)+M(M+1)P_M(x)=0\tag{3}$$
and then we multiply $(2)$ by $P_M(x)$ to get $$\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_L\acute (x)\Big)P_M(x)+L(L+1)P_L(x)P_M(x)=0\tag{4}$$ and $(3)$ by $P_L(x)$ to get $$\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_M\acute(x)\Big)P_L(x)+M(M+1)P_L(x)P_M(x)=0\tag{5}$$
subtracting $(5)$ from $(4)$ gets us to
$$\color{red}{P_M(x)\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_L\acute (x)\Big)-P_L(x)\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_M\acute(x)\Big)}+\Big(L(L+1)-M(M+1)\Big)P_L(x)P_M(x)=0\tag{6}$$
To continue this proof I need to show that the first two terms of $(6)$ marked in $\color{red}{\rm{red}}$: $$\color{red}{P_M(x)\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_L\acute (x)\Big)-P_L(x)\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)P_M\acute(x)\Big)}$$ can be written as $$\color{blue}{\dfrac{\rm{d}}{\rm{d}x}\Big((1-x^2)(P_M(x)P_L\acute (x)-P_L(x)P_M\acute (x))\Big)}$$
Is anyone able to demonstrate how to reach the $\color{blue}{\rm{blue}}$ from the $\color{red}{\rm{red}}$ expression by showing the intermediate steps? Or some hints would be very nice. Thanks.
Use the normal add and subtract the same term technique, for example: $$ A(b C')' - C(b A')' = A(b C')' - C(b A')' + A'b C'-A'b C' = (A b C')' -(A' b C)' = (A b C' - A' b C)' = (b(A C' - C A'))' $$