Clear Filters
Clear Filters

compute sum of polynomial square

1 view (last 30 days)
RICCARDO
RICCARDO on 3 Aug 2024
Moved: Matt J on 4 Aug 2024
Can I solve sum of polynomial square in a one variable ?
e.g. (1+x)^2 + (3+x)^2 +2*x =
Can Mathlab compute result as x variable ?
  3 Comments
Walter Roberson
Walter Roberson on 3 Aug 2024
syms x
eqn = (1+x)^2 + (3+x)^2 +2*x
eqn = 
solx = solve(eqn, x)
solx = 
RICCARDO
RICCARDO on 3 Aug 2024
Edited: RICCARDO on 3 Aug 2024
result shuld be : (1+2x+x^2) + (9+6x +x^2) + 2x
that is finally : 2x^2 + 10x + 10
This is a simple expression expansion
I'd like to plot it too
thanks

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 3 Aug 2024
Moved: Matt J on 4 Aug 2024
syms x
eqn = (1+x)^2 + (3+x)^2 +2*x
eqn = 
expand(eqn)
ans = 
  2 Comments
RICCARDO
RICCARDO on 3 Aug 2024
Moved: Matt J on 4 Aug 2024
thanks very very much, can I plot it too?

Sign in to comment.

More Answers (0)

Categories

Find more on Polynomials in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!