Let $q = a + bi + cj + dk = a + Q \in \mathbb{H}$ a quaternion. So, we have:
$$\sqrt{q} = \sqrt{\frac{|q| + a}{2}} + \frac{Q}{|Q|} \sqrt{\frac{|q| - a}{2}}$$
I have a question: this formula works for octcnions?
If yes, let $\mathcal{O} = a_0 + \displaystyle{\sum_{k = 1}^{7} a_k e_k} = a_0 + \Sigma \in \mathbb{O}; \text{ } \{ e_1, \dots , e_7 \} \text{ are the imaginary units of } \mathbb{O}$
So, the square root of $\mathcal{O}$ is:
$$\sqrt{\mathcal{O}} = \sqrt{\frac{|\mathcal{O}| + a_0}{2}} + \frac{\Sigma}{|\Sigma|} \sqrt{\frac{|\mathcal{O}| - a_0}{2}}$$
Welcome to the Mathematics StackExchange, Gabriel! Let's try it out.
To make sure that we're doing it correctly, let's first verify the formula for $ \sqrt q $. So $$ ( \sqrt q ) ^ 2 = \biggl ( \sqrt { \frac { \lvert q \rvert + a } 2 } + \frac Q { \lvert Q \rvert } \sqrt { \frac { \lvert q \rvert - a } 2 } \biggr ) ^ 2 = \frac { \lvert q \rvert + a } 2 + 2 \frac Q { \lvert Q \rvert } \frac { \sqrt { \lvert q \rvert ^ 2 - a ^ 2 } } 2 + \frac { Q ^ 2 } { \lvert Q \rvert ^ 2 } \frac { \lvert q \rvert - a } 2 \text . $$ Using $ Q ^ 2 = - \lvert Q \rvert ^ 2 $ since $ Q $ is a purely imaginary quaternion, along with $ \lvert q \vert ^ 2 = a ^ 2 + \lvert Q \rvert ^ 2 $ since also $ q = a + Q $ with $ a $ real, this becomes $$ \frac { \lvert q \rvert + a } 2 + 2 \frac Q { \lvert Q \rvert } \frac { \lvert Q \rvert } 2 - \frac { \lvert Q \rvert ^ 2 } { \lvert Q \rvert ^ 2 } \frac { \lvert q \rvert - a } 2 = \frac { \lvert q \rvert + a } 2 + Q - \frac { \lvert q \rvert - a } 2 = a + Q = q \text . $$ So that checks out.
Now we do it for $ \sqrt { \mathcal O } $: $$ ( \sqrt { \mathcal O } ) ^ 2 = \biggl ( \sqrt { \frac { \lvert \mathcal O \rvert + a _ 0 } 2 } + \frac \Sigma { \lvert \Sigma \rvert } \sqrt { \frac { \lvert \mathcal O \rvert - a _ 0 } 2 } \biggr ) ^ 2 = \frac { \lvert \mathcal O \rvert + a _ 0 } 2 + 2 \frac \Sigma { \lvert \Sigma \rvert } \frac { \sqrt { \lvert \mathcal O \rvert ^ 2 - a _ 0 ^ 2 } } 2 + \frac { \Sigma ^ 2 } { \lvert \Sigma \rvert ^ 2 } \frac { \lvert \mathcal O \rvert - a _ 0 } 2 \text . $$ Using $ \Sigma ^ 2 = - \lvert \Sigma \rvert ^ 2 $ since $ \Sigma $ is a purely imaginary octonion, along with $ \lvert \mathcal O \vert ^ 2 = a _ 0 ^ 2 + \lvert \Sigma \rvert ^ 2 $ since also $ \mathcal O = a _ 0 + \Sigma $ with $ a _ 0 $ real, this becomes $$ \frac { \lvert \mathcal O \rvert + a _ 0 } 2 + 2 \frac \Sigma { \lvert \Sigma \rvert } \frac { \lvert \Sigma \rvert } 2 - \frac { \lvert \Sigma \rvert ^ 2 } { \lvert \Sigma \rvert ^ 2 } \frac { \lvert \mathcal O \rvert - a _ 0 } 2 = \frac { \lvert \mathcal O \rvert + a _ 0 } 2 + \Sigma - \frac { \lvert \mathcal O \rvert - a _ 0 } 2 = a _ 0 + \Sigma = \mathcal O \text . $$ Basically, the exact same argument.
Of course, you want to look over every step and make sure that it's still valid. But we didn't use associativity or a lack of zero-divisors or anything like that; it's almost all real-number arithmetic with some basic facts about absolute values that continue to hold. (Indeed, the only time anything imaginary is multiplied by anything imaginary, it's $ Q ^ 2 $ or $ \Sigma ^ 2 $, which doesn't bring up any issues, not even noncommutativity.) So it works!