This paper presents a novel convex modeling approach which allows for a simultaneous optimization of battery size and energy management of a plug-in hybrid powertrain by solving a semidefinite convex problem. The studied powertrain belongs to a city bus which is driven along a perfectly known bus line with fixed charging infrastructure. The purpose of the paper is to present the convexifying methodology and validate the necessary approximations by comparing with results obtained by Dynamic programming when using the original nonlinear, non-convex, mixed-integer models. The comparison clearly shows the importance of the gear and engine on/off decisions, and it also shows that the convex optimization and Dynamic Programming point toward similar battery size and operating cost when the same gear and engine on/off heuristics are used. The main conclusion in the paper is that due to the low computation time, the convex modeling approach enables optimization of problems with two or more state variables, e.g. allowing for thermal models of the components; or to include more sizing variables, e.g. sizing of the engine and the electric machine simultaneously.