The modification of the algorithms of the calculus of variations and Pontryagin's maximum principle required for them to be applicable to non-linear descriptor control systems is demonstrated. The classical calculus of variations is still applicable in optimization without constraints on the control, but when such constraints are imposed, the application of Pontryagin's maximum principle in its standard or extended form requires a distinction to be made between proper and non-proper descriptor systems. In the non-proper case, the solution depends on higher-order time derivatives of the control inputs. For the correct description of the problem and for Pontryagin's maximum principle to be applicable additional phase variables and corresponding integrator chains have to be introduced. The optimal control thus obtained becomes dynamic. To simplify the notation, the index of the algebraic equations of the constraints is assumed to be uniform. In principle, the results remain valid for a non-uniform index also, i.e. when different constraint equations have different indices and different components of the control occur with different maximum orders of the time derivatives. The results are somewhat complicated, particularly in the case of constrained optimization of non-proper systems.