Why is it that with quaternions $ij \neq ji$? I've been using rotations in 3d space lately for simulations. Today I came across the quaternion, which from what I understand will be a much better alternative to my cross/dot product methods.
Now I was messing with the algebra, and I can't seem to wrap my head around how $ij$ does not equal $ji$. In elementary school, I learned to treat $i^2=-1$, and to treat it like any other variable with that caveat. So does someone have an alebraic/serious proof of how we can fairly say that $ij$ does not equal $ji$? I understand rotations aren't associative, but that doesn't explain the algebra.
 A: The thing is...not everything is commutative, in particular rotations in 3d do not commute. 
So to answer your question it is not "provably true" that $ij\neq ji$ in the quaternion world, more the quaternion world is defined to be a world in which $ij \neq ji$ (so as to model 3d rotations well).
A: Well, this emerges from the very definition, since we have the so called Hamilton rules (that's the definition of the multiplication inside the set of Quaternions)
$$
i^2=j^2=k^2=ijk=-1
$$
this means, if we multiply from the RIGHT side with $k$, then we get
$$
ijk^2=ij(-1)=-k\Leftrightarrow ij=k
$$
similarly we can get $ji$. we start again at $ijk=-1$, then we multiply from the LEFT side first with $i$ and then with $j$ and we get
$$
jiijk=(-1)(-1)k=ji(-1)\Leftrightarrow k=(-1)ji\Leftrightarrow ji=-k
$$ 
You don't have always commutation of the multiplication, for example look at the matrix multiplication, here it usually doesn't hold either that $AB=BA$ (like your rotations don't commute in general).
If you want to read some of the history behind the invention, then you might have a look to this Hamilton link (thanks to pjs36). Then you'll also see the historical connections of the Quaternions and the Complex Numbers. 
A: The algebra of quaternions is simply defined by the relations that $i^2 = j^2 = k^2 = -1$, with $ij = -ji$ (and similar relations about the product of any two of the $i,j,k$). So, in a potentially unsatisfying way, we know that $ij = -ji$ when we're talking quaternions simply because that's what the definition tells us.

Here's an analogy. In school, before you had learned that there's a (complex) number $i$ so that $i^2 = -1$, you were probably told "Squaring any number always gives us a positive number, since positive $\times$ positive is positive, and negative $\times$ negative is positive".
So, it wouldn't be surprising if you had some serious objections to hearing about this mysterious new number $i$ whose square is negative! Perhaps in the past your teacher had said "Squaring any number always gives us a positive number", or perhaps they told you the full story and said "Squaring any real number always gives us a positive number," but before seeing complex numbers (like $i$) that word 'real' was probably inconsequential: You only knew of real numbers, so you (at best) tuned that caveat out!
So, when you learned in school that "multiplication is commutative", what you really learned was that "multiplication of complex numbers is commutative" (which includes multiplying integers, rational numbers, and real numbers too). In this new, larger number system (the quaternions), it's not necessarily true that multiplication is commutative.
Note that lots of things aren't commutative. A big example is the composition of functions, which includes linear transformations (like rotations). So, this just might just be the first non-commutative algebraic structure whose objects look like familiar numbers that you've encountered. But you have encountered situations where "order matters" before, almost certainly. This is one of those cases.
A: \begin{align*}
i^2=j^2=k^2=ijk&=-1\\
i^2jk&=-i\\ 
-jk&=-i\\
-j^2k&=-ji\\
k&=-ji
\end{align*}
A: Suppose that we to the reals add to elements $i, j$ such that $i^2=j^2=-1$ in such a way that the end result is a commutative ring. In other words, we look at the quotient ring $\mathbb{C}[j]/(j^2+1)$. We define
$$
k:=ij
$$
and from commutativity, $k^2=i^2j^2=1$, which implies
$$
k^2-1=(k+1)(k-1)=0,
$$
and so neither $k+1$ nor $k-1$ have an inverse in the ring. Thus we do not have a field. In the construction of quaternions, we lose the commutativity, but retain the existence of inverses of nonzero elements. As such, the quaternions carry the structure of a division ring, or skew field. A similar trade-off occurs when considering octonions (loss of associativity) and sedenions (loss of alternativity).
As others have stressed, it should not come as a surprise that we'd lose commutativity in a 4D-system in which one may model 3D-rotations, as 3D-rotations do not in general commute.
