]> git.eshelyaron.com Git - emacs.git/commitdiff
Add derivative and integration rules for calcFunc-sec, calcFunc-csc,
authorJay Belanger <jay.p.belanger@gmail.com>
Tue, 15 Feb 2005 19:27:47 +0000 (19:27 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Tue, 15 Feb 2005 19:27:47 +0000 (19:27 +0000)
calcFunc-cot, calcFunc-sech, calcFunc-csch, calcFunc-coth.
(math-do-integral-methods): Add to checks for when to use
substitutions.

lisp/calc/calcalg2.el

index 18b6c1328d7b31403437fc4deb07dbd4ca6a10f6..d5a9009c1acb76952889853eb54060e9545b2085 100644 (file)
                                         (math-normalize
                                          (list 'calcFunc-cos u))))))))
 
+(put 'calcFunc-sec\' 'math-derivative-1
+     (function (lambda (u) (math-to-radians-2 
+                            (math-mul
+                             (math-normalize
+                              (list 'calcFunc-sec u))
+                             (math-normalize
+                              (list 'calcFunc-tan u)))))))
+
+(put 'calcFunc-csc\' 'math-derivative-1
+     (function (lambda (u) (math-neg 
+                            (math-to-radians-2
+                             (math-mul
+                              (math-normalize
+                               (list 'calcFunc-csc u))
+                              (math-normalize
+                               (list 'calcFunc-cot u))))))))
+
+(put 'calcFunc-cot\' 'math-derivative-1
+     (function (lambda (u) (math-neg
+                            (math-to-radians-2
+                             (math-div 1 (math-sqr
+                                          (math-normalize
+                                           (list 'calcFunc-sin u)))))))))
+
 (put 'calcFunc-arcsin\' 'math-derivative-1
      (function (lambda (u)
                 (math-from-radians-2
                                        (math-normalize
                                         (list 'calcFunc-cosh u)))))))
 
+(put 'calcFunc-sech\' 'math-derivative-1
+     (function (lambda (u) (math-neg
+                            (math-mul
+                             (math-normalize (list 'calcFunc-sech u))
+                             (math-normalize (list 'calcFunc-tanh u)))))))
+
+(put 'calcFunc-csch\' 'math-derivative-1
+     (function (lambda (u) (math-neg
+                            (math-mul
+                             (math-normalize (list 'calcFunc-csch u))
+                             (math-normalize (list 'calcFunc-coth u)))))))
+
+(put 'calcFunc-tanh\' 'math-derivative-1
+     (function (lambda (u) (math-neg
+                            (math-div 1 (math-sqr
+                                         (math-normalize
+                                          (list 'calcFunc-sinh u))))))))
+
 (put 'calcFunc-arcsinh\' 'math-derivative-1
      (function (lambda (u)
                 (math-div 1 (math-normalize
               (while (and p
                           (memq (car (car p)) '(calcFunc-sin
                                                 calcFunc-cos
-                                                calcFunc-tan))
+                                                calcFunc-tan
+                                                 calcFunc-sec
+                                                 calcFunc-csc
+                                                 calcFunc-cot))
                           (equal (nth 1 (car p)) math-integ-var))
                 (setq p (cdr p)))
               (null p))
                           (memq (car (car p)) '(calcFunc-sinh
                                                 calcFunc-cosh
                                                 calcFunc-tanh
+                                                 calcFunc-sech
+                                                 calcFunc-csch
+                                                 calcFunc-coth
                                                 calcFunc-exp))
                           (equal (nth 1 (car p)) math-integ-var))
                 (setq p (cdr p)))
        (math-neg (math-from-radians-2
                  (list 'calcFunc-ln (list 'calcFunc-cos u))))))
 
+(math-defintegral calcFunc-sec
+  (and (equal u math-integ-var)
+       (math-from-radians-2
+        (list 'calcFunc-ln 
+              (math-add
+               (list 'calcFunc-sec u)
+               (list 'calcFunc-tan u))))))
+
+(math-defintegral calcFunc-csc
+  (and (equal u math-integ-var)
+       (math-from-radians-2
+        (list 'calcFunc-ln 
+              (math-sub
+               (list 'calcFunc-csc u)
+               (list 'calcFunc-cot u))))))
+
+(math-defintegral calcFunc-cot
+  (and (equal u math-integ-var)
+       (math-from-radians-2
+        (list 'calcFunc-ln (list 'calcFunc-sin u)))))
+
 (math-defintegral calcFunc-arcsin
   (and (equal u math-integ-var)
        (math-add (math-mul u (list 'calcFunc-arcsin u))
   (and (equal u math-integ-var)
        (list 'calcFunc-ln (list 'calcFunc-cosh u))))
 
+(math-defintegral calcFunc-sech
+  (and (equal u math-integ-var)
+       (list 'calcFunc-arctan (list 'calcFunc-sinh u))))
+
+(math-defintegral calcFunc-csch
+  (and (equal u math-integ-var)
+       (list 'calcFunc-ln (list 'calcFunc-tanh (math-div u 2)))))
+
+(math-defintegral calcFunc-coth
+  (and (equal u math-integ-var)
+       (list 'calcFunc-ln (list 'calcFunc-sinh u))))
+
 (math-defintegral calcFunc-arcsinh
   (and (equal u math-integ-var)
        (math-sub (math-mul u (list 'calcFunc-arcsinh u))