8 Exercises
There are usually several ways to get the same result in
Xcas. We will try to use the simplest approaches.
Exercise 1 Verify the following identities.
-
(21/3+41/3)3−6(21/3+41/3)=6
- π /4 = 4arctan(1/5)−arctan(1/239)
- sin(5x) = 5sin(x)−20sin3(x)+16sin5(x)
- (tan(x)+tan(y))cos(x)cos(y) = sin(x+y)
- cos6(x)+sin6(x) = 1−3sin2(x)cos2(x)
- ln(tan(x/2+π/4)) = argsinh(tan(x))
Exercise 2 Transform the rational expression
into the following:
(x+2)(x+1)(x−2) |
|
x3+x2−x−1 |
|
,
| x4+x3−4x2−4x |
|
x(x−1)(x+1)2 |
|
,
| | ,
|
Exercise 3 Transform the rational expression
into the following
Exercise 4 For each of the following definitions of a function
f
-
Find an antiderivative F.
- Find F′(x) and show that F′(x) can be simplified to f(x).
Exercise 5 For each of the following integrals
∫ | | | √ | | dx ,
| ∫ | | x4sin(x)cos(x) dx .
|
-
Find the exact value, and find an approximation.
- For n=100 and n=1000, do the following.
For each j=0,…,n, let xj=a+j(b−a)/n and yj=f(xj).
Find an approximate value for the integral by using the left endpoint
rule:
- Do the same as the previous part, except use the trapezoid
method:
| | | (f(xj)+f(xj+1))(xj+1−xj) .
|
Exercise 6 Define the function
f by
f(
x,
y)=cos(
xy).
-
Let x0=y0=π/4. Define the function that maps (u,v,t) to
- Define the function g which is the partial derivative of the
preceding function with respect to t (so this will be a directional
derivative of f).
- Find the gradient of f at (x0,y0), then find the scalar product
of this gradient with the vector (u,v). Write this result in terms
of g.
Exercise 7 Consider
x3−(
a−1)
x2+
a2x−
a3=0 as an equation in
x.
-
Graph the solution x as a function of a using plotimplicit.
- Find the three solutions of the equation. You can use rootof
to find the first solution, then use quo to factor out the
first solution. You can then find the last two solutions by solving
the resulting second degree equation. (You can use coeff to
find the discriminant of the equation.)
- For the values of a which give three real roots, graph each of the
roots in different colors on the same graph.
(You can use resultant to find the values of a for which the
equation has a multiple root; these values are the possible bounds of
intervals for a where each of the roots is real.)
- Find the solutions for a=0,1,2.
Exercise 8 For each of the limits
| | |
,
| | (sin(x))1/x
,
| | (1+1/x)x
,
| | (2x+3x)1/x
|
-
Find the exact value.
- Find a value of x such that the distance from f(x) to the limit is
less than 10−3.
Exercise 9 For each function
f, find ranges for the
x coordinates and the
y
coordinates that give the most informative graph.
-
f(x)=1/x.
- f(x)=ex.
- f(x)=1/sin(x).
- f(x)=x/sin(x).
- f(x)=sin(x)/x.
Exercise 10 Let
f(
x)=3
x2+1+1/π
4ln((π−
x)
2).
-
Verify that this function takes negative values on ℝ+.
Graph the function over the interval [0,5].
- Find є >0 such that Xcas gives the correct graph of the
function over the interval [π−є,π+є].
Exercise 11
-
Graph the function exp(x) over the interval [−1,1].
On the same graph, plot the Taylor polynomials (of orders 1,2,3 and 4)
for this function centered at x=0.
- Same question for the interval [1,2].
- Graph the function sin(x) on the interval [−π,π].
On the same graph, plot the Taylor polynomials (of orders 1,3 and 5)
for this function centered at x=0.
Exercise 12 Plot the following graphs on the same window, with
x and
y
coordinates from 0 to 1.
-
The line y=x.
- The graph of the function f : x↦ 1/6+x/3+x2/2.
- The tangent line to the graph of f at x=1.
- The vertical line segment from the x-axis to the point where the
graph of f intersects the line y=x, and a horizontal line segment
from the y-axis to that point of intersection.
- The labels “fixed point” and “tangent”, at the appropriate positions.
Exercise 13 The goal of this exercise is to graph a family of functions on the
same screen. You will need to choose the number of curves, the
interval to graph over to obtain the most informative graphic.
-
Functions fa(x) = xae−x for a from −1 to 1.
- Functions fa(x)=1/(x−a)2 for a from −1 to 1.
- Functions fa(x)=sin(ax), for a from 0 to 2.
Exercise 14 Graph each of the following curves. You will need to choose a range
of values for the parameter to make sure you have the complete graph.
-
⎧
⎨
⎩ | x(t) | = | sin(4 t) |
y(t) | = | cos3(6 t)
|
|
|
⎧
⎨
⎩ | x(t) | = | sin(132 t) |
y(t) | = | cos3(126 t)
|
|
|
Exercise 15 The goal of this exercise is to visualize in different ways the
surface of the graph
z=
f(
x,
y)=
x y2. You will need to have a
3-d geometry window open.
-
Use plotfunc to draw an informative graph, choosing an
appropriate domain and number of steps.
- Create an editable parameter a with assume. Draw the curve
z=f(a,y) and vary the parameter with the mouse.
- Create an editable parameter b with assume. Draw the curve
z=f(x,b) and vary the parameter with the mouse.
Exercise 16 The goal of this exercise is to visualize a cone in different ways.
-
Draw the surface given by z=1−√x2+y2.
- Sketch the parameterized surface defined by
⎧
⎪
⎨
⎪
⎩ | x(u,v) | = | u cos(v) |
y(u,v) | = | u sin(v) |
z(u,v) | = | 1−u .
|
|
|
- For a sufficiently large value of a, draw the curve parameterized by
⎧
⎪
⎨
⎪
⎩ | x(t) | = | t cos(a t) |
y(t) | = | t sin(a t) |
z(t) | = | 1−t .
|
|
|
- Draw the family of curves parameterized by
⎧
⎪
⎨
⎪
⎩ | x(t) | = | a cos(t) |
y(t) | = | a sin(t) |
z(t) | = | 1−a .
|
|
|
- Draw the cone using the cone function.
Exercise 17
-
Generate a list ℓ of 100 integers randomly generated between 1 and 9.
- Verify that all values in ℓ are in {1,…,9}.
- Extract from the list ℓ all values greater than or equal to 5.
- For each k=1,…,9, find the number of values in ℓ which are
equal to k.
Exercise 18 For a real number
x, the continued fraction for
x of order
n is
a list of integers [
a0,…,
an] created in the following way:
-
let x0 = x.
- let a0 be the integer part of x0.
- let x1 = 1/(x0−a0).
- for k=1,…,n, let ak be the integer part of xk and let
xk+1 = 1/(xk − ak).
The list [
a0,…,
an] is associated with the fraction
For
x∈{π,√
2,
e} and
n∈ {5,10} :
-
Find [a0,…,an].
- Compare your result with the value given by Xcas’s dfc
function.
- Find un and the numeric value of x−un.
Exercise 19 Write (without using a loop) the following sequences:
-
The numbers from 1 to 3 in steps of 0.1.
- The numbers from 3 to 1 in steps of −0.1.
- The squares of the first 10 integers.
- Numbers of the form (−1)n n2 for n=1,…,10.
- 10 “0”s followed by 10 “1”s.
- 3 “0”s followed by 3 “1”s, followed by 3 “2”,…,
followed by 3 “9”s.
- “1” followed by 1 “0”, followed by a “2” followed by 2 “0”s,
…, followed by “8” followed by 8 “0”s, followed by “9”.
- 1 “1” followed by 2 “2”s, followed by 3 “3”s,…,
followed by 9 “9”s.
Exercise 20
-
Define the following polynomials of degree 6.
-
A polynomial whose roots are the integers from 1 to 6.
- A polynomial whose roots are 0 (triple root), 1
(double root) and 2 (simple root).
- The polynomial (x2−1)3.
- The polynomial x6−1.
- Write (without using the companion function)
the companion matrix A for each of the polynomials in (1).
Recall the the companion matrix for the polynomial
is
A =
| ⎛
⎜
⎜
⎜
⎜
⎜
⎜
⎝ |
| 0 | 1 | 0 | … | | 0 |
⋮ | ⋱ | ⋱ | ⋱ | | ⋮ |
| | | | | |
⋮ | | | ⋱ | ⋱ | 0 |
0 | … | | … | 0 | 1 |
−a0 | −a1 | | … | | −ad−1
|
|
| ⎞
⎟
⎟
⎟
⎟
⎟
⎟
⎠ | .
(1) |
- Find the eigenvalues of the matrix A.
- Find the characteristic polynomial of A.
Exercise 21
-
For variables a and b, write the square matrix A of order 4 with
aj,k=a if j=k and aj,k=b if j ≠ k.
- Find and factor the characteristic polynomial of A.
- Find an orthogonal matrix P such that PT A P is a diagonal
matrix.
- Use your answer to the previous question to define the function that
maps an integer n to the matrix An.
- Find Ak for k=1,…,6 by finding the matrix products. Check
that the function given in the previous part gives the same results.
Exercise 22
-
Find the square matrix N of order 6 given by nj,k=1 if
k=j+1 and nj,k=0 if k ≠ j+1.
- Find Np for p=1,…,6.
- Write the matrix A = xI+N, where x is a variable.
- Find Ap for p=1,…,6.
- Find exp(At) as a function of x and t :
Exercise 23 Define the following functions without using a loop.
-
The function f which takes as input an integer n and two real
numbers a and b and returns the n× n matrix A whose
diagonal terms are all equal to a and whose non-diagonal entries are
equal to b.
- The function g which takes as input an integer n and three real
numbers a,b and cm and returns the matrix
A=(aj,k)j,k=1,…,n whose diagonal elements are equal to
a, whose terms aj,j+1 are equal to b and whose terms aj+1,j
are equal to c, and whose remaining terms are 0.
- The function H which takes as input an integer n and returns
Hilbert’s Matrix; the matrix A=(aj,k)j,k=1,…,n where
aj,k = 1/(j+k+1).
Compare the execution time of your function with that of the
hilbert function.
- The function V which takes as input a vector x=[x1,…,xn] and
returns Vandermonde’s Matrix; the matrix
A=(aj,k)j,k=1,…,n where aj,k = xkj−1.
Compare the execution time of your function with that of the
vandermonde function.
- The function T which takes as input a vector x=[x1,…,xn] and
returns the Toeplitz Matrix; the matrix
A=(aj,k)j,k=1,…,n where
aj,k = x|j−k|+1 .
Exercise 24 Write the following functions, which take as input a function
f:ℝ
→ ℝ and three real numbers
xmin,
x0 and
xmax with
xmin≤
x0 ≤
xmax.
-
derive :
This function calculates and graphs the derivative of f over the
interval [xmin,xmax] and returns f′(x0).
- tangent :
This function graphs the function f on the interval
[xmin,xmax] and in the same window draws the tangent to the
graph at x0. It returns the equation for the tangent line as a
first degree polynomial.
- araignee :
This function graphs the function f on the [xmin,xmax], as
well as the line y=x. It calculates and returns the first 10
iterates of f starting at x0 (so x1 = f(x0), x2 =
f(x1),…). It also draws the sequence of segments, alternately
vertical and horizontal, allowing you to visualize the iterations:
segments joining (x0,0), (x0,x1), (x1,x1),
(x1,x2), (x2,x2), …(compare this to the function plotseq)
- newton_graph :
This function graphs the function f over the interval [xmin,xmax].
It also calculates and returns the first ten iterates of the sequence
starting at x0 given by Newton’s Method: x1=x0 −f(x0)/f′(x0),
x2=x1 − f(x1)/f′(x1) … (The values of the derivative
should be approximated.) This function also graphs in the same window
the segments displaying the iterations: segments joining
(x0,0), (x0,f(x0)), (x1,0),
(x1,f(x1)), (x2,0), (x2,f(x2)),…(compare with the function newton)
Exercise 25 Let
D be the unit square
D=(0,1)
2. Let Φ
be the function defined on
D by
Φ(x,y) = (z(x,y),t(x,y))=
| ⎛
⎜
⎜
⎝ | | , | | ⎞
⎟
⎟
⎠ | .
|
-
Find the inverse of Φ.
- Find and graph the image under Φ of the domain D: Δ=Φ(D).
- Let A(x,y) be the Jacobian matrix of Φ at a point (x,y) in
D, and B(z,t) the Jacobian matrix of Φ−1 at a point
(x,y) in Δ. Calculate these two matrices, and verify that
B(Φ(x,y)) and A(x,y) are inverses of each other.
- Let J(z,t) be the determinant of the matrix B. Calculate and simplify
J(z,t).
- Evaluate
I1= | ∬ | | | ⎛
⎜
⎜
⎝ | | | ⎞
⎟
⎟
⎠ | | dxdy .
|
- Evaluate
and verify that I1=I2.