  For a nonlinear ordinary differential equation with time delay, the
differentiation of the solution with respect to the delay is investigated.
Special emphasis is laid on the second-order derivative. The results are
applied to an associated optimization problem for the time delay. A first- and
second-order sensitivity analysis is performed including an adjoint calculus
that avoids the second derivative of the state with respect to the delay.
