function[y] = cospiapprox(x, n)

y=0;

for j = 0:1:n
    
    y = y+ ((-1)^(j+1))*(((x-pi)^(2*j))/(factorial(2*j)));
end

