compute sum of polynomial square

40 次查看(过去 30 天)
RICCARDO
RICCARDO 2024-8-3,15:25
移动Matt J 2024-8-4,0:15
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 个评论
Walter Roberson
Walter Roberson 2024-8-3,16:48
syms x
eqn = (1+x)^2 + (3+x)^2 +2*x
eqn = 
solx = solve(eqn, x)
solx = 
RICCARDO
RICCARDO 2024-8-3,18:31
编辑:RICCARDO 2024-8-3,18:32
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

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2024-8-3,18:38
移动:Matt J 2024-8-4,0:14
syms x
eqn = (1+x)^2 + (3+x)^2 +2*x
eqn = 
expand(eqn)
ans = 
  2 个评论
RICCARDO
RICCARDO 2024-8-3,18:50
移动:Matt J 2024-8-4,0:14
thanks very very much, can I plot it too?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by