; mostly typing these up to confirm that they display as expected (define ((Gamma w) t) (up t (w t) ((D w) t))) (define ((Lagrange-equations Lagrangian) w) (- (D (compose ((partial 2) Lagrangian) (Gamma w))) (compose ((partial 1) Lagrangian) (Gamma w)))) (define ((L-harmonic m k) local) (let ((q (coordinate local)) (v (velocity local))) (- (* 1/2 m (square v)) (* 1/2 k (square q))))) (define (proposed-solution t) (* 'a (cos (+ (* 'omega t) 'phi)))) (show-expression (((Lagrange-equations (L-harmonic 'm 'k)) proposed-solution) 't)) ; didn't simplify the way The Book shows it, but is equivalent (show-expression (((Lagrange-equations (L-harmonic 'm 'k)) (literal-function 'x)) 't))