I have two operators, $A$ and $B$. I want to figure out their commutator, $[A,\,B]$. The commutator $\left[A,\,B^2\right]=C$ is known. Equivalently, I want to compute $\left[A,\,\sqrt{D}\right]$ given a known $[A,\,D]=C$.
The best I have been able to do is to take the identity $$\left[A,\,B^\beta\right] = \left[A,\,B\right]B^{\beta-1} + B \left[A,\, B^{\beta-1}\right]$$ to get that $$C = [A,\,B]B + B[A,\,B].$$ This can be solved for the desired commutator in two ways: \begin{align} [A,\,B] & = CB^+ - B[A,\,B]B^+,\ \mathrm{and} \\ & = B^+ C - B^+ [A,\, B] B, \end{align} where $B^+$ is the a pseudo-inverse of $B$ (e.g. the Moor-Penrose inverse). Either of those equations can be applied recursively to get the formulae \begin{align} [A,\,B] & = \sum_{j=0}^\infty (-1)^j B^j C B^+ \left(B^j\right)^+,\ \mathrm{and} \\ & = \sum_{j=0}^\infty (-1)^j \left(B^j\right)^+ B^+ C B^j. \end{align}
Is this the best that can be done? If so, how can I tell if those infinite series are convergent? Can more be said if $B$ is a positive semi-definite Hermitian operator (i.e. all eigenvalues are $\ge 0$, but $0$ is definitely one of the eigenvalues)?
In the exact use-case, $A=a(\mathbf{k})$, $B = \sqrt{a^\dagger(\mathbf{k})\, a(\mathbf{k})}$, and $[a(\mathbf{k}),\, a^\dagger(\mathbf{k}')\,a(\mathbf{k}')] = a(\mathbf{k})\,\delta(\mathbf{k}-\mathbf{k}')$. There are a few more identities (like $[a(\mathbf{k}),\, a^\dagger(\mathbf{k}')] = \delta(\mathbf{k}-\mathbf{k}')$) and that the eigenvalues of $a^\dagger(\mathbf{k})\,a(\mathbf{k})$ are discrete, starting at $0$ and going up to infinity. That is, they're Bosonic creation and annihilation operators in quantum field theory.
I don't know if this translates to your setting, but if you look at the (Hamilton) quaternions and let $A, B$ be pure quaternions, then $B^2 \in \mathbb{R}$ and hence $[A, B^2] = 0$. But $[A, B]$ could be any pure quaternion (or at least all those $[A,B]$ span the full space of pure quaternions, I have not checked the stronger statement.) So there is not much to infer about it.