Lecture 32: Review of Lectures 18 to 31 ======================================= Below is a first, preliminary list of equations to review in preparation of the second midterm exam. Consider also the quizzes and homework assignments. 1. Count the number of points with integer coordinates \ :math:`(x,y)`, in the region defined by the inequalities \ :math:`0 \leq x < 20`, \ :math:`0 \leq y < 20`, \ :math:`y \geq x/2`, and \ :math:`y \leq 3x`. Give the Sage commands (not the output) for the three stages below. (a) Generate a list \ :math:`L` of integer points \ :math:`(i,j)` for \ :math:`i` and \ :math:`j` ranging between 0 and 19. (b) Select from the list \ :math:`L` those points in the cone \ :math:`y \geq x/2` and by \ :math:`y \leq 3 x`. (c) Count the number of points in the cone. Write also the number below. 2. For some parameter \ :math:`t`, consider the sequence recursively defined as: .. math:: F_n = (1-t) F_{n-1} + t F_{n-2}, \mbox{ for } n > 1, where \ :math:`F(0) = a` and \ :math:`F(1) = b`. Using the recursive definition write an efficient Sage function \ :math:`F` to compute \ :math:`F_n` as ``F(a, b, t, n)``. What is the result of ``F(a, b, 0.3, 100)``? 3. Consider the function \ :math:`{\displaystyle f(t) = \int_0^t (1 - e^x) dx}`, for \ :math:`t \geq 0`. Define this function in Sage. What is \ :math:`f'(1)`? 4. The function \ :math:`{\displaystyle g(x,t) = \frac{1-t^2}{1 - 2xt + t^2}}` is a generating function for the Chebyshev polynomials. Compute a Taylor series approximation for \ :math:`g(x,t)` around \ :math:`t = 0` of order 10. Select the coefficient of :math:`t^8` and compare with the output of ``chebyshev_T(8, x)``. Is there a difference between the two? 5. Consider the point \ :math:`(1,1)` on the curve \ :math:`f(x,y) = x^2 - y^3 - x + y = 0`. (a) Give the Sage command(s) to compute a Taylor series about the point \ :math:`(1,1)` where the term of the error is of second order. (b) Compute the slope of the tangent line of the curve at the point \ :math:`(1,1)` and use the slope to determine the tangent line. Write the equation of the tangent line. Verify that the equation for the tangent line corresponds to the first-order Taylor series at \ :math:`(1,1)`. 6. Consider the curve \ :math:`x^4 - 3 x y + y^4 = 0`. Give all Sage commands to (a) to make a plot for \ :math:`x` and \ :math:`y` both ranging between \ :math:`-2` and \ :math:`+2`; (b) to convert the curve into polar coordinates; and (c) to plot the curve in polar coordinates. 7. Consider \ :math:`p = 5 x^2 a^2 + 61 x^2 a + 66 x^2 + 10 x a^2 + 121 x a + 121 x + a^2 + 15 a + 44`, as a polynomial in \ :math:`x` with parameter \ :math:`a`. (a) Find the roots of \ :math:`p`. (b) For which values of the parameter \ :math:`a` is the answer valid? (c) Give the Sage command(s) to treat the special case(s). (d) As you can see the polynomial \ :math:`p` is shown in expanded form. Give the Sage command(s) to ''un-expand'', i.e.: what is the command which reveals better the structure of \ :math:`p`? 8. Let \ :math:`a` and \ :math:`b` be positive numbers. Consider \ :math:`f = x^2/a + y/b` and the unit circle \ :math:`x^2 + y^2 = 1`. Give all Sage commands to determine the number of candidate extremal values of \ :math:`f` on the unit circle. Use a lexicographic Groebner basis to compute a triangular form of the equations for this problem. 9. Give the Sage commands for the following tasks. Create a 5-by-5 matrix \ :math:`A` over the rationals where the \ :math:`(i,j)`-the element is \ :math:`1/(i+j)` (for \ :math:`i` and \ :math:`j` both from 1 to 5). Define b as a vector of length 5 of ones. Solve the system defined by \ :math:`A x = b`. Verify that \ :math:`b - A x` equals zero. 10. Consider the intial value problem :math:`dy/dt = 2 - 6y`, :math:`y(0) = -1`. (a) Solve this problem and plot the solution trajectory for :math:`t \in [0,2]`. (b) Plot the slope field for :math:`t \in [0,2]` and :math:`y \in [-1,0.5]`. Place also the particular solution computed in (a) on the plot. 11. Minimize :math:`x+3y` subject to :math:`x \geq 2`, :math:`y \geq 1`, :math:`x + 2y \leq 8`, :math:`x+y \leq 6`. Formulate the linear programming problem and solve it.