Simple linear system in Maxima




On Fri, 26 Jun 2009, deltaquattro at gmail.com wrote:

< Hi,
< 
< I am having trouble with solving a simple linear system in Maxima:
< 
< E(a,b):=integrate((f(x)-(a*g(x)+b))^2,x,0,1);
< 
< e1(a,b):=diff(E(a,b),a,1);
< 
< e2(a,b):=diff(E(a,b),b,1);
< 
< linsolve([e1(a,b)=0, e2(a,b)=0], [a,b]);
< 
< returns []. I also tried algsys (shouldn't be needed, but just in
< case..) and the output is the same. Is there any workaround for this?
 
Add the declaration

declare(integrate,additive);

and define

e1(a,b):=expand(diff(...));

and similarly for e2.

This will work for you. The problem is that the coefficients are inside
integrate(...) and you need them to be pulled out. The declare/expand
combination does this.

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.