compute sum of polynomial square

1 visualizzazione (ultimi 30 giorni)
RICCARDO
RICCARDO il 3 Ago 2024
Spostato: Matt J il 4 Ago 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 Commenti
Walter Roberson
Walter Roberson il 3 Ago 2024
syms x
eqn = (1+x)^2 + (3+x)^2 +2*x
eqn = 
solx = solve(eqn, x)
solx = 
RICCARDO
RICCARDO il 3 Ago 2024
Modificato: RICCARDO il 3 Ago 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

Accedi per commentare.

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Polynomials in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by