• In your report, reformulate (1) as a system of equations where f 0 (xi) = fi .
• Remember the boundary condition fN = 3, replace fN everywhere.
• You now should have N + 1 equations but only N unknowns. In your report, justify why you can drop the last equation, the one stemming from approximating f(xN ).
• Turn your system of equations into a zero finding problem, i.e. a problem in the form P(f0, . . . , fN−1) = 0 . . . 0 ∈ R N . (3) 1
• Code P and the Jacobian of P. Hint: consider writing P as the sum of a linear term and the part concerning the cosine.
• Use the Newton’s method to solve (3). You are not allowed to use Newton’s method that compute numerical derivatives, such as Newton no der.m, but you are allowed to use Newton method.m.
• In your report, analytically solve (2).
• Compare the error of your approximation fi to the analytical solution when you increase N.
• Use these data in a plot to show convergence when N → ∞.
Show your steps and your results in a report of length ≤ 3 pages (excluding