0
|
4241 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

# Polynomials

Posted 11 years ago
 I get(x+1/x)^3 = 1/x^3 + 3/x + 3 x + x^3by ExpandNeed to collect ALL POWERS of (x+1/x) and substitute for value (1 in this case)x^3+1/x^3+3(x+1/x) = x^3+1/x^3+3Thanks
1 Reply
Sort By:
Posted 11 years ago
 Are you looking for a function to do this? I'm not exactly sure what this meant to do for a general case, but for your specific case I might write some code like this:eqn = Expand[(x + 1/x)^3];This gives us the expanded form you mentioned. Next we need to specify what powers of x we want to treat separately from the rest and pull them out of the equation:pattern = _ x | _ Power[x, -1];{matches, extra} = {Cases[eqn, pattern], Cases[eqn, Except@pattern]}The tool we want to use to factor the number three out of the section that matches our pattern is FactorTerms. So FactorTerms[Plus @@ matches] Gives 3 (1/x + x):targetFormat = Plus @@ extra + FactorTerms[Plus @@ matches]This gives us the form you wanted for the equation and then we can subsitute that case of x+ 1/x for 1:targetFormat /. (1/x + x) -> 1
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments