login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #176 Factored Polynomials aren't differentiated correctly revision 4 of 4

1 2 3 4
Editor: kratt6
Time: 2007/12/28 12:46:13 GMT-8
Note:

added:

From kratt6 Fri Dec 28 12:46:13 -0800 2007
From: kratt6
Date: Fri, 28 Dec 2007 12:46:13 -0800
Subject: 
Message-ID: <20071228124613-0800@axiom-wiki.newsynthesis.org>


unfortunately, TeX output misses a parenthesis. See Issue #95

Submitted by : (unknown) at: 2007-11-17T22:02:51-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

axiom
p := -x*y^2+x*y+x^3-x^2

\label{eq1}-{x \ {y^2}}+{x \  y}+{x^3}-{x^2}(1)
Type: Polynomial(Integer)
axiom
)se ou algebra on
D(factor(p),x)
2 2 (2) - (y - y - 3x + 2x)

\label{eq2}-{\left({y^2}- y -{3 \ {x^2}}+{2 \  x}\right)}(2)
Type: Factored(Polynomial(Integer))
axiom
D(p,x)
2 2 (3) - y + y + 3x - 2x

\label{eq3}-{y^2}+ y +{3 \ {x^2}}-{2 \  x}(3)
Type: Polynomial(Integer)

Note that the factorization is correct. It's the D(.,x) that misses the sign.

Forgot to categorize... --unknown, Mon, 20 Jun 2005 10:18:00 -0500 reply
Category: Axiom Compiler => Axiom Mathematics Severity: normal => serious

Severity: serious => critical Status: open => fix proposed

The mistake is in differentiate$FR which currently reads:
    differentiate(u:%, deriv: R -> R) ==
      ans := deriv(unit u) * ((u exquo (fr := unit(u)::%))::%)
      ans + fr * (_+/[fact.xpnt * deriv(fact.fctr) *
       ((u exquo nilFactor(fact.fctr, 1))::%) for fact in factorList u])

It intends to use the formula

\frac{d}{dx} f(x)) = \sum_{i=1}^n \frac{f(x)}{f_i(x)}\frac{d}{dx}f_i(x) 

where

f(x)=\prod_{i=1}^n f_i(x). 

Therefore, the fix is to leave away the 'fr':

    differentiate(u:%, deriv: R -> R) ==
      ans := deriv(unit u) * ((u exquo unit(u)::%)::%)
      ans + (_+/[fact.xpnt * deriv(fact.fctr) *
       ((u exquo nilFactor(fact.fctr, 1))::%) for fact in factorList u])

Martin

applied in patch-41 --kratt6, Tue, 04 Oct 2005 05:51:35 -0500 reply
Status: fix proposed => closed

Category: Axiom Mathematics => Axiom Library

unfortunately, TeX output misses a parenthesis. See Issue #95