The contributions of this paper are threefold. First, we present the linear quadratic solution to optimally charge a Li-ion battery in a general form. Although the battery model considered here is a circuit comprised of an open-circuit voltage (OCV), a series resistance, and an RC circuit, the methodology is applicable to any electrical circuit model of a battery. A combination of different cost functions is considered including: time-to-charge, energy loss, and temperature rise index. We discuss the effect of different weightings in the cost functions on the current and voltage profiles. Second, we present two models for normalized battery capacity as a function of the number of cycles and two charge control parameters, viz., maximum terminal voltage of the battery and maximum charge current. These models are compared to a bi-exponential capacity model. The effectiveness of the proposed models for forecasting the battery capacity is validated using the experimental data. Third, these models are used for battery life management by developing an optimal charging parameter selection method which provides the best setpoint values for the control variables to achieve a pre-specified desired "useful cycle life" while attaining the fastest possible time-to-charge. The proposed optimal charging parameter selection method is illustrated via numerical results.