Practice Final Solutions
Practice Final Solutions
May 7, 2023
1. Find the particular and general solutions for the differential equation
y ′′ + 2y ′ + y = 4e−t + 2t2 sin t.
To find a solution to the nonhomogeneous equation, we consider each term separately. First note that
4e−t = 4t0 e−t . Since r = −1 is a double root of the auxiliary equation, our particular solution must
lie in
W = span{e−t , te−t , t2 e−t }
(the double root means we go up to t0+2 = t2 ). We have T (e−t ) = 0, T (te−t ) = 0, and T (t2 e−t ) = 2e−t .
Thus T (c1 e−t + c2 te−t + c3 t2 e−t ) = 4e−t can be solved by solving the linear system with augmented
matrix
0 0 2 4
0 0 0 0 .
0 0 0 0
Solving this gives the first term in our nonhomogeneous solution as 2t2 e−t .
For the other terms, we note that t2 sin t = t2 e0t sin t. As 0 ± i is not a root of the auxiliary equation,
our corresponding solution will lie in
W = span{sin t, cos t, t sin t, t cos t, t2 sin t, t2 cos t}.
We can compute
T (sin t) = 2 cos t
T (cos t) = −2 sin t
T (t sin t) = 2 sin t + 2 cos t + 2t cos t
T (t cos t) = −2 sin t + 2 cos t − 2t sin t
T (t2 sin t) = 2 sin t + 4t sin t + 4t cos t + 2t2 cos t
T (t2 cos t) = 2 cos t − 4t sin t + 4t cos t + 2t2 sin t.
Thus we can solve T (yp ) = t2 sin t by solving the system with augmented matrix
0 −2 2 −2 2 0 0
2 0 2 2 0 2 0
0 0 0 −2 4 −4 0
.
0 0 2 0 4 4 0
0 0 0 0 0 −2 2
0 0 0 0 2 0 0
1
This gives the particular solution
Note that ChatGPT reverses the columns of V (which is wrong!). For the matrix U, we have
√ √ √ √
1 − 2/2 − 2/2 1 2/2 2/2
⃗u1 = A √ = √ and ⃗u2 = A √ = √ ,
40 2/2 2/2 10 2/2 2/2
so that √ √
− 2/2 √2/2 .
U= √
2/2 2/2
2
(b) Find a nonzero matrix A such that A2 ̸= 0 and A3 = 0.
SOLUTION: We can take
0 1 0
0 0 2 ,
0 0 0
the matrix of the differentiation map D : P2 (R) → P2 (R).
Thus
1 1 2 1 2 3 −4 13
T =T 3 − = 3T −T =3 − = .
0 1 3 1 3 8 −1 25
Similarly
1 2 1 2 1 −4 3 −10
T =T −2 =T − 2T = −2 = .
0 3 1 3 1 −1 8 −17
We obtain
13 −10
T= .
25 −17
which is the characteristic polynomial of A. Since A and AT have the same characteristic poly-
nomial, they must also have the same eigenvalues.
U + W = {⃗u + w
⃗ | ⃗u ∈ U, w
⃗ ∈ W}
3
(d) The set {1, sin x, cos x, sin2 x, cos2 x} is linearly independent.
SOLUTION: False. We have the linear relation cos2 x + sin2 x = 1.
(e) If a matrix A has zero as one of its eigenvalues, then the dimension of the null space of A is at
least 1.
SOLUTION: True. If λ = 0 and A⃗v = λ⃗v = 0 (with ⃗v ̸= 0), then ⃗v is in the null space of A, so
dim Nul A ⩾ 1.
3 −12 4 0
3 −12 4 −1 0 −2 0
5. Suppose A = −1 0 −2 and B = .
−1 5 −1 0
−1 5 −1
0 0 0 0
(a) How do the characteristic equations of A and B differ?
SOLUTION: The characteristic polynomial of B is −λ times the characteristic polynomial of A.
(c) Find all the eigenvalues of A5 . (Hint: the eigenvalues of A are integers.)
SOLUTION: We can compute
dim(A − λI) = −λ3 + 2λ2 + 8λ − 2 = −(λ − 2)(λ − 1)(λ − 1)
by guessing and checking, so λ = ±1, 2. If we diagonalize A, say A = PDP−1 , then A5 = PD5 P−1 ,
and the eigenvalues of A5 are 15 = 1, (−1)5 = −1, and 25 = 32.
4
(d) Is T bijective?
SOLUTION: No, because T is not injective.
7. (a) Find the Fourier series of f(x) = ex on the interval [−π, π].
SOLUTION: We can compute
Z
1 π x eπ − e−π
a0 = e dx =
π −π π
and
Z
1 π x
an = e cos(nx)dx
π −π
1 ex
= [cos(nx) − n sin(nx)]π
−π
π 1 + n2
1 (−1)n (eπ − e−π )
= 2
(eπ (−1)n − e−π (−1)n ) = .
π(1 + n ) π(1 + n2 )
Similarly
Z
1 π x
bn = e sin(nx)dx
π −π
1 ex
= [sin(nx) − n cos(nx)]π −π
π 1 + n2
1 π n −π n −n(−1)n (eπ − e−π )
= (e (−n)(−1) − e (−n)(−1) ) = .
π(1 + n2 ) π(1 + n2 )
Thus our Fourier series on [−π, π] is
∞
eπ − e−π X (−1)n (eπ − e−π ) −n(−1)n (eπ − e−π )
ex = + cos(nx) + sin(nx) .
2π n=1
π(1 + n2 ) π(1 + n2 )
(b) Sketch the 2π-periodic even extension of f(x) = ex . Find the Fourier cosine series of f(x) = ex on
the interval (0, π).
SOLUTION: A sketch is provided in Fig. 1.
5
(c) Sketch the 2π-periodic odd extension of f(x) = ex . Find the Fourier sine series of f(x) = ex on
the interval (0, π).
SOLUTION: A sketch is provided in Fig. 2.
8. (a) To find the best fit line y = β0 + β1 x given points (x1 , y1 ), (x2 , y2 ), . . . , (xn , yn ), we find the least
squares solution to the system of equations
β0 + β1 x1 = y1
β0 + β1 x2 = y2
...
β0 + β1 xn = yn .
Write this system of equations as a matrix equation. Find the best fit line given the points (1, 0),
(2, 1), (3, 1).
SOLUTION: The matrix equation is
1 x1 y1
1 x2 y2
0 β
.. β = .. .
..
. . 1 .
1 xn yn
6
To find a least-squares solution, we consider the equation
1 1 0
1 1 1 β 1 1 1
1 2 0 = 1 ,
1 2 3 β1 1 2 3
1 3 1
or equivalently
3 6 β0 2
= .
6 14 β1 5
We can solve to get β0 = −1/3 and β1 = 1/2. Our line of best fit is then y = − 13 + 12 x.
(b) For the best fit cubic curve y = β0 +β1 x+β2 x2 +β3 x3 given points (x1 , y1 ), (x2 , y2 ), . . . , (xn , yn ),
write the system of equations as well as the matrix equation for which we seek the least squares
solution.
SOLUTION: The system of equations is
β0 + β1 x1 + β2 x21 + β3 x31 = y1
.. ..
.=.
β0 + β1 xn + β2 x2n + β3 x3n = yn .
(c) Find the best fit cubic curve given the points (−2, −5), (−1, 1), (0, −3), (1, 2), (2, 7).
SOLUTION: The matrix equation here is
1 −2 4 −8 −5
1 −1 1 −1 β0 1
1 0 0 0 β1 = −3 .
1 1 1 1 β 2
2
β3
1 2 4 8 7
We can find the cubic of best fit using least-squares as before: the solution is y = β0 + β1 x +
β2 x2 + β3 x3 , where
3 1 1 5
β0 = − , β1 = − , β2 = , β3 = .
5 3 2 6