-Amongst the more exciting phenomena in the field of nonlinear partial differential equations is the Lavrentiev phenomenon which occurs in the calculus of variations. We prove that a conforming finite element method fails if and only if the Lavrentiev phenomenon is present. Consequently, nonstandard finite element methods have to be designed for the detection of the Lavrentiev phenomenon in the computational calculus of variations. We formulate and analyze a general strategy for solving variational problems in the presence of the Lavrentiev phenomenon based on a splitting and penalization strategy. We establish convergence results under mild conditions on the stored energy function. Moreover, we present practical strategies for the solution of the discretized problems and for the choice of the penalty parameter.2000 Mathematics Subject Classification: 65N12; 65N25; 65N30; 65N50.Keywords: Lavrentiev phenomenon, finite element method, computational calculus of variations.