Complete the code to import the numerical integration function from scipy.
from scipy.integrate import [1]
The quad function is used for numerical integration in scipy.
Complete the code to define the function to integrate: f(x) = x squared.
def f(x): return x[1]2
The ** operator raises x to the power of 2, which means x squared.
Fix the error in the integration call to compute the area under f from 0 to 1.
area, error = quad([1], 0, 1)
The function f should be passed without parentheses to quad.
Fill both blanks to create a dictionary of areas for functions f and g over 0 to 1.
areas = { 'f': quad([1], 0, 1)[0], 'g': quad([2], 0, 1)[0] }We pass the function names f and g to quad to compute their areas.
Fill all three blanks to create a dictionary comprehension that computes areas for functions in funcs over 0 to 1.
areas = { [1]: quad([2], 0, 1)[0] for [1] in [3] }The variable func is used as the key and passed to quad. The iterable is funcs.