I have always been confused about Leibniz notation. Not the notation itself, but the fact that it treats the differential operators ($d$, $\partial$) as being multipliable. The most famous example would probably be the Schrödinger equation, which if often denoted something like this: $$E\psi=\left(-\frac{h^2}{2m}\frac{\partial^2}{\partial x^2}+V(x)\right)\psi=-\frac{h^2}{2m}\frac{\partial^2\psi}{\partial x^2}+V(x)\psi$$ The problem with this is that is makes use of multiplication to expand the expression, $(a+b)c=a*c+b*c$, which would imply that $\partial *f=\partial f$. Personally, I would define the differential operators as functions: $$d(f)=\lim_{h\rightarrow \infty}{\frac{f(x+h)-f(x)}{h}}$$ So the above statement would make no sense at all. First I just accepted it as mathematical laziness, but then I stumbled upon this monstrosity:
Observe that $$\left(v^2\frac{\partial^2}{\partial x^2}-\frac{\partial^2}{\partial t^2}\right)y=0$$ can be factored as (which is what you probably mean by "squaring" in the question) $$\left(v\frac{\partial}{\partial x}+\frac{\partial}{\partial t}\right)\left(v\frac{\partial}{\partial x}-\frac{\partial}{\partial t}\right)y=0$$
What is happening here???
The operator is not "multiplied with", it is "applied to", with the meaning $$\left(\frac\partial{\partial x}\right)\psi:=\frac{\partial\psi}{\partial x}.$$
The exponent is a convenient notation for the iterated operator,
$$\left(\frac\partial{\partial x}\right)^2\psi:=\left(\frac\partial{\partial x}\right)\left(\frac\partial{\partial x}\right)\psi=\left(\frac\partial{\partial x}\right)\frac{\partial\psi}{\partial x}=\frac{\partial^2\psi}{\partial x^2}.$$
From these definitions, you can observe that the factorization is indeed possible with the natural distributivity extension
$$\left(\frac\partial{\partial x}+\frac\partial{\partial y}\right)\left(\frac\partial{\partial x}-\frac\partial{\partial y}\right)\psi=\left(\frac\partial{\partial x}+\frac\partial{\partial y}\right)\left(\frac{\partial\psi}{\partial x}-\frac{\partial\psi}{\partial y}\right)\\ =\left(\frac\partial{\partial x}\right)\frac{\partial\psi}{\partial x}+\left(\frac\partial{\partial y}\right)\frac{\partial\psi}{\partial x}-\left(\frac\partial{\partial x}\right)\frac{\partial\psi}{\partial y}-\left(\frac\partial{\partial y}\right)\frac{\partial\psi}{\partial y}\\ =\frac{\partial^2\psi}{\partial x^2}-\frac{\partial^2\psi}{\partial y^2}=\left(\left(\frac\partial{\partial x}\right)^2-\left(\frac\partial{\partial y}\right)^2\right)\psi.$$
The same principle is sometimes used in the resolution of ODEs, like
$$y'''-4y''+5y'-2y=f(x)$$ can be written
$$(D^3-4D^2+5D-2)y=(D-2)(D-1)^2y=f(x),$$ where the characteristic polynomial appears.
By setting $z=(D-1)y$ and $w=(D-1)z$, you solve first order equations $$(D-2)w=f(x)$$ then $$(D-1)z=w,$$ $$(D-1)y=z.$$
Symbolically (and taking care of the integration constants), you can even write
$$w=(D-2)^{-1}f(x),$$$$z=(D-1)^{-1}(D-2)^{-1}f(x),$$$$y=(D-1)^{-2}(D-2)^{-1}f(x).$$
You can see a direct link with operational calculus and the Laplace transform.