Message Boards Message Boards

GROUPS:

Factoring constants out of a series

Posted 1 month ago
382 Views
|
2 Replies
|
2 Total Likes
|

I have the below:

r1 = Sum[2*b0*b1*Subscript[x, i], {i, 1, n}] + Sum[b1^2*Subscript[x, i]^4, {i, 1, n}]

I understand that

$\sum _{i=1}^n 2 b_0b_1 x_i+\sum _{i=1}^n b_1^2 x_i^4=2b_0b_1\sum _{i=1}^n x_i+b_1^2\sum _{i=1}^n x_i^4$

However, I do not know how to make Mathematica recognize this. i.e. how to factor the constants $b_0$ and $b_1$ out of the series.

Is there a way to do this?

2 Replies

One way to do it is with pattern replacement:

factorFromSum = 
  Sum[a_*b_, {var_, lmts__}] /; FreeQ[b, var] :> b*Sum[a, {var, lmts}];
Sum[2*b0*b1*Subscript[x, i], {i, 1, n}] + 
  Sum[b1^2*Subscript[x, i]^4, {i, 1, n}] /. factorFromSum
Posted 1 month ago

Thank you so much. I have tried this out and so far, so good. I am amazed with this.

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

Group Abstract Group Abstract