/[emacs]/emacs/lisp/calc/calcalg2.el
ViewVC logotype

Diff of /emacs/lisp/calc/calcalg2.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5.4.2 by miles, Tue Oct 14 23:35:49 2003 UTC revision 1.5.4.3 by miles, Fri Nov 12 04:21:20 2004 UTC
# Line 738  Line 738 
738                          (setcar (cdr cur-record) 'cancelled)))                          (setcar (cdr cur-record) 'cancelled)))
739                 (math-replace-integral-parts (car expr)))))))                 (math-replace-integral-parts (car expr)))))))
740    
741    (defvar math-linear-subst-tried t
742      "Non-nil means that a linear substitution has been tried.")
743    
744  (defun math-do-integral (expr)  (defun math-do-integral (expr)
745    (let (t1 t2)    (let ((math-linear-subst-tried nil)
746            t1 t2)
747      (or (cond ((not (math-expr-contains expr math-integ-var))      (or (cond ((not (math-expr-contains expr math-integ-var))
748                 (math-mul expr math-integ-var))                 (math-mul expr math-integ-var))
749                ((equal expr math-integ-var)                ((equal expr math-integ-var)
# Line 977  Line 981 
981    
982      ;; Integration by substitution, for various likely sub-expressions.      ;; Integration by substitution, for various likely sub-expressions.
983      ;; (In first pass, we look only for sub-exprs that are linear in X.)      ;; (In first pass, we look only for sub-exprs that are linear in X.)
984      (or (if math-enable-subst      (or (math-integ-try-linear-substitutions expr)
985              (math-integ-try-substitutions expr)          (math-integ-try-substitutions expr)
           (math-integ-try-linear-substitutions expr))  
986    
987          ;; If function has sines and cosines, try tan(x/2) substitution.          ;; If function has sines and cosines, try tan(x/2) substitution.
988          (and (let ((p (setq rat-in (math-expr-rational-in expr))))          (and (let ((p (setq rat-in (math-expr-rational-in expr))))
# Line 1189  Line 1192 
1192    
1193  ;;; Look for substitutions of the form u = a x + b.  ;;; Look for substitutions of the form u = a x + b.
1194  (defun math-integ-try-linear-substitutions (sub-expr)  (defun math-integ-try-linear-substitutions (sub-expr)
1195      (setq math-linear-subst-tried t)
1196    (and (not (Math-primp sub-expr))    (and (not (Math-primp sub-expr))
1197         (or (and (not (memq (car sub-expr) '(+ - * / neg)))         (or (and (not (memq (car sub-expr) '(+ - * / neg)))
1198                  (not (and (eq (car sub-expr) '^)                  (not (and (eq (car sub-expr) '^)

Legend:
Removed from v.1.5.4.2  
changed lines
  Added in v.1.5.4.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26