So, my textbook goes about defining the invariant spacetime in the following way:
Consider two frames of references, S and S', with a relative speed to each other, coinciding at t=t'=0. At t=0, a light sparks from the origin of S, and therefore we get the following equation for the wavefront:
$(ct)^2 = x^2 + y^2 + z^2$.
We can do the same for S', so in the end we obtain
$(ct)^2 - x^2 - y^2 - z^2 = (ct')^2 - x'^2 - y'^2 - z'^2$.
Then my textbook defines the distance between these two events as
$\Delta S^2 := (c\Delta t)^2 - (\Delta x)^2 - (\Delta y)^2 - (\Delta z)^2 $.
But here I'm getting confused. I'm assuming that we can say $\Delta x = x' - x$,
so that, if we take $y'=y$ and $z'=z$ for simplicity, we'd get
$\Delta S^2 = (S'-S)^2 = c^2\Delta(t'-t)^2 - (x'-x)^2 $.
But this would not yield to our previous equation, because $(x'-x)^2 \neq x'^2 - x^2.$
So where am I making a mistake?