In this research, for a given time interval, which is the general period of melanoma treatment, a bilinear control model is considered, given by a system of differential equations, which describes the interaction between drug-sensitive and drug-resistant cancer cells both during drug therapy and in the absence of it. This model also contains a control function responsible for the transition from the stage of such therapy to the stage of its absence and vice versa. To find the optimal moments of switching between these stages, the problem of minimizing the cancer cells load both during the entire period of melanoma treatment and at its final moment is stated. Such a minimization problem has a nonconvex control set, which can lead to the absence of an optimal solution to the stated minimization problem in the classes of admissible modes traditional for applications. To avoid this problem, the control set is imposed to be convex. As a result, a relaxed minimization problem arises, in which the optimal solution exists. An analytical study of this minimization problem is carried out using the Pontryagin maximum principle. The corresponding optimal solution is found in the form of synthesis and may contain a singular arc. It shows that there are values of the parameters of the bilinear control model, its initial conditions, and the time interval for which the original minimization problem does not have an optimal solution, because it has a sliding mode. Then for such values it is possible to find an approximate optimal solution to the original minimization problem in the class of piecewise constant controls with a predetermined number of switchings. This research presents the results of the analysis of the connection between such an approximate solution of the original minimization problem and the optimal solution of the relaxed minimization problem based on numerical calculations performed in the Maple environment for the specific values of the parameters of the bilinear control model, its initial conditions, and the time interval.