$(D^2 -1)y=0 \iff (D-\tanh x)(D+ \tanh x)y=0$ where $D \equiv \frac{d}{dx}$?! In this lecture, the professor explains that factoring differential operators if different from factoring numbers, and provides this example. I have no idea where it comes from and indeed why it is true. Could someone provide an explanation for the fact that:
$$(D^2 -1)y=0 \iff (D-\tanh x)(D+ \tanh x)y=0$$
 A: It's not correct. Multiplication of differential operators is composition, thus we have
$$\begin{align}
(D-\tanh x)(D+\tanh x) &= D^2 + \tanh' x + \tanh x \cdot D - \tanh x\cdot D - \tanh^2 x\\
&= D^2 + (1 - \tanh ^2 x) - \tanh^2 x\\
&= D + 1 - 2\tanh^2 x.
\end{align}$$
If we suspect the $\tanh$ is a typo, and it should have been $\tan$ instead, a similar computation yields
$$(D-\tan x)(D+\tan x) = D^2 +1.$$
The same would be obtained by the factorisation $D^2 + 1 = (D - i)(D+i)$.
Generally, we have
$$(D - f)(D + f) = D^2 + f' + f\cdot D - f\cdot D - f^2 = D^2 + f' - f^2.$$
And taking a second look, we had the wrong order of factors in the original, what we need is
$$\begin{align}
(D + \tanh x)(D - \tanh x) &= D^2 - \tanh' x - \tanh x\cdot D + \tanh x \cdot D - \tanh^2 x\\
&= D^2 - (\tanh' x + \tanh^2 x)\\
&= D^2 - (1 - \tanh^2 x + \tanh^2 x)\\
&= D^2 -1.
\end{align}$$
When apart from $D$ everything in the factors are constants, the factors commute, but when some non-constant function occurs, the product of differential operators is not commutative.
