RE : Partial differentiation of a sum??



You have to declare sum to be linear I think.

Like this:

declare(sum, linear);

Maybe you also have to set simpsum to true.

 

Best.

 

 

-----Message d'origine-----
De : maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de
Julien Martin
Envoy? : dimanche 17 octobre 2010 16:19
? : maxima at math.utexas.edu
Objet : [Maxima] Partial differentiation of a sum??

 

Hello,
I am working with the least squares method, I would like to differentiate a sum as follows and
I am having problems. 
What I want to achieve:
-define a sum
-differentiate it with respect to "a" and "b" respectively.
-solve the resulting system.

exp:sum((y_i-a*x_i-b)^2,i,1,n);
one:diff(exp,a,1)=0;
two:diff(exp,b,1)=0;
linsolve([one, two], [a,b]);

Can anyone please help?

Thanks in advance,

Julien.