0
$\begingroup$
ss=Sum[a[i]*x^i,{i,0,10}]; 
eq1=ss/.x->0 
eq2=ss/.x->1 
sol=Solve[{eq1==0,eq2==0}]; 
sol1=ss/.sol

How can I find the coefficients of a[2],a[3],....,a[10] which would be (-x+x^2),(-x+x^3),...(-x+x^10).

$\endgroup$
  • $\begingroup$ To make the most of Mma.SE start by taking the tour now. It will help us to help you if you write an excellent question. Edit if improvable, show due diligence, give brief context, include minimal working example of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned.Why not choosing a meaningful name? $\endgroup$ – rhermans Sep 9 '17 at 13:20
1
$\begingroup$

You should use Coefficient

s = Sum[a[i]*x^i, {i, 0, 10}]
(* a[0] + x a[1] + x^2 a[2] + x^3 a[3] + x^4 a[4] + x^5 a[5] + 
 x^6 a[6] + x^7 a[7] + x^8 a[8] + x^9 a[9] + x^10 a[10] *)

sol = Solve@{
   0 == s /. x -> 0,
   0 == s /. x -> 1
   }
(* {{a[0] -> 0, 
  a[10] -> -a[1] - a[2] - a[3] - a[4] - a[5] - a[6] - a[7] - a[8] - 
    a[9]}} *)

pol = s /. First@sol
(* x a[1] + x^2 a[2] + x^3 a[3] + x^4 a[4] + x^5 a[5] + 
 x^6 a[6] + x^7 a[7] + x^8 a[8] + 
 x^10 (-a[1] - a[2] - a[3] - a[4] - a[5] - a[6] - a[7] - a[8] - 
    a[9]) + x^9 a[9] *)

Table[
 Coefficient[pol, a[k], 1]
 , {k, 0, 10}]
(* {0, x - x^10, x^2 - x^10, x^3 - x^10, x^4 - x^10, x^5 - x^10,
  x^6 - x^10, x^7 - x^10, x^8 - x^10, x^9 - x^10, 0} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.