Solve combined gas law relationships between states.
The combined gas law can be rearranged for any of its six quantities. Solving it for the second temperature is the form needed whenever a gas is compressed or expanded and you want to know how hot it ends up — a bicycle pump, a diesel cylinder, a scuba tank being filled. Because PV over T is constant, the temperature ratio between the two states simply equals the ratio of their pressure-volume products.
Combined gas law solved for temperature
P1 V1 / T1 = P2 V2 / T2, so T2 = T1 x (P2 x V2) / (P1 x V1)
Only in which quantity is unknown. Here both pressures and both volumes are known and the second temperature is derived, which is the case that matters for compression heating rather than for expansion volume.
Approximately. Compressing air about 18-fold raises its temperature enough to ignite injected fuel, but real compression is adiabatic rather than following this isochoric-plus-isobaric idealisation, so the actual temperature rise is higher.
Then the combined gas law does not apply and you need the full ideal gas law with n on both sides. Any leak, injection or reaction that changes the number of moles breaks the assumption.