Derivation of the Lorentz transformation without assuming that clocks are synchronized when origins align I have looked at the Wikipedia article on derivations of the Lorentz transformations, as well as some answers on this site - for example, one on the geometric derivation and another without the usage of sperical wavefronts or hyperbolic functions. But I haven't found what I was looking to clarify - just saying so that this question isn't closed as a duplicate.

I'm trying my hand at deriving Lorentz transformations using 3 postulates - it's an affine transformation, the frames are equivalent, so they see the same speed of each other's origins and that the speed of light is the same. Let's say frame $S$ is moving at velocity $v$ in the $x$-direction w.r.t. $S'$. From linearity, we have
$$t'=a_1t+a_2x+a_3\\x'=b_1t+b_2x+b_3$$
Let the position of the origin of $S$ in the $S'$ frame at $t'=0$ be $x'_{O}[t'=0]$. Since $x=0$, we get $t=-a_3/a_1$ by substituting $t'=0,x=0$ in the first equation. So $x'_O[t'=0]=-\frac{b_1a_3}{a_1}+b_3$. Similarly at $t'=T'$, we have for the $S$ origin $t=\frac{T'-a_3}{a_1}$. So $x'_O[t'=T']=\frac{b_1(T'-a_3)}{a_1}+b_3$. Using $x'_O[t'=T']-x'_O[t'=0]=vT'$, we get $b_1=va_1$. Now we have
$$t'=a_1t+a_2x+a_3\\x'=va_1t+b_2x+b_3$$
Now consider a photon $P$ that starts from the origin in $S$ at $t=0$. In the $S$ frame, $x_P[t=0]=0$ and $x_P[t=T]=cT$. The starting time in frame $S'$ will be $t'[t=0,x=0]=a_3$. The ending time will be $t'[t=T,x=cT]=a_1T+a_2cT+a_3$. Similarly, $x'[t=0,x=0]=b_3$ and $x'[t=T,x=cT]=va_1T+b_2cT+b_3.$ This gives
$$va_1T+b_2cT=ca_1T+a_2c^2T\\\implies va_1+b_2c=a_1c+a_2c^2$$
Finally, let the position of the origin of $S'$ in the $S$ frame at $t=0$ be $x_{O'}[t=0]$. Substituting $t=0,x'=0$ in the second equation, $x_{O'}[t=0]=-b_3/b_2$. Similarly $x_{O'}[t=T]=\frac{-b_1T-b_3}{b_2}$, and so
$$x_{O'}[t=T]-x_{O'}[t=0]=-\frac{b_1T}{b_2}=-vT\implies b_1=vb_2\implies b_2=a_1
\\\implies va_1=a_2c^2\implies a_2=\frac{va_1}{c^2}$$
The transformation can thus be restated as (on the RHS I'll replace $a_1$ by $\gamma$):
$$t'=a_1t+\frac{va_1}{c^2}x+a_3=\gamma(t+\frac{vx}{c^2})+a_3\\x'=va_1t+a_1x+b_3=\gamma(x+vt)+b_3$$
And now beyond this, I'm really not sure how to proceed. I'm lost on how to derive the value of $\gamma$. Can anyone please help? Thanks
 A: I will do it in slightly different notation. The relationships are:
$$
\begin{align}
c\left(\bar{t}-\bar{t}_0\right)&=a_1c\left(t-t_0\right)+a_2\left(x-x_0\right) &(1) \\
\bar{x}-\bar{x}_0&= b_1 c\left(t-t_0\right)+b_2 \left(x-x_0\right) &(2)
\end{align}
$$
We have two reference frames $\bar{S}$ and $S$. 
There are four constants to fix, so we will need four pieces of informations. I have broken the following into four corresponding sections.
Object moving at velocity $v$ in $\bar{S}$, stationary in $S$
Lets say that if an object is stationary in reference frame $S$ it is moving at +ve velocity $v$ in $\bar{S}$ (I don't like to talk about moving reference frames).
Define:


*

*Event A: Object is stationary in $S$ at $\left(t_0,\,x_0\right)$. In $\bar{S}$ this occurs at $\left(\bar{t_0},\,\bar{x_0}\right)$

*Event B: Some time later after A. The object is at $\left(t_0+T,\,x_0\right)$ in $S$, and at $\left(\bar{t}_0+\bar{T},\,\bar{x}_0+v\bar{T}\right)$ in $\bar{S}$
Applying Eq. (1,2):
$$
\begin{align}
c\bar{T} &= a_1 cT \\
v\bar{T} &= b_1 cT
\end{align}
$$
So $b_1=\frac{v}{c}a_1$. Thus
$$
\begin{align}
c\left(\bar{t}-\bar{t}_0\right)&=a_1c\left(t-t_0\right)+a_2\left(x-x_0\right) &(3) \\
\bar{x}-\bar{x}_0&= a_1 v\left(t-t_0\right)+b_2 \left(x-x_0\right) &(4)
\end{align}
$$
Object stationary in $\bar{S}$, moving at $-v$ in $S$
Define:


*

*Event C: Object is stationary in $S$ at $\left(t_0,\,x_0\right)$. In $\bar{S}$ this occurs at $\left(\bar{t_0},\,\bar{x_0}\right)$

*Event D: Some time later after C. The object is at $\left(t_0+T,\,x_0-vT\right)$ in $S$, and at $\left(\bar{t}_0+\bar{T},\,\bar{x}_0\right)$ in $\bar{S}$
Applying Eq. (3,4):
$$
\begin{align}
c\bar{T} &= a_1 cT - a_2 vT \\
0 &= a_1 vT - b_2 vT
\end{align}
$$
So $b_2=a_1$, and:
$$
\begin{align}
c\left(\bar{t}-\bar{t}_0\right)&=a_1c\left(t-t_0\right)+a_2\left(x-x_0\right) &(5) \\
\bar{x}-\bar{x}_0&= a_1 v\left(t-t_0\right)+a_1 \left(x-x_0\right) &(6)
\end{align}
$$
Light pulses
Next, we consider two more events


*

*Event E: a light pulse us emitted at $\left(t_0,\,x_0\right)$ in $S$, and is going in the +ve direction. In $\bar{S}$ the pulse is emitted at $\left(\bar{t}_0,\,\bar{x}_0\right)$.  

*Event F: Light pulse is detected at $\left(t_0+T, x_0+cT\right)$ in $S$, and at $\left(\bar{t}_0+\bar{T},\,\bar{x_0}+c\bar{T}\right)$ in $S$.
Applying Eq. (5,6):
$$
\begin{align}
c\bar{T}&=a_1cT+a_2cT \\
c\bar{T}&=a_1vT+a_1cT
\end{align}
$$
Therefore:
$$
c\bar{T}-c\bar{T}=0=\left(ca_1+ca_2-va_1 - ca_1\right)T
$$
So $a_2=\frac{v}{c}a_1$. Replacing $\gamma=a_1$ so:
$$
\begin{align}
c\left(\bar{t}-\bar{t}_0\right)&=\gamma\left(c\left(t-t_0\right)+\frac{v}{c}\left(x-x_0\right)\right) &(7) \\
\bar{x}-\bar{x}_0&= \gamma\left(v\left(t-t_0\right)+\left(x-x_0\right)\right) &(8)
\end{align}
$$
$\bar{S}\to S \to \bar{S}$. Using Isotropy
The only remainingquantity clearly must depend on speed $\gamma=\gamma\left(v\right)$, but it is reasonable to assume it does not depend on velocity, since this would mean that our transformation relies to some anisotropy of space (left is different from right). Basically $\gamma\left(v\right)=\gamma\left(-v\right)$. 
But then we can swap $\bar{S} \leftrightarrow S$ and re-run all our arguments to find:
$$
\begin{align}
c\left(t-t_0\right)&=\gamma\left(c\left(\bar{t}-\bar{t}_0\right)-\frac{v}{c}\left(\bar{x}-\bar{x}_0\right)\right) &(9) \\
x-x_0&= \gamma\left(-v\left(\bar{t}-\bar{t}_0\right)+\left(\bar{x}-\bar{x}_0\right)\right) &(10)
\end{align}
$$
Basically swap $\,\bar{\dots}\,\leftrightarrow\, {\dots}\,$ and $\,v\,\leftrightarrow \,-v\,$. 
If we now go $\bar{S}\to S \to \bar{S}$, we should end up with identity transformation (substitute Eq. (9) into Eq. (7)):
$$
\begin{align}
c\left(\bar{t}-\bar{t}_0\right)&=\gamma\left(c\left(t-t_0\right)+\frac{v}{c}\left(x-x_0\right)\right) \\
c\left(\bar{t}-\bar{t}_0\right)&=\gamma\left(\gamma\left(c\left(\bar{t}-\bar{t}_0\right)-\frac{v}{c}\left(\bar{x}-\bar{x}_0\right)\right)+\frac{v}{c}\gamma\left(-v\left(\bar{t}-\bar{t}_0\right)+\left(\bar{x}-\bar{x}_0\right)\right)\right) \\
c\left(\bar{t}-\bar{t}_0\right)\cdot\left[1-\gamma^2+\frac{v^2}{c^2}\gamma^2\right]&=0\\
\gamma^2=\frac{1}{1-v^2/c^2}
\end{align} 
$$
