MATLAB: How to simplify a algebra function

matlab function

Hi guys,
Could anyone help me on simplify this function? I wanna remove the brackets.
f(x)=(x^2 + 1)^3
Thank you

Best Answer

Hi,
syms f(x)
fun = f(x) == (x^2 + 1)^3
fun = collect(fun,x)
results in:
fun =
f(x) == (x^2 + 1)^3
fun =
f(x) == x^6 + 3*x^4 + 3*x^2 + 1