  In literature there is a model of modified gravity in which the matter
Lagrangian is coupled to the geometry via trace of the stress-energy momentum
tensor $T=T_{\mu}^{\mu}$. This type of modified gravity is called as $f(R,T)$
in which $R$ is Ricci scalar $R=R_{\mu}^{\mu}$. We extend manifestly this model
to include the higher derivative term $\Box R$. We derived equation of motion
(EOM) for the model by starting from the basic variational principle. Later we
investigate FLRW cosmology for our model. We show that de Sitter solution is
unstable for a generic type of $f(R,\Box R, T)$ model. Furthermore we
investigate an inflationary scenario based on this model. A graceful exit from
inflation is guaranteed in this type of modified gravity.
