# 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 $$(x,y)$$, in the region defined by the inequalities $$0 \leq x < 20$$, $$0 \leq y < 20$$, $$y \geq x/2$$, and $$y \leq 3x$$. Give the Sage commands (not the output) for the three stages below.

1. Generate a list $$L$$ of integer points $$(i,j)$$ for $$i$$ and $$j$$ ranging between 0 and 19.

2. Select from the list $$L$$ those points in the cone $$y \geq x/2$$ and by $$y \leq 3 x$$.

3. Count the number of points in the cone. Write also the number below.

2. For some parameter $$t$$, consider the sequence recursively defined as:

$F_n = (1-t) F_{n-1} + t F_{n-2}, \mbox{ for } n > 1,$

where $$F(0) = a$$ and $$F(1) = b$$. Using the recursive definition write an efficient Sage function $$F$$ to compute $$F_n$$ as F(a, b, t, n). What is the result of F(a, b, 0.3, 100)?

3. Consider the function $${\displaystyle f(t) = \int_0^t (1 - e^x) dx}$$, for $$t \geq 0$$. Define this function in Sage. What is $$f'(1)$$?

4. The function $${\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 $$g(x,t)$$ around $$t = 0$$ of order 10. Select the coefficient of $$t^8$$ and compare with the output of chebyshev_T(8, x). Is there a difference between the two?

5. Consider the point $$(1,1)$$ on the curve $$f(x,y) = x^2 - y^3 - x + y = 0$$.

1. Give the Sage command(s) to compute a Taylor series about the point $$(1,1)$$ where the term of the error is of second order.

2. Compute the slope of the tangent line of the curve at the point $$(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 $$(1,1)$$.

6. Consider the curve $$x^4 - 3 x y + y^4 = 0$$. Give all Sage commands to

1. to make a plot for $$x$$ and $$y$$ both ranging between $$-2$$ and $$+2$$;

2. to convert the curve into polar coordinates; and

3. to plot the curve in polar coordinates.

7. Consider $$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 $$x$$ with parameter $$a$$.

1. Find the roots of $$p$$.

2. For which values of the parameter $$a$$ is the answer valid?

3. Give the Sage command(s) to treat the special case(s).

4. As you can see the polynomial $$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 $$p$$?

8. Let $$a$$ and $$b$$ be positive numbers. Consider $$f = x^2/a + y/b$$ and the unit circle $$x^2 + y^2 = 1$$. Give all Sage commands to determine the number of candidate extremal values of $$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 $$A$$ over the rationals where the $$(i,j)$$-the element is $$1/(i+j)$$ (for $$i$$ and $$j$$ both from 1 to 5). Define b as a vector of length 5 of ones. Solve the system defined by $$A x = b$$. Verify that $$b - A x$$ equals zero.

10. Consider the intial value problem $$dy/dt = 2 - 6y$$, $$y(0) = -1$$.

(a) Solve this problem and plot the solution trajectory for $$t \in [0,2]$$.

(b) Plot the slope field for $$t \in [0,2]$$ and $$y \in [-1,0.5]$$. Place also the particular solution computed in (a) on the plot.

11. Minimize $$x+3y$$

subject to $$x \geq 2$$, $$y \geq 1$$, $$x + 2y \leq 8$$, $$x+y \leq 6$$.

Formulate the linear programming problem and solve it.