Structure and Interpretation of Classical Mechanics
.
Verify the product rule of variation (Equation 1.23) using the
scmutils
software library:
~~~
(define (((delta eta) f) q) (define (g epsilon) (f (+ q (* epsilon eta)))) ((D g) 0)) (define q (literal-function 'q (-> Real (UP Real)))) (define eta (literal-function 'eta (-> Real (UP Real))))
.
(define (f q) (compose (literal-function 'f (-> (UP Real (UP* Real) (UP* Real)) Real)) (Gamma q))) (define (g q) (compose (literal-function 'g (-> (UP Real (UP* Real) (UP* Real)) Real)) (Gamma q)))
.
(define (f_times_g q) (* (f q) (g q)))
.
(define LHS ((((delta eta) f_times_g) q) 't)) (define RHS (+ (* ((((delta eta) f) q) 't) ((g q) 't)) (* ((f q) 't) ((((delta eta) g) q) 't))))
.
(print-expression LHS) (show-expression LHS)
.
.
(print-expression RHS) (show-expression RHS) (- LHS RHS)
— Me@2020-08-06 07:23:27 PM
.
.
2020.08.06 Thursday (c) All rights reserved by ACHK