You are forgetting implicit differentiation here. You are differentiating with respect to x, so when you take the derivative of t it will be t' or , but not 1.
You also seem to be changing the t into an x sometimes. Make sure you understand what I did there. If you want me to explain it in more detail, I will.
Hope I helped you