Abstract Modeling several physical events leads to the Bagley–Torvik equation (BTE). In this study, we have taken into account the BTE, including the Caputo–Fabrizio and Atangana–Baleanu derivatives. It becomes challenging to find the analytical solution to these kinds of problems using standard methods in many circumstances. Therefore, to arrive at the required outcome, numerical techniques are used. The Laplace transform is a promising method that has been utilized in the literature to address a variety of issues that come up when modeling real-world data. For complicated functions, the Laplace transform approach can make the analytical inversion of the Laplace transform excessively laborious. As a result, numerical techniques are utilized to invert the Laplace transform. The numerical inverse Laplace transform is generally an ill-posed problem. Numerous numerical techniques for inverting the Laplace transform have been developed as a result of this challenge. In this article, we use the Weeks method, which is one of the most efficient numerical methods for inverting the Laplace transform. In our proposed methodology, first the BTE is transformed into an algebraic equation using Laplace transform. Then the reduced equation solved the Laplace domain. Finally, the Weeks method is used to convert the obtained solution from the Laplace domain into the real domain. Three test problems with Caputo–Fabrizio and Atangana–Baleanu derivatives are considered to demonstrate the accuracy, effectiveness, and feasibility of the proposed numerical method.