Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

I am not a very experienced user. My problem is that I have a polynomial equation


in which parameters a, b and c are series of another variable x. What I look for is how to generate the coefficients of the series for Z as functions of x. I used brutal force but it is just a nightmare.

Thank for your help

share|improve this question

marked as duplicate by Jens, m_goldberg, Sjoerd C. de Vries, R. M. Jul 2 '13 at 1:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Could you post a possibly smaller version of your functions explicitly ? – b.gatessucks Jul 1 '13 at 10:04
Thanks for your proposal. Here we go. The equation is Y^3-(1-c1)Y^2+(A-c1+c2)Y-c2=0 where c1=k1 x,c2=k2 x^2 and A-k3 x (1+k4 Log[x]). The development is for x=1 – Claude Leibovici Jul 1 '13 at 10:09
Try using Reduce to solve for y, then make the substitutions for c1, c2, A and finally use Series for the expansion. – b.gatessucks Jul 1 '13 at 10:45
Could you be more explicit for the stupid idiot I am ? I never been able to use Reduce for anything. Could you give an example for this practical problem ? Thanks a lot. – Claude Leibovici Jul 1 '13 at 11:02
Claude, don't forget to use @ + name in comment replies. If you don't do that, the addressee won't be notified. – Sjoerd C. de Vries Jul 1 '13 at 11:19

1 Answer 1

First you need to solve F[Z,a,b,c]=0 with a,b,c as functions of x and then you can expand it as series. The general structure will be like

sol = Z /. Solve[F[Z,a[x],b[x],c[x] == 0, Z];

and then

Table[Coefficient[Z, x , i],{i,1,n}] (*n = max power*)

Let me show you an example.

a[x_] := Sin[x]; b[x_] := Cos[x]; c[x_] := Exp[x];
F[Z, a, b, c] = Z^2 + a[x] + b[x] + c[x];
sol = Z /. Solve[F[Z, a, b, c] == 0, Z];

Since I use $Z^2$, there will be two solutions. You can use Coefficient on each of them, but if the resulting function is too complicated (as in this case $\pm \sqrt{Sin[x]+Cos[x]+e^x}$ ), it may fail to return anything. To be in safe side use Series expansion first.

x0 = 0; n = 5; (*for expansion around x0 to power n*)
sol2 = Series[sol, {x, x0, n}];
coeff=Table[Coefficient[sol2, x, i], {i, 1, n}];

And coeff is what you are looking for. Since there are two solutions for Z, coeff will be a two column data set, first column for the coefficients of the first solution and second one for second (just check TableForm[coeff]).

Now if you want to use the polynomial to power n, just use


poly[[1]] and poly[[2]] are what you want.

share|improve this answer

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