Permalink
Browse files

Fix exponentiation rule in 2_56

  • Loading branch information...
1 parent 6e9cef3 commit 20d5ce318e2f0acf2f5279ec7d7ab99e8847fd3f @fastred committed Jan 20, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 2_56.scm
View
@@ -61,8 +61,10 @@
(multiplicand exp))))
((exponentiation? exp)
(make-product
- (exponent exp)
- (make-exponentiation (base exp) (make-sum (exponent exp) -1))))
+ (make-product (deriv (base exp) var)
+ (exponent exp))
+ (make-exponentiation (base exp)
+ (make-sum (exponent exp) -1))))
(else
(error "Nieznany rodzaj wyrażenia -- DERIV exp"))))
@@ -72,7 +74,7 @@
(deriv '(* (* x y) (+ x 3)) 'x)
-(deriv '(** x 5) 'x)
+(deriv '(** (* 2 x) 5) 'x)
(deriv '(** x y) 'x)

0 comments on commit 20d5ce3

Please sign in to comment.