Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.9K Views
|
7 Replies
|
1 Total Like
View groups...
Share
Share this post:

Desired behavior of Collect[]

POSTED BY: Konstantin Nosov
7 Replies
POSTED BY: Eric Johnstone

removed

POSTED BY: Eric Johnstone

With more variable you have to decide how to deal with mixed terms x1*x2

POSTED BY: Gianluca Gorni

Sorry, I had to clarify this issue. The second-order terms specified in the command should be collected as usual:

Collect[..., x1^2, x2^2, x1*x2, ...]
POSTED BY: Konstantin Nosov

A similar problem was discussed in the thread "How to Get a Taylor Series for Multiple Variables?".

POSTED BY: Gianluca Gorni

I don't know if this is straightforward enough

Collect[a*x + b*x + c*x^2 + d*x^2, x] /. coeff_*x :> Expand[coeff*x]
POSTED BY: Gianluca Gorni

Thank you, enough straightforward. Can the code be extended for expression with several variables (i.e., x1^2, x2^2, ..., xn^2)?

POSTED BY: Konstantin Nosov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard