MATLAB: How to simplify a trigonometric equation in Symbolic Math Toolbox 3.2.3 (R2008a) if the variable in the equation is a expression

Symbolic Math Toolbox

I would like MATLAB to perform trigonometric simplification such as 1-cos(x)^2 = sin(x)^2, when x is a symbolic expression. Currently, it returns 1-cos(x)^2.
Reproduction Steps:
syms a b x
x = a^77+b^2;
g = 1-cos(x)^2
simplify(g)

Best Answer

The ability to return a simplified trigonometric expression when the variable is another expression is not available in Symbolic Math Toolbox 3.2.3 (R2008a).
You can work around this by substituiting for the expression after the simplification.
syms a b x
g = 1-cos(x)^2
simplify(g)
x = a^77+b^2;
This issue does not arise in versions of the Symbolic Math Toolbox newer than and in 5.1 (R2008b)