Two different approaches based on cubic B-spline are developed to approximate the solution of problems in calculus of variations. Both direct and indirect methods will be described. It is known that, when using cubic spline for interpolating a function g∈C^4[a,b] on a uniform partition with the step size h, the optimal order of convergence derived is O(h^4). In Zarebnia and Birjandi (J. Appl. Math. 1–10, 2012) a non-optimal O(h^2) method based on cubic B-spline has been used to solve the problems in calculus of variations. In this paper at first we will obtain an optimal O(h^4) indirect method using cubic B-spline to approximate the solution. The convergence analysis will be discussed in details. Also a locally superconvergent O(h^6) indirect approximation will be describe. Finally the direct method based on cubic spline will be developed. Some test problems are given to demonstrate the efficiency and applicability of the numerical methods.