Algebraic methods for solving time-dependent Hamiltonians are used to investigate the performance of quantum thermal machines. We thermodynamic properties an engine formed by two coupled qubits, performing Otto cycle. The interaction occurs with baths at different temperatures, while work is associated arbitrary magnetic field that varies in intensity and direction. For coupling, we consider 1D...