Regarding the wide applications of dilaton gravity in the presence of electrodynamics, we introduce a suitable Lagrangian for the coupling of dilaton with gauge field. There are various Lagrangians which show the coupling between scalar fields and electrodynamics with correct special situations. In this paper, taking into account conformal transformation of Brans-Dicke theory with an electrodynamics Lagrangian, we show that how scalar field should couple with electrodynamics in dilaton gravity. In other words, in order to introduce a correct Lagrangian of dilaton gravity, one should check at least two requirements: compatibility with Brans-Dicke theory and appropriate special situations. Finally, we apply the mentioned method to obtain analytical solutions of dilaton-Born-Infeld and Brans-Dicke-Born-Infeld theories with energy dependent spacetime.