How do i do the reverse from expand function ?
12 ビュー (過去 30 日間)
回答 (1 件)
Chidvi Modala 2021 年 11 月 19 日
In general, you may use simplify(expr) function to perform algebraic simplification of expr. But simplify currently has some known issue with the simplification of sums. It cannot simplify your entire expression "a^2+2*a*b+b^2+b", but it can simplify "a^2+2*a*b+b^2" to "(a+b)^2". You may use the following example as a workaround.
syms a b;
simplify(expand(a^2+2*a*b+b^2)) + b