From: dpvc v. a. <we...@ma...> - 2007-09-07 14:24:55
|
Log Message: ----------- Derivatives of absolute values were leaving out the chain rule when written as |...| (but not as abs(...)). The chain rule is built into the derivatives of function objects automatically, but not of lists, which is how |...| is implemented (a special form of parentheses), and so I missed it when adding the derivative in this form. Argh! Modified Files: -------------- pg/lib/Parser: Differentiation.pm Revision Data ------------- Index: Differentiation.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Differentiation.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -Llib/Parser/Differentiation.pm -Llib/Parser/Differentiation.pm -u -r1.12 -r1.13 --- lib/Parser/Differentiation.pm +++ lib/Parser/Differentiation.pm @@ -602,7 +602,12 @@ sub Parser::List::AbsoluteValue::D { my $self = shift; my $x = $self->{coords}[0]->copy; my $equation = $self->{equation}; - return $self->Item("BOP")->new($equation,'/', $x, $self->copy); + my $BOP = $self->Item("BOP"); + return + $BOP->new($equation,"*", + $BOP->new($equation,'/', $x, $self->copy), + $x->D(shift), + ); } |