'''Hint for Exercise 3, Chapter 6:
    
Input:
    n... a positive integer
    
Output:
    plots of atan(k*x) and (1+x^2)^(-k) for k = 1,...,n and x in [-5,5].
    
Example:
    fct(1)
    
Typical call of program:
    from python06_ex3 import fct
    fct(1)  # fct(n)

'''

import numpy as np
import matplotlib.pyplot as plt
                
def fct(n):
    x = np.arange(-5,5,1e-3) # 1e-3 is a shortcut for 0.001 
    
    plt.figure(1)
    plt.plot(x,np.arctan(n*x))
    
    plt.figure(2)
    plt.plot(x,1./(1+x**2)**n)
    plt.axis([-5.5, 5.5, -0.05, 1.05])
    
    plt.show()