Math 309B/C Winter 2012, Homework 4


Due February 8


  1. Recall that we had two different ways of solving non homogeneous equations of the form \[x'(t)=Ax(t)+g(t).\] The first way involved diagonalizing the matrix. Recall that, if $A$ has eigenvalues $\lambda_{1},...,\lambda_{n}$ with eigenvectors $v_{1},...,v_{n}$, then if we let $T=(v_{1}|\cdots |v_{n})$, we have that \[TAT^{-1}= D= \left(\begin{array}{cccc} \lambda_{1} \\ & \lambda_{2} \\ & & \ddots \\ & & & \lambda_{n}\end{array}\right).\] Let $x=Ty$ for some other function $y$. We substitute this into our main equation and then solve for $y$: \[(Ty)'=A(Ty)+g\] \[Ty'=ATy+g.\] Now multiply both sides by $T^{-1}$, and we get \[T^{-1}T y'=\underbrace{T^{-1}AT}_{D}y+T^{-1}g\] \[y'=Dy+h\] where we have set $h=T^{-1} g$ to ease notation. Now we have a new differential equation, but it's easier to solve since we can solve a bunch of different equations separately, since this equation reads off as \[\left(\begin{array}{c} y_{1}' \\ \vdots \\ y_{n}' \end{array}\right) = \left(\begin{array} \lambda_{1} y_{1}+h_{1} \\ \vdots \\ \lambda_{n} y_{n} +h_{n}\end{array}\right)\] where $h_{1},...,h_{n}$ are the components of the vector $h$ (which are all functions of $t$. Hence we have $n$ independent equations \[y_{1}(t)'=\lambda_{1}y_{1}(t)+h_{1}(t)\] \[y_{2}(t)'=\lambda_{2}y_{2}(t)+h_{2}(t)\] \[\vdots\] \[y_{n}(t)'=\lambda_{n}y_{n}(t)+h_{n}(t).\] Now we solve each one of these equations separately using integration factors (see section 2.1 of the textbook). To review, suppose we're solving the $j$th equation. We write \[y_{j}'-\lambda_{j}y_{j}=h_{j}\] and multiply both sides by some integration factor (which we will solve for in a sec) \[\mu y_{j}'-\mu \lambda_{j} y_{j}=\mu h_{j}.\] Now, we'd like to pick $\mu$ so that the left side is just $(\mu y_{j})'$, but $(\mu y_{j})'=\mu y_{j}'+\mu'y_{j}$, hence this and the left side of the above equation are equal if \[\mu'=-\lambda_{j} \mu,\] i.e. if \[\mu(t)=e^{-\lambda_{j}(t)}.\] Hence, going back to the earlier equation, we have \[(\mu y_{j})'=(e^{-\lambda_{j}t}y_{j})'=\mu h_{j}= e^{-\lambda_{j}t}h_{j},\] and integrating both sides and multiplying by $e^{\lambda_{j}} t$ gives \[y_{j}=e^{\lambda_{j}t}\int e^{-\lambda_{j} t}h_{j}.\] Finally, our particular solution $x$ is $Ty$.

    To find the general solution, we take our particular solution and add the general solution for the homogeneous equation $x'=Ax$, so if $x'=Ax$ has fundamental solutions $x^{(1)},...,x^{(n)}$, then the general solution for $x'=Ax+g$ is \[x=\underbrace{c_{1} x^{(1)}+\cdots + c_{n}x^{(n)}}_{\mbox{homogeneous solution}}+\underbrace{Ty}_{\mbox{\particular solution}}.\] Note that there is no constant in front of the particular solution. Thus, there are a few steps to solving a nonhomogeneous problem if $A$ is diagonalizable:

    1. Find the eigenvectors $v_{1},...,v_{n}$ and eigenvalues $\lambda_{1},...,\lambda_{n}$

    2. Let $T=(v_{1}|\cdots | v_{n})$, find its inverse, and define a new function $h=T^{-1}g$.

    3. Compute the functions $y_{j}=e^{\lambda_{j}t}\int e^{-\lambda_{j} t}h_{j}$.

    4. Finally, compute $Ty$ and add the general solution of $x'=Ax$ to $Ty$ to get the general solution for the whole equation.
  2. So let's do an example, and try to work along. Consider the equation \[x'=\underbrace{\left(\begin{array}{cc} 1 & 2 \\ 2 & 1 \end{array}\right)}_{A}x+\underbrace{\left(\begin{array}{c} e^{2t}+e^{-t} \\ e^{2t}-e^{-t}\end{array}\right)}_{g}.\]

    1. To save some time (since we can do this by now), the eigenvalues are $3$ and $-1$ with eigenvectors $\left(\begin{array}{c} 1 \\ 1 \end{array}\right)$ and $\left(\begin{array}{c} 1 \\ -1 \end{array}\right)$ respectively. Hence the matrix

    2. $T=\left(\begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right) $ and $T^{-1}=\frac{1}{2} \left(\begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right) $. Also, \[h=T^{-1}g=\left(\begin{array}{c} e^{2t} \\ e^{-t}\end{array}\right).\]

    3. Now we compute the $y$'s. Note that the order of the eigenvectors in $T$ and the order of the eigenvalues you use below matter: since our first vector in $T$ has corresponding eignvalue $3$, that is the eigenvalue we use below: \[y_{1} =e^{3t}\int e^{-3t}h_{1}=e^{3t}\int e^{-3t}e^{2t}=e^{3t}\int e^{-t} = -e^{3t}e^{-t}=-e^{2t}.\] Now we use the second eigenvalue for the second equation (since the corresponding eigenvector was the second column of $T$): \[y_{2} = e^{-t}\int e^{t} h_{2} = e^{-t} \int e^{t} e^{-t}=e^{-t}\int 1 = e^{-t}t.\]

    4. Thus, \[x=Ty=\left(\begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right) \left(\begin{array} -e^{2t} \\ e^{-t} t \end{array}\right) =\left(\begin{array}{cc} -e^{2t} +te^{-t} \\ -e^{2t} - te^{-t}\end{array}\right).\] For the general solution to $x'=Ax$, we already know the eigenvectors and values, so this has fundamental solutions \[x^{(1)}=\left(\begin{array}{c} 1 \\ 1 \end{array}\right) e^{3t}, \;\;\; x^{(2)}=\left(\begin{array}{c} 1 \\ -1 \end{array}\right)e^{-t}\] so finally, the general solution is \[x(t)= c_{1} \left(\begin{array}{c} 1 \\ 1 \end{array}\right) e^{3t}+c_{2} \left(\begin{array}{c} 1 \\ -1 \end{array}\right)e^{-t}+\left(\begin{array}{c} -e^{2t} +te^{-t} \\ -e^{2t} - te^{-t}\end{array}\right).\]

  3. Now try some on your own

    1. $x'=\left(\begin{array}{cc} 1 & 1 \\ 4 & 1 \end{array}\right)x + \left(\begin{array}{c} 2 \\ -1 \end{array}\right) e^{t}$.

    2. $x'=\left(\begin{array}{cc} 1 & 1 \\ 4 & -2 \end{array}\right)x + \left(\begin{array}{c} e^{-2t} \\ -2e^{t} \end{array}\right) e^{t}$.

    3. $x'=\left(\begin{array}{cc} 2 & -1 \\ 3 & -2 \end{array}\right)x + \left(\begin{array}{c} 1 \\ -1 \end{array}\right) e^{-t}$.

  4. Show that if $f$ and $g$ are two $L$ periodic functions, then $f+g$ is also $L$ periodic.

  5. Show that if $f$ and $g$ are $L$-periodic and $f(x)=g(x)$ for $x\in [0,L]$, then $f(x)=g(x)$ for $x\in [0,2L]$. ( Hint: Let $x\in [L,2L]$. Then $x=L+y$ for some $y\in [0,L$.) What this exercise tells us is that, if two functions $f$ and $g$ are $L$ periodic and agree on an interval of length $L$, then they actually equal each other everywhere, since we can show that they agree in larger and larger intervals (e.g. since they agree in $[0,L]$, they agree in $[0,2L]$; similarly, we can use the same reasoning to show they agree in $[-L,2L]$, then $[-2L,2L]$, etc, just keep on expanding the interval.)

  6. Suppose we are given a $2L$-periodic function $f$, and we want to find a potential Fourier series that converges to it everywhere (the issue of whether or not a Fourier series converges to its given function is something we'll take up in section 10.2, but for now, we'll suppose that Fourier series always converge). To figure out it's Fourier series, we just need to find a $2L$-periodic Fourier series that agrees with it on the interval $[-L,L]$ (since if they agree here, then by the previous exercises, since they are both $2L$-periodic, they will end up equaling each other everywhere). Hence, we need to compute its Fourier coefficients $a_{m}$ and $b_{m}$ so that \[f(x)=\frac{a_{0}}{2} +\sum_{n=1}^{\infty}\left(a_{n}\cos \frac{n\pi x}{L} + b_{n}\sin\frac{n\pi x}{L}\right).\] To do so, let $\langle f,g\rangle= \int_{-L}^{L}fg$. We simply compute \[a_{0}=\frac{\int_{-L}^{L}f}{L},\] \[a_{n}=\frac{\langle f,\cos\frac{n\pi x}{L}\rangle}{L}\] \[b_{n}=\frac{\langle f,\sin\frac{n\pi x}{L}\rangle}{L}.\]
  7. The following exercises will help you save some time computing Fourier coefficients. Basically, there are some special cases when you can see that some Fourier coefficients will be zero without computing anything.
  8. We say $f$ is an even function if $f(-x)=f(x)$, and an odd function if $f(-x)=-f(x)$. For example, $\cos x$ is an even function and $\sin x$ is an odd function. Even functions are such that their graphs are symmetric about the $y$-axis, while odd function are antisymmetric in the sense that their graph to the left of the $y$-axis is looks like you reflected the graph across the $y$-axis.

    1. Show that if $f$ is odd and $g$ is even, then $fg$ is odd.

    2. Show that if $f$ is odd, then $\int_{-L}^{L}f=0$. Hint: Separate this into two integrals, one over $[-L,0]$ and $[0,L]$ and recall the formula $\int_{0}^{L}g(-x)dx=\int_{-L}^{0} g(x)$.
    3. Show that if $f$ is even, then $\int_{-L}^{L}f=2\int_{0}^{L}f$ (<b> Note:</b> This is a new problem, I won't quiz you on it, but this is a very useful fact when evaluating Fourier coefficients that you should use.)

    4. Show that if $f$ is an even function that is $2L$-periodic, then $b_m=0$ for all $m$. Hint: This follows from the two previous problems.

    5. Show that if $f$ is an odd function that is $2L$-periodic, then $a_{m}=0$ for all $m$.

  9. Compute the Fourier coefficients for the following functions and write down their Fourier series. (Also, remember to check if the functions are odd or even and use the above exercises so you don't have to do so many computations!):

    1. $f(x)=1-|x|$ on $[-1,1]$, $f(x+2)=f(x)$ everywhere else. Answer: Since $f$ is 2-periodic, $L=1$ (recall that this guarantees that the trigonometric functions in our Fourier series will also be $2L$-periodic. Note that $f(x)$ is an even function, since $f(-x)=1-|-x|=1-|x|=f(x)$. Hence, by a previous exercise, $b_{m}=0$. Using 7c, \[a_{0}=\frac{\int_{-L}^{L} f(x)}{L}=\int_{-1}^{1}f(x)=2\int_{0}^{1}f(x)=2\int_{0}^{1}(1-|x|)=2\int_{0}^{1}(1-x)=x-\frac{x^{2}}{2}|_{0}^{1}=\frac{1}{2}\] and again using 7c, \[a_{m}=\frac{\int_{-1}^{1}f(x)\cos m\pi x}{1}=2\int_{0}^{1}f(x)\cos m\pi x=2\int_{0}^{1}(1-x)\cos m\pi x = \frac{2}{m\pi}(1-x)\sin m\pi x|_{0}^{1} -\frac{2}{m\pi}\int_{0}^{1}(-1)\sin m\pi x = 0-\frac{2}{m^{2}\pi^{2}}\cos m\pi x|_{0}^{1} =-\frac{2}{m^{2}\pi^{2}}(\cos m \pi -1)\] and hence the Fourier series is \[f(x)= \frac{1/2}{2} +\sum_{m=1}^{\infty}\left(-\frac{2}{m^{2}\pi^{2}}(\cos m \pi -1)\cos m\pi x+0\sin m\pi x\right)=\frac{1}{4}-\frac{2}{\pi^{2}}\sum_{m=1}^{\infty}\frac{\cos m\pi -1}{m^{2}}\cos m\pi x.\] If we write out the first so many terms of this series, we get \[f(x)=\frac{1}{4}+\frac{4}{\pi^{2}}\cos \pi x + \frac{4}{3^{2}\pi^{2}}\cos 3\pi x+\frac{4}{5^{2}\pi^{2}}\cos 5\pi x+\cdots.\] Notice that the pattern is that every other term is zero, and only the odd numbered terms (i.e. the terms with $\cos m\pi x$ where $m$ is odd) appear. We can rewrite this in the simplified form \[f(x)=\frac{1}{4}+\frac{4}{\pi^{2}}\sum_{m=1}^{\infty}\frac{\cos (2m-1)x}{2m-1}.\]

    2. $f(x)=x^{2}$ on $[-\pi,\pi]$, $f(x+2\pi)=f(x)$ everywhere else. By evaluating $f$ and your Fourier series at zero, find an infinite sum that equals $\pi^{2}$. Answer: Note that $f$ is $2\pi$-periodic, so $L=\pi$. Also note that this is even, so $b_{m}=0$. Then, using 7c, \[a_{0}=\frac{\int_{-\pi}^{\pi}f(x)}{\pi}=\frac{2}{\pi}\int_{0}^{\pi}f(x)=\frac{2}{\pi}\int_{0}^{\pi} x^{2}=\frac{2}{\pi} \frac{x^{3}}{3}|_{0}^{\pi}=\frac{2}{\pi} \frac{\pi^{3}}{3}=\frac{2\pi^{2}}{3}.\] \[a_{m}=\frac{\int_{-\pi}^{\pi}f(x)\cos mx}{\pi} =\frac{2}{\pi}\int_{0}^{\pi}x^{2}\cos m x =\frac{2}{m\pi}x^{2}\sin mx|_{0}^{\pi}-\frac{2}{m\pi}\int_{0}^{\pi} 2x\sin mx =0-\frac{2}{m^{2}\pi}2x \cos mx|_{0}^{\pi}+\frac{2}{m^{2}\pi}\int_{0}^{\pi}2\cos mx =\frac{2}{m^{2}\pi}2\pi\cos m\pi+\frac{4}{m^{3}\pi}\sin mx|_{0}^{1}=\frac{4}{m^{2}}\cos m\pi.\] And hence the Fourier series is \[f(x)=\frac{\frac{2\pi^{2}}{3}}{2}+\sum_{m=1}^{\infty} \frac{4}{m^{2}}\cos m\pi \cos mx.\] Note that $\cos m\pi=(-1)^{m}$, so this series can be written in simplified form as \[f(x)=\frac{\pi^{2}}{3}+\sum_{m=1}^{\infty}\frac{4}{m^{2}}(-1)^{m}\cos mx.\] Since $f(x)=x^{2}$, if we plug in zero, we get \[0=\frac{\pi^{2}}{3}+\sum_{m=1}^{\infty}\frac{4}{m^{2}}(-1)^{m},\] and hence \[\frac{\pi^{2}}{12}=\sum_{m=1}^{\infty}\frac{(-1)^{m+1}}{m^{2}}.\]

    3. $f(x)= \cosh x$ in $[-\pi,\pi]$ and $f(x+2\pi)=f(x)$ everywhere else.

    4. $f(x)=\sinh x$ in $[-\pi,\pi]$, $f(x+2\pi)=f(x)$ everywhere else.

    5. $f(x)=x(x^{2}-1)$ for $x\in[-1,1]$ and $f(x+2)=f(x)$ everywhere else.
    6. Answer: Note that $f$ is odd, since $f(-x)=-x(x^{2}-1)=-f(x)$, so $a_{0}=a_{m}=0$. Also note that since $f$ and $\sin m\pi x$ are odd, their product is even, so by 7c, \begin{align*} b_{m} & =\int_{-1}^{1}f(x)\sin m\pi x=2\int_{0}^{1}x(x^{2}-1)\sin m\pi x\\ & =-2\frac{1}{m\pi}x(x^{2}-1)\cos m\pi x|_{0}^{1}+2\frac{1}{m\pi}\int_{0}^{1}(3x^{2}-1)\cos m\pi x\\ & =0+\frac{2}{m^{2}\pi^{2}}(3x^{2}-1)\sin m\pi x|_{0}^{1}-\frac{2}{m^{2}\pi^{2}}\int_{0}^{1}6x \sin m\pi x \\ & =0+\frac{2}{m^{3}\pi^{3}}6x\cos m \pi|_{0}^{1}-\frac{2}{m^{3}\pi^{3}}\int_{0}^{1}6\cos m\pi x\\ & =\frac{12\cos m\pi }{m^{3}\pi^{3}}-\frac{12}{m^{4}\pi^{4}}\sin m\pi x|_{0}^{1}=\frac{12\cos m\pi }{m^{3}\pi^{3}} \end{align*} and so the Fourier series is \[f(x)=\sum_{m=1}^{\infty} \frac{12\cos m\pi }{m^{3}\pi^{3}}\sin m\pi x,\] and recalling that $\cos m\pi=(-1)^{m}$, we may simplify this by writing \[f(x)=\sum_{m=1}^{\infty}\frac{12(-1)^{m}}{m^{3}\pi^{3}}\sin m\pi x.\]
    7. $f(x)=\left\{ \begin{array}{cc} x+2 & -2\leq x\leq -1 \\ -x & -1\leq x\leq 1 \\ x-2 & 1\leq x\leq 2 \end{array}\right.$, $f(x+4)=f(x)$. yo