problem0(): Find least squares solution to A*x=b Matrix A: [[0. 0. 1. ] [0.04 0.2 1. ] [0.16 0.4 1. ] [0.36 0.6 1. ] [0.64 0.8 1. ] [1. 1. 1. ]] Right hand side b: [150.697 179.323 203.212 226.505 249.633 281.422] Least squares solution x: [ 5.70133929 121.13408929 152.47446429] L2 norm of residual is 5.221927734494775 problem1 Surface area = 166.85562602840403 Approximation: 157.2888076299005 problem2 Integral of sinc(x) from 0 to 8 is 0.48737422505781997 Error estimate is 1.0414821262350049e-10 problem3 Use dblquad() to estimate a double integral. Integral of y * x**2 over 1<=y<=4 0<=x<=2, 42.00000000000001 Error estimate is 4.662936703425658e-13 problem4(): Use p_roots to get Newton-Cotes quadrature rule Estimate integral of sinc(x) from 0 to 8. estimated integral is 0.20462476111604286 problem5(): Use p_roots to get Gauss-Legendre quadrature rule Estimate integral of sinc(x) from 0 to 8. estimated integral is 0.48737212487804343 problem6(): Use interp1d() to interpolate sinc(x) from -8 to 8. Graphics saved as "problem6.png" problem7(): Seek maximum value of sinc(x) in interval 1.0 <= x <= 4.0 Sampling estimates maximum at sinc( 2.45 ) = 0.12832284215505932 minimize_scalar() estimates maximum at sinc( 2.45902352927921 ) = 0.12837455352573843 mimimize_scalar() returns success flag True problem8 Use brentq() to find root of jumper function. brentq() estimates root as 0.33186603357456285 with f(x) = -7.577272143066693e-14 problem9 Use minimize() to find minimizer of madsen function. Starting point x0: [3. 1.] with f(x0) = 13.011988373742163 minimize() estimates minimizing values as: [-0.15543735 0.6945639 ] with f(x) = 0.8793173809796767