Abstract
By truncating the Painlevé expansion at the constant level term, the Hirota bilinear form is obtained for a (3+1)-dimensional variable-coefficient Kadomtsev–Petviashvili equation. Based on its bilinear form, solitary-wave solutions are constructed via the ∊-expansion method and the corresponding graphical analysis is given. Furthermore, the exact solution in the Wronskian form is presented and proved by direct substitution into the bilinear equation.