0
$\begingroup$

I have an equation which contains lots of terms with lots of unknown parameters. I want to write it in the form:

eq= s^3(something) + s^2(something else) + s(another thing) + constant;

I mean, I need to find "something", "something else" , "another thing" and "constant".

Could anyone help?

| improve this question | | | | |
$\endgroup$
  • 1
    $\begingroup$ try CoefficientList[eq,s] $\endgroup$ – J42161217 Apr 19 '17 at 8:35
3
$\begingroup$
Collect[(s^3 + 6 s^2 + s + 5) (a^4 + b + 4), s]
5 (4 + a^4 + b) + (4 + a^4 + b) s + 6 (4 + a^4 + b) s^2 + (4 + a^4 + b) s^3
| improve this answer | | | | |
$\endgroup$
0
$\begingroup$

If you prefer traditional form.

In:

Collect[(s^3 + 6 s^2 + s + 5) (a^4 + b + 4), s] // TraditionalForm 

Out:

s^3 (a^4+b+4)+6 s^2 (a^4+b+4)+s (a^4+b+4)+5 (a^4+b+4)
| improve this answer | | | | |
$\endgroup$

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