Linearization: Consider the following function:
g(x) = cos^2(x) + cos(x)
Linearize the function about x.
Store your result in the variable "lin", which should be a sympy expression.
You should remove the spurious term by calling the method "removeo()" on the result of the linearization.
Starter code (click to view):
Answer *
import sympy
x = sympy.S('x')
g = (sympy.cos(x))**2 + sympy.cos(x)
lin = sympy.series(g, x, sympy.pi/2)
lin = lin.removeo()