How to make it work?



Hello,
please, I need advice. I get stuck every single step I make!
(C1) display2d:false$
I have a set of equations
(C2) eq1:calM(v,r)=q[r](v)*Phi(v,r)+p[r]*R[r](v)*q[r](v)*pi[n]$
where r=1,2,..,m. I want to sum up the equations:
(C3) sum(eq1,r,1,m);
(D3) 'SUM(calM(v,r) = q[r](v)*PHI(v,r)+PI[n]*p[r]*q[r](v)*R[r](v),r,1,m)
It's nonsense! OK, I'll use two single quotes...
(C4) sum(''lhs(eq1),r,1,m)=sum(''rhs(eq1),r,1,m);
(D4) 'SUM(LHS(calM(v,r) = 
q[r](v)*PHI(v,r)+PI[n]*p[r]*q[r](v)*R[r](v)),r,1,m)
        = 'SUM(RHS(calM(v,r) = 
q[r](v)*PHI(v,r)+PI[n]*p[r]*q[r](v)*R[r](v)),r,
	      1,m)
What! But the manual says " - (two single quotes) causes an extra 
evaluation to occur." OK, let's do it manually...
(C5) rhs1:rhs(eq1)$
(C6) lhs1:lhs(eq1)$
Now, I want to find the relationships between derivatives of calM and 
Phi. I plan to setup atvalue() for diff(q[r](v),v[s]) etc...
(C7) depends([calM,q,phi,R],v[s]);
(D7) [calM(v[s]),q(v[s]),PHI(v[s]),R(v[s])]
(C8) diff(sum(lhs1,r,1,m),v[s])=diff(sum(rhs1,r,1,m),v[s]);
(D8) 'DIFF('SUM(calM(v,r),r,1,m),v[s],1)
        = 'DIFF('SUM(q[r](v)*PHI(v,r)
		     +PI[n]*p[r]*q[r](v)*R[r](v),r,1,m),
	       v[s],1)
Hmmm.... do i have to do *all of the work* manually??
(C9) sum(diff(lhs1,v[s]),r,1,m)=sum(diff(rhs1,v[s]),r,1,m);
(D9) 'SUM(DIFF(calM(v,r),v[s]),r,1,m)
        = 'SUM(DIFF(q[r](v)*PHI(v,r)
		    +PI[n]*p[r]*q[r](v)*R[r](v),v[s]),r,1,
	      m)
  :(((

What variables should I turn to true/false to have sum and diff 
distribute over '=' sign, and then differentiate products inside sums? 
And hwe can I split sums later? I mean, sum(A+B,...) => 
sum(A,...)+sum(B,...)

Thanks in advance
--
Andrei Zorine