Вы находитесь на странице: 1из 1

Matrı́cula (First-name Last-name) CK0030: Homework 03

Exercise 1. Write Python functions that receive x as input argument and computes and returns
the following function values:

1. h 2 p i
sin ex − cos(x) + 2 sin(x2 ) 1 + 2 sin2 (x)
f (x) = ;
2 sin2 (x)
2. q p
ex2 − cos (x) + 2 sin (x3 ) 1 + 2 sin (x3 )
g(x) = ;
2 sin3 x
3.
xarctan (x) − x(π/2)
h(x) = p .
(1 + x)1+π/2 log (x)

Test your functions when x ∈ X , for some X of your choice such that |X | > 1.

Exercise 2. Given the functions in Exercise 1, f (x), g(x) and h(x), write Python functions that
receive x and N , (x, N ), as input arguments and computes and returns the corresponding function
values, when the following approximations are used:


N
X xn
ex ≈ ;
n!
n=0


N h
X (−1)n x(2n+1) i
sin (x) ≈ ;
n=0
(2n + 1)!


N h
Y x2 i
cos (x) ≈ 1− ;
π 2 (n − 1/2)2
n=1


N h
X (−1)n i
arctan (x) ≈ x(2n+1) .
n=0
2n + 1

Test your functions when x ∈ X , for the same X of your choice such that |X | > 1 in Exercise 1,
and for N ∈ {2, 4, 8, 16}.
Compare the function values with what obtained in Exercise 1.

Вам также может понравиться