using Newton's method solve x cos x = 0