Appendix ASolutions to the Exercises
This appendix collects the complete solutions to the exercises at the end of each chapter. Before reading a solution, be sure to work the problem out yourself at least once. If you get stuck along the way, go back to the hints at the end of the chapter and to the worked examples in the text, and then read the solution here. From the end of each solution, you can return to its chapter.
Chapter 1 The Rigorous Definition of Limits and an Introduction to Differentiation
Exercise 1.1: Show that $\displaystyle\lim_{n\to\infty}\frac{n}{n+1}=1$ by the $\varepsilon$-$N$ argument
Solution
Let $a_n=\dfrac{n}{n+1}$. First we compute $1-a_n$.
$$ 1-a_n=1-\frac{n}{n+1}=\frac{(n+1)-n}{n+1}=\frac{1}{n+1} $$(We put the terms over a common denominator and then computed the numerator.) Hence
$$ |a_n-1|=\left|-\frac{1}{n+1}\right|=\frac{1}{n+1} $$(For $n\ge1$ we have $n+1>0$, so the absolute value can be removed.) Solving $|a_n-1|\lt \varepsilon$, we get
$$ \frac{1}{n+1}\lt \varepsilon \iff n+1>\frac{1}{\varepsilon} \iff n>\frac{1}{\varepsilon}-1 $$(Since both sides are positive, we used the fact that taking reciprocals reverses the inequality.) Hence, if we choose a natural number $N$ satisfying $N>\dfrac1\varepsilon-1$ (for example, $N=\left\lceil\dfrac1\varepsilon\right\rceil$), then $|a_n-1|\lt \varepsilon$ whenever $n\ge N$. Altogether, we have shown that
$$ \forall\varepsilon>0,\ \exists N\in\N\ \text{s.t.}\ n\ge N\Rightarrow\left|\frac{n}{n+1}-1\right|\lt \varepsilon $$and therefore $\displaystyle\lim_{n\to\infty}\frac{n}{n+1}=1$.
Exercise 1.2: Show that $\displaystyle\lim_{x\to1}(2x-1)=1$ by the $\varepsilon$-$\delta$ argument in form (III)
Solution
Let $f(x)=2x-1$. For $\forall\varepsilon>0$, we show that there exists a $\delta>0$ such that $0\lt |x-1|\lt \delta\Rightarrow|f(x)-1|\lt \varepsilon$. First we compute $f(x)-1$.
$$ f(x)-1=(2x-1)-1=2x-2=2(x-1) $$(We combined the constant terms and then factored out $2$.) Hence
$$ |f(x)-1|=|2(x-1)|=2|x-1| $$($|2(x-1)|=|2|\cdot|x-1|=2|x-1|$.) Therefore $|f(x)-1|\lt \varepsilon$ is equivalent to
$$ 2|x-1|\lt \varepsilon \iff |x-1|\lt \frac{\varepsilon}{2} $$(we divided both sides by the positive number $2$). There is no need to impose a restriction such as $\delta\le1$, as was done in Example 1.2; we can simply take
$$ \delta=\frac{\varepsilon}{2} $$Then, when $0\lt |x-1|\lt \delta=\varepsilon/2$, we have $|f(x)-1|=2|x-1|\lt 2\cdot\dfrac{\varepsilon}{2}=\varepsilon$. Thus
$$ \forall\varepsilon>0,\ \exists\delta=\frac{\varepsilon}{2}>0\ \text{s.t.}\ 0\lt |x-1|\lt \delta\Rightarrow|(2x-1)-1|\lt \varepsilon $$holds, and $\displaystyle\lim_{x\to1}(2x-1)=1$ has been shown.
Exercise 1.3: Determine the convergence of $\displaystyle\sum_{n=1}^{\infty}\frac{n^2}{3^n}$ by d'Alembert's ratio test
Solution
Let $a_n=\dfrac{n^2}{3^n}$.
$$ \frac{a_{n+1}}{a_n}=\frac{(n+1)^2/3^{n+1}}{n^2/3^n}=\frac{(n+1)^2}{3^{n+1}}\cdot\frac{3^n}{n^2}=\frac{(n+1)^2}{3n^2} $$(We converted the division of fractions into multiplication and simplified using $3^{n+1}/3^n=3$.) Hence
$$ r=\lim_{n\to\infty}\frac{a_{n+1}}{a_n}=\lim_{n\to\infty}\frac{(n+1)^2}{3n^2}=\lim_{n\to\infty}\frac{1}{3}\left(\frac{n+1}{n}\right)^2=\lim_{n\to\infty}\frac13\left(1+\frac1n\right)^2=\frac13\cdot1^2=\frac13 $$(We divided the numerator and denominator by $n^2$ and then used $\left(1+\dfrac1n\right)^2\to1^2=1$ as $n\to\infty$.) Since $r=1/3\lt 1$, Theorem 1.2(i) (d'Alembert's ratio test) shows that $\displaystyle\sum_{n=1}^{\infty}\frac{n^2}{3^n}$ converges. (It is known that its actual value is $3/2$.)
Exercise 1.4: Show that $\displaystyle\lim_{n\to\infty}\frac{\lfloor nx\rfloor}{n}=x$ by the squeeze theorem
Solution
By the definition of the floor function (Gauss bracket), $\lfloor nx\rfloor$ is “the largest integer not exceeding $nx$,” so
$$ \lfloor nx\rfloor\le nx\lt \lfloor nx\rfloor+1 $$holds. We rearrange this inequality into a form that squeezes $\lfloor nx\rfloor$ from both sides. The left inequality $\lfloor nx\rfloor\le nx$ can be used as it stands. Solving the right inequality $nx\lt \lfloor nx\rfloor+1$ for $\lfloor nx\rfloor$ gives $\lfloor nx\rfloor>nx-1$. Combining the two, we have
$$ nx-1\lt \lfloor nx\rfloor\le nx $$Dividing this by the positive number $n$ ($n\ge1$), which does not change the direction of the inequality signs, we obtain
$$ x-\frac1n\lt \frac{\lfloor nx\rfloor}{n}\le x $$Now let $x_n=x-\dfrac1n$, $a_n=\dfrac{\lfloor nx\rfloor}{n}$, and $y_n=x$ (a constant sequence that does not depend on $n$). Since $\displaystyle\lim_{n\to\infty}\frac1n=0$ (this follows immediately from Definition 1.1, because $\left|\dfrac1n-0\right|=\dfrac1n\lt \varepsilon\iff n>1/\varepsilon$),
$$ \lim_{n\to\infty}x_n=\lim_{n\to\infty}\left(x-\frac1n\right)=x-0=x,\qquad \lim_{n\to\infty}y_n=\lim_{n\to\infty}x=x $$(The limit of the constant sequence $y_n=x$ is $x$ itself.) Combining this with $x_n\le a_n\le y_n$ and applying Theorem 1.3 (the squeeze theorem), we find that
$$ \lim_{n\to\infty}\frac{\lfloor nx\rfloor}{n}=x $$holds.
Exercise 1.5: An application of Eq. ④: Find $\displaystyle\lim_{h\to0}\frac{e^{2h}-1}{h}$
Solution
Let $u=2h$. As $h\to0$, we have $u\to0$. Rewriting the given expression in terms of $u$, we get
$$ \frac{e^{2h}-1}{h}=\frac{e^{u}-1}{u/2}=2\cdot\frac{e^{u}-1}{u} $$(We used $h=u/2$, wrote $1/(u/2)=2/u$, and moved the $2$ to the front.) Hence
$$ \lim_{h\to0}\frac{e^{2h}-1}{h}=\lim_{u\to0}2\cdot\frac{e^{u}-1}{u}=2\cdot\lim_{u\to0}\frac{e^{u}-1}{u}=2\cdot1=2 $$(In the last step we used Eq. ④ of the main text, $\displaystyle\lim_{x\to0}\frac{e^x-1}{x}=1$, as it stands.) Therefore the answer is $2$.
Exercise 1.6: Find the derivative of $f(x)=\dfrac1x$ from the defining formula
Solution
Substitute $f(x)=1/x$ into the defining formula of the derivative in Definition 1.5, $f'(x)=\displaystyle\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$.
$$ f'(x)=\lim_{h\to0}\frac1h\left(\frac{1}{x+h}-\frac1x\right) $$First we put the expression in the parentheses over a common denominator.
$$ \frac{1}{x+h}-\frac1x=\frac{x}{x(x+h)}-\frac{x+h}{x(x+h)}=\frac{x-(x+h)}{x(x+h)}=\frac{-h}{x(x+h)} $$(After putting the terms over a common denominator and computing the numerator, we get $x-(x+h)=x-x-h=-h$.) Hence
$$ f'(x)=\lim_{h\to0}\frac1h\cdot\frac{-h}{x(x+h)}=\lim_{h\to0}\frac{-h}{h\cdot x(x+h)}=\lim_{h\to0}\frac{-1}{x(x+h)} $$(Since $h\neq0$ before the limit is taken, we can cancel $h$ from the numerator and denominator.) Finally, taking the limit $h\to0$, we have $x+h\to x$, so
$$ f'(x)=\frac{-1}{x(x+0)}=-\frac{1}{x^2} $$Thus the derivative of $f(x)=1/x$ is $f'(x)=-\dfrac{1}{x^2}$ ($x\neq0$).
← Back to Chapter 1, “The Rigorous Definition of Limits and an Introduction to Differentiation”
Chapter 2 Continuity of Functions, the Mean Value Theorem, and Hyperbolic Functions
Exercise 2.1: Finding $\displaystyle\lim_{x\to0}\frac{\tan2x}{\sin3x}$
Solution
Decompose the numerator and the denominator each into the form “$\dfrac{\tan kx}{kx}\cdot kx$”. By the fundamental limits $\displaystyle\lim_{x\to0}\frac{\sin x}{x}=1,\ \lim_{x\to0}\frac{\tan x}{x}=1$ proved in Sections 2.1.1 and 2.1.2, it holds in general, for any constant $k\neq0$, that $\displaystyle\lim_{x\to0}\frac{\tan kx}{kx}=1,\ \lim_{x\to0}\frac{\sin kx}{kx}=1$ (substituting $u=kx$ reduces them directly to the results of Sections 2.1.1 and 2.1.2). Using this,
$$ \frac{\tan2x}{\sin3x} = \frac{\dfrac{\tan2x}{2x}\cdot2x}{\dfrac{\sin3x}{3x}\cdot3x} = \frac{\dfrac{\tan2x}{2x}}{\dfrac{\sin3x}{3x}}\cdot\frac{2x}{3x} = \frac{\dfrac{\tan2x}{2x}}{\dfrac{\sin3x}{3x}}\cdot\frac23 $$(We canceled $\dfrac{2x}{3x}=\dfrac23$.) Taking the limit $x\to0$,
$$ \lim_{x\to0}\frac{\tan2x}{\sin3x} = \frac{\displaystyle\lim_{x\to0}\dfrac{\tan2x}{2x}}{\displaystyle\lim_{x\to0}\dfrac{\sin3x}{3x}}\cdot\frac23 = \frac{1}{1}\cdot\frac23 = \frac23 $$(Verified directly with SymPy that $\lim_{x\to0}\tan(2x)/\sin(3x)=2/3$.) Hence $\displaystyle\lim_{x\to0}\frac{\tan2x}{\sin3x}=\frac23$.
Exercise 2.2: Cauchy's mean value theorem for $f(x)=x^2,\ g(x)=x^3$ on the interval $[1,2]$
Solution
Since $f(x)=x^2,\ g(x)=x^3$ are both polynomials, they are continuous on $[1,2]$ and differentiable on $(1,2)$. The derivative $g'(x)=3x^2$ is never equal to $0$ on $(1,2)$ (because $x\neq0$ there), and since $g(1)=1,\ g(2)=8$ we have $g(1)\neq g(2)$, so all the hypotheses of Cauchy's mean value theorem (Theorem 2.3) are satisfied. Computing the left-hand side,
$$ \frac{f(2)-f(1)}{g(2)-g(1)} = \frac{4-1}{8-1} = \frac37 $$On the other hand, since $f'(x)=2x,\ g'(x)=3x^2$, we have $\dfrac{f'(c)}{g'(c)}=\dfrac{2c}{3c^2}=\dfrac{2}{3c}$ (we may cancel because $c\neq0$). By Cauchy's mean value theorem there must exist $c\in(1,2)$ for which this equals the left-hand side, so
$$ \frac{2}{3c} = \frac37 \quad\Longrightarrow\quad 14 = 9c \quad\Longrightarrow\quad c = \frac{14}{9} $$Indeed, $\dfrac{14}{9}\approx1.556$ satisfies $1\lt \dfrac{14}{9}\lt 2$. (Verified with SymPy that the left-hand side $=3/7$ and that the solution $c=14/9$ of the equation $2/(3c)=3/7$ lies in the interval $(1,2)$.) Hence $c=\dfrac{14}{9}$.
Exercise 2.3: L'Hôpital's rule for $\displaystyle\lim_{x\to\infty}\frac{\ln x}{x}$
Solution
As $x\to\infty$, the numerator $\ln x\to\infty$ and the denominator $x\to\infty$, so this is an indeterminate form of type $\dfrac{\infty}{\infty}$, and Theorem 2.4(II) applies. Letting $f(x)=\ln x,\ g(x)=x$, we have $f'(x)=\dfrac1x,\ g'(x)=1$, so
$$ \lim_{x\to\infty}\frac{\ln x}{x} = \lim_{x\to\infty}\frac{f'(x)}{g'(x)} = \lim_{x\to\infty}\frac{1/x}{1} = \lim_{x\to\infty}\frac1x = 0 $$(We used the fact that $\dfrac1x\to0$ as $x\to\infty$. This is a basic limit that you also learned in high school.) (Verified with SymPy that $\lim_{x\to\infty}\ln x/x=0$.) Hence $\displaystyle\lim_{x\to\infty}\frac{\ln x}{x}=0$. (This result means that “$x$ diverges to infinity much faster than $\ln x$,” and it is an important fact that we will use over and over again from Chapter 4 onward.)
Exercise 2.4: Using the addition formula for $\tanh(\alpha+\beta)$ to derive $\tanh2\alpha$
Solution
We start from the addition formula for hyperbolic functions (the formula in Chapter 2):
$$ \tanh(\alpha+\beta) = \frac{\tanh\alpha+\tanh\beta}{1+\tanh\alpha\tanh\beta} $$and substitute $\beta=\alpha$. The left-hand side becomes $\tanh(\alpha+\alpha)=\tanh2\alpha$, and on the right-hand side the numerator becomes $\tanh\alpha+\tanh\alpha=2\tanh\alpha$ and the product in the denominator becomes $\tanh\alpha\cdot\tanh\alpha=\tanh^2\alpha$, so
$$ \tanh2\alpha = \frac{\tanh\alpha+\tanh\alpha}{1+\tanh\alpha\cdot\tanh\alpha} = \frac{2\tanh\alpha}{1+\tanh^2\alpha} $$(Verified with SymPy that the difference between $\tanh2\alpha$, rewritten via the definition in terms of exponential functions, and the right-hand side $\dfrac{2\tanh\alpha}{1+\tanh^2\alpha}$ simplifies identically to $0$.) Hence $\tanh2\alpha=\dfrac{2\tanh\alpha}{1+\tanh^2\alpha}$ has been shown. (Compared with the double-angle formula for the trigonometric functions, $\tan2\theta=\dfrac{2\tan\theta}{1-\tan^2\theta}$, the only difference is that the sign in the denominator changes from $-$ to $+$—the phenomenon we saw in Section 2.5.3, in which “all the signs become $+$,” appears here as well.)
Exercise 2.5: Showing that $\tanh^2x+\dfrac1{\cosh^2x}=1$
Solution
Divide both sides of the basic identity of the hyperbolic functions (the formula in Chapter 2), $\cosh^2x-\sinh^2x=1$, by $\cosh^2x$ (since $\cosh x$ is always positive, $\cosh^2x>0$ and we may divide):
$$ \frac{\cosh^2x}{\cosh^2x} - \frac{\sinh^2x}{\cosh^2x} = \frac{1}{\cosh^2x} \quad\Longrightarrow\quad 1 - \left(\frac{\sinh x}{\cosh x}\right)^2 = \frac{1}{\cosh^2x} $$Here, by Definition 2.2, $\dfrac{\sinh x}{\cosh x}=\tanh x$, so $\left(\dfrac{\sinh x}{\cosh x}\right)^2=\tanh^2x$. Substituting this,
$$ 1 - \tanh^2x = \frac1{\cosh^2x} $$Adding $\tanh^2x$ to both sides,
$$ 1 = \tanh^2x + \frac1{\cosh^2x} \quad\therefore\ \tanh^2x+\frac1{\cosh^2x}=1 $$(Verified with SymPy that, when rewritten via the definitions in terms of exponential functions, $\tanh^2x+1/\cosh^2x-1$ simplifies identically to $0$.) This is the hyperbolic version of the trigonometric identity $\tan^2x+1=\dfrac1{\cos^2x}$ (obtained by dividing both sides of $\sin^2x+\cos^2x=1$ by $\cos^2x$); the only difference is that all the signs are $+$.
Exercise 2.6: Sketching the graph of $y=\tanh^{-1}x$ by the point-plotting method
Solution
Substitute the specified values of $x$ into the formula $\tanh^{-1}x=\dfrac12\ln\!\left(\dfrac{1+x}{1-x}\right)$ of Theorem 2.9 and compute.
$$ \begin{array}{c|ccccc} x & -0.9 & -0.5 & 0 & 0.5 & 0.9 \\\hline \tanh^{-1}x & -1.4722 & -0.5493 & 0 & 0.5493 & 1.4722 \end{array} $$(For example, when $x=0.9$, $\tanh^{-1}(0.9)=\dfrac12\ln\!\left(\dfrac{1.9}{0.1}\right)=\dfrac12\ln(19)\approx\dfrac12\times2.9444\approx1.4722$. All five values were verified with SymPy.) Plotting these points in the $xy$-plane, we see that the graph is point-symmetric about the origin (it is an odd function: $\tanh^{-1}(-x)=-\tanh^{-1}(x)$, which follows from $\ln\dfrac{1-x}{1+x}=-\ln\dfrac{1+x}{1-x}$), and that it is a monotonically increasing graph in which the increase in $y$ becomes steeper and steeper as $x$ moves away from $0$.
Examining the behavior as $x\to1^-$ from the formula, we find that in $\dfrac{1+x}{1-x}$ the numerator satisfies $1+x\to2$ (finite) and the denominator satisfies $1-x\to0^+$, so $\dfrac{1+x}{1-x}\to+\infty$. Therefore $\ln\!\left(\dfrac{1+x}{1-x}\right)\to+\infty$, and hence $\tanh^{-1}x\to+\infty$ (the graph extends upward without bound, so that it has a vertical asymptote at $x=1$). Similarly, as $x\to-1^+$ we have $\dfrac{1+x}{1-x}\to\dfrac{0^+}{2}=0^+$, so $\ln(\cdots)\to-\infty$ and hence $\tanh^{-1}x\to-\infty$ (the graph extends downward without bound at $x=-1$).
This is consistent with the fact that $\tanh^{-1}x$ is the inverse function of $\tanh x$ (Figure 2.6; the hyperbolic tangent has range $(-1,1)$ and horizontal asymptotes $y=\pm1$)—the graph of an inverse function is the graph of the original function reflected across the line $y=x$, so the horizontal asymptotes of $\tanh x$ (where $y\to\pm1$ as $x\to\pm\infty$) become, for $\tanh^{-1}x$, vertical asymptotes (where $y\to\pm\infty$ as $x\to\pm1$). (Verified with SymPy: both the numerical values at the five points $x=-0.9,\ldots,0.9$ and the fact that the limits as $x\to1^-,x\to-1^+$ diverge to $+\infty,-\infty$, respectively.)
← Back to Chapter 2, “Continuity of Functions, the Mean Value Theorem, and Hyperbolic Functions”
Chapter 3 Derivatives of Elementary Functions
Exercise 3.1: Derivative of $y=x^3\log_ex$
Solution
Let $f(x)=x^3$ and $g(x)=\log_ex$. Then $y=f(x)g(x)$ ($x>0$). Since $f'(x)=3x^2$ (the differentiation of power functions, already learned in high school) and $g'(x)=\dfrac1x$ (Formula 3.5), the product rule (Formula 3.3) gives
$$ y'=f'(x)g(x)+f(x)g'(x)=3x^2\log_ex+x^3\cdot\frac1x=3x^2\log_ex+x^2 $$The last term was simplified by cancellation: $x^3\cdot\dfrac1x=x^2$. Since $x^2$ is a common factor, we may also factor it out and summarize the result as
$$ y'=x^2(3\log_ex+1) $$(SymPy check: $\dfrac{d}{dx}(x^3\ln x)=3x^2\ln x+x^2$; when expanded, it gives the same expression as above.)
Exercise 3.2: Derivative of $y=\dfrac{e^x}{\cos x}$
Solution
Let $f(x)=e^x$ and $g(x)=\cos x$. Then $y=f(x)/g(x)$. Since $f'(x)=e^x$ (Formula 3.1) and $g'(x)=-\sin x$ (Formula 3.10), the quotient rule (Formula 3.4) gives
$$ y'=\frac{f'(x)g(x)-f(x)g'(x)}{g(x)^2}=\frac{e^x\cos x-e^x\cdot(-\sin x)}{\cos^2x}=\frac{e^x\cos x+e^x\sin x}{\cos^2x} $$Factoring $e^x$ out of the numerator, we obtain
$$ y'=\frac{e^x(\cos x+\sin x)}{\cos^2x} $$(The domain is $\cos x\neq0$, that is, $x\neq\frac\pi2+n\pi$. Verified with SymPy: an equivalent form, $\dfrac{d}{dx}(e^x/\cos x)=\sqrt2\,e^x\sin(x+\pi/4)/\cos^2x$, is also obtained, and using $\sqrt2\sin(x+\pi/4)=\sin x+\cos x$ (harmonic addition, already learned in high school), we confirmed that the two forms agree.)
Exercise 3.3: Derivative of $y=\log_2(x^2+1)$
Solution
Using the change-of-base formula $\log_2X=\dfrac{\log_eX}{\log_e2}$ (already learned in high school), we rewrite the function as $y=\dfrac{1}{\log_e2}\cdot\log_e(x^2+1)$. Since $\dfrac{1}{\log_e2}$ is a constant, Formula 3.7 (with $f(x)=x^2+1$, $f'(x)=2x$) gives
$$ y'=\frac{1}{\log_e2}\cdot\frac{d}{dx}\log_e(x^2+1)=\frac{1}{\log_e2}\cdot\frac{2x}{x^2+1}=\frac{2x}{(x^2+1)\log_e2} $$(The domain is all real numbers. Verified with SymPy.)
Exercise 3.4: Derivative of $y=\sinh^{-1}(3x)$
Solution
Let $u=3x$. Then $y=\sinh^{-1}u$. By the chain rule,
$$ \frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}=\frac{1}{\sqrt{u^2+1}}\cdot3 $$(Formula 3.15, $\dfrac{du}{dx}=3$). Substituting $u=3x$, we obtain
$$ y'=\frac{3}{\sqrt{9x^2+1}} $$(Since $\sinh^{-1}$ is defined for all real numbers, the domain is also all real numbers. Verified with SymPy.)
Exercise 3.5: Derivative of $y=\tan^{-1}\dfrac1x$
Solution
Let $u=\dfrac1x$ ($x\neq0$). Then $y=\tan^{-1}u$. By the chain rule,
$$ \frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}=\frac{1}{u^2+1}\cdot\left(-\frac{1}{x^2}\right) $$(Formula 3.20; $\dfrac{du}{dx}=-\dfrac{1}{x^2}$, using the differentiation of power functions, already learned in high school, $\left(x^{-1}\right)'=-x^{-2}$). Substituting $u=\dfrac1x$, we have $u^2+1=\dfrac{1}{x^2}+1=\dfrac{1+x^2}{x^2}$, so
$$ y'=\frac{1}{\dfrac{1+x^2}{x^2}}\times\left(-\frac{1}{x^2}\right)=\frac{x^2}{1+x^2}\times\left(-\frac{1}{x^2}\right)=-\frac{1}{x^2+1} $$(Note that $x^2$ cancels and disappears. The domain is $x\neq0$. It is also known that $\tan^{-1}(1/x)$ equals $\dfrac\pi2-\tan^{-1}x$ for $x\gt0$ (the two angles are complementary to each other), and indeed $\dfrac{d}{dx}\left(\dfrac\pi2-\tan^{-1}x\right)=-\dfrac{1}{x^2+1}$ gives the same answer—we can also confirm that the two calculations agree. Verified with SymPy.)
Exercise 3.6: $\dfrac{d}{dx}x^{\sin x}$ (logarithmic differentiation)
Solution
Let $y=x^{\sin x}$ ($x>0$). We use logarithmic differentiation, following exactly the same procedure as in Example 3.5 ($x^x$). Taking the natural logarithm of both sides gives
$$ \log_ey=\log_e\left(x^{\sin x}\right)=\sin x\cdot\log_ex $$(We used the property of logarithms $\log_e(A^B)=B\log_eA$.) Differentiate both sides with respect to $x$. The left side, by the chain rule, is as usual $\dfrac1y\cdot\dfrac{dy}{dx}$. For the right side we use the product rule (Formula 3.3, with $f(x)=\sin x$, $g(x)=\log_ex$).
$$ \frac1y\cdot\frac{dy}{dx}=\frac{d}{dx}(\sin x\cdot\log_ex)=\cos x\cdot\log_ex+\sin x\cdot\frac1x $$Multiplying both sides by $y$ and substituting $y=x^{\sin x}$, we obtain
$$ \frac{dy}{dx}=x^{\sin x}\left(\cos x\cdot\log_ex+\frac{\sin x}{x}\right) $$(Verified with SymPy: the equivalent form $\dfrac{d}{dx}x^{\sin x}=x^{\sin x-1}(x\log_ex\cos x+\sin x)$ is also obtained, and since $x^{\sin x}/x=x^{\sin x-1}$, we confirmed that the two forms differ only in how the common factor is taken out.)
← Back to Chapter 3, “Derivatives of Elementary Functions”
Chapter 4 Taylor's Theorem and Expansions of Functions
Exercise 4.1: First-order approximation of $\sin(0.1)$ and error estimate
Solution
Let $f(x)=\sin x$. Then $f(0)=\sin0=0$, and from $f'(x)=\cos x$ we get $f'(0)=\cos0=1$. By Theorem 4.1 ($n=1$, $a=0$, $X=x$),
$$ \sin x = f(0)+f'(0)x+R_2 = x+R_2,\qquad R_2=\frac{f''(c)}{2!}x^2=\frac{-\sin c}{2}x^2\quad(0 \lt c \lt x) $$(We used $f''(x)=-\sin x$.) Hence the first-order approximation is $\sin x\fallingdotseq x$, and substituting $x=0.1$ gives the approximate value
$$ \sin(0.1)\fallingdotseq 0.1 $$Since $|\sin c|\le1$ holds for any $c$ (the value of the sine is always at least $-1$ and at most $1$), the upper bound of the error can be estimated as
$$ |R_2| = \frac{|\sin c|}{2}\times(0.1)^2 \le \frac{1}{2}\times0.01 = 0.005 $$In fact, since $\sin(0.1)=0.0998334166\ldots$, the true error is
$$ \sin(0.1)-0.1 = 0.0998334\ldots-0.1 = -0.0001666\ldots $$and its absolute value $0.0001666\ldots$ is indeed smaller than the upper bound $0.005$ (the error is negative because $\sin c \gt 0$ for $0 \lt c \lt 0.1$, so that $R_2=-\frac{\sin c}{2}x^2 \lt 0$; even the sign agrees with the theory). (SymPy check: approximate value $0.1$, true value $0.0998334166468282$, error $-0.0001666\ldots$, upper bound $0.005$.)
Exercise 4.2: The Maclaurin expansion of $\sinh x$
Solution
Substituting $x\to-x$ into the Maclaurin expansion of $e^x$ in Section 4.2, $e^x=1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\cdots$, and noting that $(-x)^n=(-1)^n x^n$, we obtain
$$ e^{-x} = 1-x+\frac{x^2}{2!}-\frac{x^3}{3!}+\frac{x^4}{4!}-\cdots $$(The even-degree terms do not change sign; only the odd-degree terms are reversed in sign.) Using the definition $\sinh x=\dfrac{e^x-e^{-x}}{2}$ from Chapter 2 and subtracting $e^{-x}$ from $e^x$, we get
$$ e^x-e^{-x} = \left(1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\frac{x^5}{5!}+\cdots\right)-\left(1-x+\frac{x^2}{2!}-\frac{x^3}{3!}+\frac{x^4}{4!}-\frac{x^5}{5!}+\cdots\right) $$The even-degree terms ($1,\dfrac{x^2}{2!},\dfrac{x^4}{4!},\ldots$) have the same sign in both expansions, so they cancel in the subtraction and vanish, while the odd-degree terms ($x,\dfrac{x^3}{3!},\dfrac{x^5}{5!},\ldots$) have opposite signs, so in the subtraction they are doubled and remain.
$$ e^x-e^{-x} = 2\left(x+\frac{x^3}{3!}+\frac{x^5}{5!}+\frac{x^7}{7!}+\cdots\right) $$Dividing both sides by 2 gives
$$ \sinh x = \frac{e^x-e^{-x}}{2} = x+\frac{x^3}{3!}+\frac{x^5}{5!}+\frac{x^7}{7!}+\cdots = \sum_{n=0}^{\infty}\frac{x^{2n+1}}{(2n+1)!} $$(Comparing with the expansions of $\cos x,\sin x$, we see that the only difference is that all the signs are $+$—this reflects the analogy between hyperbolic functions and trigonometric functions. Using SymPy's $\mathrm{series}$, we verified that the expansion of $\sinh x$ and the expansion of $(e^x-e^{-x})/2$ agree.)
Exercise 4.3: Fifth-order approximation of $\cos(0.2)$ and error estimate
Solution
By the Maclaurin expansion of $\cos x$ in Section 4.2, the approximating polynomial up to fifth order (since the expansion of $\cos x$ has no odd-degree terms, this is effectively the same polynomial as the one up to fourth order, $P_4(x)=1-\dfrac{x^2}{2}+\dfrac{x^4}{24}$) is
$$ P_4(x) = 1-\frac{x^2}{2}+\frac{x^4}{24} $$Substituting $x=0.2$ gives
$$ P_4(0.2) = 1-\frac{0.04}{2}+\frac{0.0016}{24} = 1-0.02+0.0000667\ldots = 0.9800667\ldots $$The actual value is $\cos(0.2)=0.9800665778\ldots$, so the true error is
$$ \cos(0.2)-P_4(0.2) = 0.9800665778\ldots-0.9800666667\ldots = -0.0000000889\ldots\ (\approx-8.9\times10^{-8}) $$The size of the error can be estimated from the order of magnitude of the next term (the $x^6$ term in the expansion of $\cos x$, whose sign is $-$ and whose coefficient is $1/6!=1/720$), which gives
$$ \frac{x^6}{6!}\bigg|_{x=0.2} = \frac{0.2^6}{720} = \frac{0.000064}{720} \approx 8.9\times10^{-8} $$and this agrees exactly with the size of the actual error (one can see how, each time the order is raised by one, the error becomes smaller by nearly two orders of magnitude). (SymPy check: $P_4(0.2)=0.9800666667$, true value $0.9800665778$, size of the error $8.9\times10^{-8}$.)
Exercise 4.4: The fourth derivative of $\cos x$
Solution
Substituting $n=4$ into Formula 4.2 (the $n$th derivative of $\cos x$, $\frac{d^n}{dx^n}\cos x=\cos(x+n\pi/2)$) gives
$$ \frac{d^4}{dx^4}(\cos x) = \cos\left(x+\frac{4\pi}{2}\right) = \cos(x+2\pi) $$Since $\cos$ is a function with period $2\pi$, we have $\cos(x+2\pi)=\cos x$. Therefore we obtain
$$ \frac{d^4}{dx^4}(\cos x) = \cos x $$(This can also be confirmed from the fact that the chain $\cos x\to-\sin x\to-\cos x\to\sin x\to\cos x$ returns to the original function after four differentiations. We verified with SymPy that the result of differentiating directly four times agrees with $\cos x$.)
Exercise 4.5: Finding $(x^3e^x)^{(4)}$ with Leibniz's rule
Solution
Let $f(x)=x^3$ and $g(x)=e^x$. The derivatives of $f$ are
$$ f=x^3,\quad f'=3x^2,\quad f''=6x,\quad f'''=6,\quad f^{(4)}=0 $$(note that it becomes $0$ at the fourth derivative), and since $g$ is an exponential function, it remains $e^x$ no matter how many times it is differentiated.
$$ g=g'=g''=g'''=g^{(4)}=e^x $$By Formula 4.3 ($n=4$), using ${}_4C_0,\ldots,{}_4C_4=1,4,6,4,1$, we have
$$ (fg)^{(4)} = {}_4C_0\,f\,g^{(4)}+{}_4C_1\,f'g'''+{}_4C_2\,f''g''+{}_4C_3\,f'''g'+{}_4C_4\,f^{(4)}g $$ $$ = 1\cdot x^3\cdot e^x + 4\cdot3x^2\cdot e^x + 6\cdot6x\cdot e^x + 4\cdot6\cdot e^x + 1\cdot0\cdot e^x $$ $$ = x^3e^x+12x^2e^x+36xe^x+24e^x $$(The last term vanishes because $f^{(4)}=0$.) Factoring out $e^x$, we obtain
$$ (x^3e^x)^{(4)} = e^x\left(x^3+12x^2+36x+24\right) $$(Verified with SymPy that this agrees with the result of differentiating directly four times.)
Exercise 4.6: The extrema of $f(x)=x^5-5x$
Solution
Computing the first derivative and factoring it, we obtain
$$ f'(x)=5x^4-5=5(x^4-1)=5(x^2-1)(x^2+1)=5(x-1)(x+1)(x^2+1) $$Since $x^2+1$ is always positive over the real numbers ($\ge1$), it has no real roots. Therefore the only real roots of $f'(x)=0$ are the two critical points $x=1,-1$. Computing the higher-order derivative, we have
$$ f''(x)=20x^3 $$(i) The case $x=1$. We have $f'(1)=0$ (the premise) and $f''(1)=20\ (\neq0)$. The smallest $n$ with “$f^{(n)}(1)\neq0$” is $n=2$ (even), and $f''(1)=20 \gt 0$, so by Theorem 4.2(i) there is a local minimum at $x=1$. The local minimum value is
$$ f(1)=1^5-5\cdot1=1-5=-4 $$(ii) The case $x=-1$. We have $f'(-1)=0$ (the premise) and $f''(-1)=20\times(-1)^3=-20\ (\neq0)$. The smallest $n$ is $n=2$ (even), and $f''(-1)=-20 \lt 0$, so by Theorem 4.2(i) there is a local maximum at $x=-1$. The local maximum value is
$$ f(-1)=(-1)^5-5\times(-1)=-1+5=4 $$Therefore $f(x)=x^5-5x$ takes the local maximum value $4$ at $x=-1$ and the local minimum value $-4$ at $x=1$. (Verified with SymPy that all the roots of $f'(x)=0$ are $x=\pm1$ and two imaginary roots, and that $f''(\pm1)=\pm20$.)
Exercise 4.7: Finding $\displaystyle\lim_{x\to+0}x^{2x}$
Solution
We use the same idea as in the proof in Section 4.3 (the method using l'Hôpital's rule). We can rewrite $x^{2x}=e^{2x\ln x}$ (indeed, taking the logarithm of both sides gives $\ln(x^{2x})=2x\ln x$, which agrees). Therefore
$$ \lim_{x\to+0}x^{2x} = \lim_{x\to+0}e^{2x\ln x} $$and since $e^{(\cdot)}$ is continuous, it suffices to find the limit of the exponent $2x\ln x$. The limit of $x\ln x$ was already found in the alternative solution in Section 4.3:
$$ \lim_{x\to+0}x\ln x = \lim_{x\to+0}\frac{\ln x}{1/x} = \lim_{x\to+0}\frac{1/x}{-1/x^2}\ (\text{l'Hôpital's rule}) = \lim_{x\to+0}(-x) = 0 $$Therefore $2x\ln x=2\times(x\ln x)\to2\times0=0$ (the limit of a constant multiple is the same constant multiple of the limit). Hence we obtain
$$ \lim_{x\to+0}x^{2x} = \lim_{x\to+0}e^{2x\ln x} = e^0 = 1 $$(As we saw in Section 4.3, a lower bound cannot be constructed by elementary means from the Taylor expansion alone, so here too the proof by l'Hôpital's rule is essential. Check with SymPy's $\mathrm{limit}$: $\lim_{x\to0^+}x^{2x}=1$.)
← Back to Chapter 4, “Taylor's Theorem and Expansions of Functions”
Chapter 5 Basic Integration Formulas and Properties of Definite Integrals
Exercise 5.1: Find $\displaystyle\int\frac{1}{x^2-a^2}\,dx$ ($a\neq0$)
Solution
Factoring the denominator by the formula for the product of a sum and a difference, we get $x^2-a^2=(x-a)(x+a)$. To carry out the partial fraction decomposition, we use constants $A,B$ and set
$$ \frac{1}{(x-a)(x+a)}=\frac{A}{x-a}+\frac{B}{x+a} $$Putting the right-hand side over a common denominator gives $\dfrac{A(x+a)+B(x-a)}{(x-a)(x+a)}$, so comparing the numerators, we find that
$$ 1=A(x+a)+B(x-a) $$holds for all $x$. Substituting $x=a$ gives $1=A\cdot2a$, so $A=\dfrac{1}{2a}$; substituting $x=-a$ gives $1=B\cdot(-2a)$, so $B=-\dfrac{1}{2a}$ (here the condition $a\neq0$ is used in an essential way—if $a=0$, we would be dividing by $2a=0$, and the computation itself would break down). Therefore, we can rewrite the integrand as follows:
$$ \frac{1}{x^2-a^2}=\frac{1}{2a}\left(\frac{1}{x-a}-\frac{1}{x+a}\right) $$Applying the “Math Note: A generalization of Formula 5.1” in Section 5.1 (when $g(x)\neq0$, $\displaystyle\int\frac{g'(x)}{g(x)}\,dx=\ln|g(x)|+C$) to each of $g(x)=x-a$ and $g(x)=x+a$ (both are linear expressions with $g'(x)=1$), we get
$$ \int\frac{1}{x-a}\,dx=\ln|x-a|+C_1,\qquad \int\frac{1}{x+a}\,dx=\ln|x+a|+C_2 $$Multiplying these by $\dfrac1{2a}$ and subtracting (the constants of integration are collected into a single $C$), we obtain
$$ \int\frac{1}{x^2-a^2}\,dx=\frac{1}{2a}\Bigl(\ln|x-a|-\ln|x+a|\Bigr)+C=\frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right|+C $$(the last equality follows from the law of logarithms $\ln P-\ln Q=\ln(P/Q)$). (SymPy check: we verified that differentiating $\displaystyle\int\frac{1}{x^2-a^2}\,dx=\frac{\ln(x-a)}{2a}-\frac{\ln(x+a)}{2a}$ gives back the integrand.)
Exercise 5.2: Find $\displaystyle\int_0^1\frac{1}{\sqrt{1-x^2}}\,dx$
Solution
As $x\to1-0$, the denominator $\sqrt{1-x^2}\to0$, so the integrand $\dfrac{1}{\sqrt{1-x^2}}$ diverges (the hypothesis of Formula 5.6 is satisfied only for $-1\lt x\lt 1$). Therefore this definite integral is not an ordinary definite integral, and we must treat it as an improper integral of the form in Definition 5.2(I)—exactly the same situation as in Example 5.9. Let $0\lt c\lt 1$, and first compute an ordinary integral over the safe range $[0,c]$. By Formula 5.6 ($\displaystyle\int\frac{1}{\sqrt{1-x^2}}\,dx=\sin^{-1}x+C$),
$$ \int_0^{c}\frac{1}{\sqrt{1-x^2}}\,dx=\Bigl[\sin^{-1}x\Bigr]_0^{c}=\sin^{-1}c-\sin^{-1}0=\sin^{-1}c $$(we used $\sin^{-1}0=0$, which follows from the definition of the inverse sine function). What remains is to take the limit as $c\to1-0$. The inverse sine function $\sin^{-1}x$ is continuous on the closed interval $[-1,1]$, in particular continuous at the right endpoint $x=1$ as well, and $\sin^{-1}1=\dfrac{\pi}{2}$ (in the range $-\dfrac{\pi}2\le\theta\le\dfrac{\pi}2$, the only angle whose sine equals $1$ is $\theta=\dfrac{\pi}2$). Therefore,
$$ \int_0^1\frac{1}{\sqrt{1-x^2}}\,dx=\lim_{c\to1-0}\sin^{-1}c=\sin^{-1}1=\frac{\pi}{2} $$(SymPy check: $\displaystyle\int_0^1\frac{1}{\sqrt{1-x^2}}\,dx=\frac{\pi}{2}$; they agree.) This improper integral converges, and its value is $\dfrac{\pi}{2}$. Note that although the graph of the integrand rises without bound just before $x=1$, the area under it settles to a finite value.
Exercise 5.3: Checking Schwarz's inequality with a concrete example
Solution
We substitute $f(x)=x$ and $g(x)=1$ (a constant function) into Schwarz's inequality of Theorem 5.3, $\left\{\displaystyle\int_a^b f(x)g(x)\,dx\right\}^2\le\displaystyle\int_a^b f^2(x)\,dx\cdot\int_a^b g^2(x)\,dx$, in the case $[a,b]=[0,1]$, and compare the two sides by actually computing them.
First we compute the quantity inside the left-hand side (the integral of $fg$).
$$ \int_0^1 f(x)g(x)\,dx=\int_0^1 x\cdot1\,dx=\left[\frac{x^2}{2}\right]_0^1=\frac12-0=\frac12 $$Therefore the left-hand side is $\left(\dfrac12\right)^2=\dfrac14$. Next we compute each of the two integrals on the right-hand side.
$$ \int_0^1 f^2(x)\,dx=\int_0^1 x^2\,dx=\left[\frac{x^3}{3}\right]_0^1=\frac13,\qquad \int_0^1 g^2(x)\,dx=\int_0^1 1^2\,dx=\int_0^1 1\,dx=\Bigl[x\Bigr]_0^1=1 $$Therefore the right-hand side is $\dfrac13\times1=\dfrac13$. Comparing the left-hand side and the right-hand side, all we need to confirm is
$$ \frac14\ \overset{?}{\le}\ \frac13 $$Over a common denominator this reads $\dfrac{3}{12}\le\dfrac{4}{12}$, which does indeed hold. Hence we have confirmed numerically that Schwarz's inequality $\dfrac14\le\dfrac13$ really does hold for the concrete functions $f(x)=x,\ g(x)=1$ (the fact that we get the strict inequality $\lt$ rather than equality corresponds to the case in which the quadratic expression used in the proof of Theorem 5.3 is not identically $0$—the case in which $f$ and $g$ are not constant multiples of each other, that is, not proportional). (SymPy check: left-hand side $=1/4$, right-hand side $=1/3$, and indeed $1/4\lt1/3$.)
Exercise 5.4: Find $\displaystyle\int_0^1\ln x\,dx$ as an improper integral
Solution
The integrand $\ln x$ diverges as $x\to+0$, since $\ln x\to-\infty$; hence we treat this as an improper integral of the form in Definition 5.2(II). Let $0\lt c\lt 1$, and first find an antiderivative. As the hint says, if we let $u=\ln x,\ v'=1$, then $u'=\dfrac1x,\ v=x$, and the integration by parts formula (covered in high school mathematics) $\displaystyle\int uv'\,dx=uv-\int u'v\,dx$ gives
$$ \int\ln x\,dx=x\ln x-\int\frac1x\cdot x\,dx=x\ln x-\int1\,dx=x\ln x-x+C $$(along the way we used the cancellation $\dfrac1x\times x=1$). Using this antiderivative to compute the definite integral, we get
$$ \int_c^1\ln x\,dx=\Bigl[x\ln x-x\Bigr]_c^1=(1\cdot\ln1-1)-(c\ln c-c)=(0-1)-c\ln c+c=-1-c\ln c+c $$(we used $\ln1=0$). What remains is to take the limit as $c\to+0$. By the same idea as was already shown in Chapter 4, Section 4.3 (an example of computing a limit with l'Hôpital's rule),
$$ \lim_{c\to+0}c\ln c=\lim_{c\to+0}\frac{\ln c}{1/c}=\lim_{c\to+0}\frac{(\ln c)'}{(1/c)'}=\lim_{c\to+0}\frac{1/c}{-1/c^2}\ (\text{l'Hôpital's rule})=\lim_{c\to+0}(-c)=0 $$(we rewrote the indeterminate form $0\times(-\infty)$ as a quotient of the form $\dfrac{-\infty}{\infty}$ and applied l'Hôpital's rule). Also, $c\to+0$ means “$c$ approaches $0$ while taking positive values,” so it is, as it stands, also $c\to0$ (when considering the value of a limit, the distinction between positive and negative does not matter). Therefore,
$$ \int_0^1\ln x\,dx=\lim_{c\to+0}\left(-1-c\ln c+c\right)=-1-0+0=-1 $$(SymPy check: $\displaystyle\lim_{c\to+0}c\ln c=0$, and this also agrees with the result of computing $\displaystyle\int_0^1\ln x\,dx=-1$ directly.) This improper integral converges, and its value is $-1$. In the graph, $y=\ln x$ diverges to $-\infty$ as $x\to+0$, and since $\ln x\lt 0$ for $0\lt x\lt 1$ (below the $x$-axis), the “signed area below the $x$-axis” settles to the finite value $-1$—an interesting example.
Exercise 5.5: Find the range of $p$ for which $\displaystyle\int_1^{\infty}\frac{1}{x^p}\,dx$ converges
Solution
In Example 5.8 we examined only the cases $p=1$ and $p=2$; here we examine the convergence or divergence of $\displaystyle\int_1^{\infty}\frac1{x^p}\,dx$ (an improper integral over an infinite interval, of the form in Definition 5.3(II)) for a general real number $p$. The dividing line between the cases is $p=1$, where the form of the antiderivative of $x^{-p}$ changes.
(i) When $p\neq1$. By the integration formula for power functions (increase the exponent by 1 and divide by the new exponent), an antiderivative of $x^{-p}$ is $\dfrac{x^{1-p}}{1-p}$. Let $c>1$. Then
$$ \int_1^{c}\frac{1}{x^p}\,dx=\left[\frac{x^{1-p}}{1-p}\right]_1^{c}=\frac{c^{1-p}-1^{1-p}}{1-p}=\frac{c^{1-p}-1}{1-p} $$The limit of this expression as $c\to\infty$ is determined solely by the behavior of the power term $c^{1-p}$.
(i-a) When $p\gt1$. Since the exponent $1-p\lt0$, we can write $c^{1-p}=\dfrac{1}{c^{\,p-1}}$, and as $c\to\infty$ the denominator $c^{p-1}\to\infty$, so $c^{1-p}\to0$. Therefore,
$$ \int_1^{\infty}\frac{1}{x^p}\,dx=\lim_{c\to\infty}\frac{c^{1-p}-1}{1-p}=\frac{0-1}{1-p}=\frac{-1}{1-p}=\frac{1}{p-1}\qquad(\text{converges}) $$(i-b) When $p\lt1$. Since the exponent $1-p\gt0$, $c^{1-p}\to\infty$ as $c\to\infty$. Hence $\dfrac{c^{1-p}-1}{1-p}\to\infty$ (since $1-p\gt0$, the division does not change the sign), and the integral diverges.
(ii) When $p=1$. This is exactly the case $f(x)=1/x$ that we examined in Example 5.8, and
$$ \int_1^{\infty}\frac{1}{x}\,dx=\lim_{c\to\infty}\ln c=\infty\qquad(\text{diverges}) $$Combining (i-b) and (ii), we see that the integral always diverges when $p\le1$. To summarize,
$$ \int_1^{\infty}\frac{1}{x^p}\,dx\ \text{behaves as follows:}\ \begin{cases}p\gt1\ \text{converges, with value}\ \dfrac{1}{p-1}\\[4pt] p\le1\ \text{diverges}\end{cases} $$This is the result we obtain. It is an important result that will be used again later, as the benchmark for the integral test, when we examine the convergence or divergence of the infinite series $\displaystyle\sum_{n=1}^\infty\frac1{n^p}$ (the $p$-series). (SymPy check: for $p=1/2,1$ the integral diverges, and for $p=3/2,2,3$ the limit values are $2,1,1/2$, respectively, which all agree with the formula $\dfrac1{p-1}$ ($2$ for $p=3/2$, $1$ for $p=2$, $1/2$ for $p=3$).)
Exercise 5.6: Volume of the solid obtained by rotating $y=\sin x$ ($0\le x\le\pi$) about the $x$-axis
Solution
On the interval $0\le x\le\pi$ we have $\sin x\ge0$ (also at both endpoints $x=0,\pi$, where $\sin x=0\ge0$), so Formula 5.15 (the volume of a solid of revolution about the $x$-axis, $V=\pi\displaystyle\int_a^b f^2(x)\,dx$, provided that $f\ge0$) can be used as it stands. Substituting $f(x)=\sin x$, $a=0,\ b=\pi$, we get
$$ V=\pi\int_0^{\pi}\sin^2x\,dx $$As the hint says, we use the double-angle formula $\cos2x=1-2\sin^2x$ solved for $\sin^2x$, namely $\sin^2x=\dfrac{1-\cos2x}{2}$ (covered in high school mathematics), to rewrite the integrand in a form that is easy to integrate.
$$ V=\pi\int_0^{\pi}\frac{1-\cos2x}{2}\,dx=\frac{\pi}{2}\int_0^{\pi}(1-\cos2x)\,dx=\frac{\pi}{2}\left[x-\frac{\sin2x}{2}\right]_0^{\pi} $$Substituting the upper limit $x=\pi$, since $\sin2\pi=0$ we get $\pi-\dfrac{0}{2}=\pi$. Substituting the lower limit $x=0$, since $\sin0=0$ we get $0-\dfrac{0}{2}=0$. Therefore,
$$ V=\frac{\pi}{2}(\pi-0)=\frac{\pi^2}{2} $$(SymPy check: $V=\pi^2/2$; they agree.) If we rotate the graph of one arch of $y=\sin x$ ($0\le x\le\pi$) about the $x$-axis, we obtain a solid resembling a rugby ball, bulging in the middle and pointed at both ends, and its volume is $\dfrac{\pi^2}{2}\approx4.93$.
Exercise 5.7: Area of the circle $r=2a\cos\theta$ ($a>0$)
Solution
(1) Confirming that this polar equation represents a circle of radius $a$. We use the relations between polar and Cartesian coordinates, $x=r\cos\theta,\ y=r\sin\theta,\ r^2=x^2+y^2$ (covered in high school mathematics). Multiplying both sides of $r=2a\cos\theta$ by $r$ gives
$$ r^2=2ar\cos\theta $$The left-hand side is $x^2+y^2$, and $r\cos\theta$ on the right-hand side equals $x$, so substituting these gives
$$ x^2+y^2=2ax\iff x^2-2ax+y^2=0\iff(x-a)^2+y^2=a^2 $$(we completed the square using $x^2-2ax=(x-a)^2-a^2$ and added $a^2$ to both sides). The last equation is none other than the equation of the circle with center $(a,0)$ and radius $a$. Therefore this polar equation indeed represents a circle of radius $a$.
(2) The range of $\theta$. This circle passes through the origin $O$ ($x=y=0$). Indeed, when $\theta=\pm\dfrac{\pi}2$ we have $\cos\theta=0$, so $r=2a\cos\theta=0$ and the curve returns to the origin. Under the usual convention for polar equations that the radius $r$ is not negative ($r\ge0$), $r=2a\cos\theta\ge0$ holds when $\cos\theta\ge0$, that is, for $-\dfrac{\pi}2\le\theta\le\dfrac{\pi}2$. As $\theta$ moves from $-\dfrac{\pi}2$ to $\dfrac{\pi}2$ in this range, $r$ changes as $0\to2a\to0$ (the maximum value is $r=2a$ at $\theta=0$, which is the diameter of the circle), and the curve traces the circle exactly once.
(3) Computing the area. Substituting $\alpha=-\dfrac{\pi}2,\ \beta=\dfrac{\pi}2$ and $r=2a\cos\theta$ into Formula 5.14 ($S=\dfrac12\displaystyle\int_\alpha^\beta r^2\,d\theta$), we get
$$ S=\frac12\int_{-\pi/2}^{\pi/2}(2a\cos\theta)^2\,d\theta=\frac12\cdot4a^2\int_{-\pi/2}^{\pi/2}\cos^2\theta\,d\theta=2a^2\int_{-\pi/2}^{\pi/2}\cos^2\theta\,d\theta $$Using the same double-angle formula $\cos^2\theta=\dfrac{1+\cos2\theta}{2}$ that was used in Example 5.11, we get
$$ 2a^2\int_{-\pi/2}^{\pi/2}\frac{1+\cos2\theta}{2}\,d\theta=a^2\left[\theta+\frac{\sin2\theta}{2}\right]_{-\pi/2}^{\pi/2} $$Substituting the upper limit $\theta=\dfrac{\pi}2$, since $\sin\pi=0$ we get $\dfrac{\pi}2+\dfrac{0}{2}=\dfrac{\pi}2$. Substituting the lower limit $\theta=-\dfrac{\pi}2$, since $\sin(-\pi)=0$ we get $-\dfrac{\pi}2+\dfrac{0}{2}=-\dfrac{\pi}2$. Therefore,
$$ S=a^2\left(\frac{\pi}2-\left(-\frac{\pi}2\right)\right)=a^2\cdot\pi=\pi a^2 $$This agrees exactly with the formula $\pi a^2$ for the area of a circle of radius $a$ (covered in high school mathematics). As we confirmed in (1), this figure really is a circle of radius $a$, so this agreement is a good check that Formula 5.14 has been used correctly. (SymPy check: $S=\pi a^2$; they agree.)
← Back to Chapter 5, “Basic Integration Formulas and Properties of Definite Integrals”
Chapter 6 Partial Derivatives (Differentiation of Multivariable Functions)
Exercise 6.1: Partial derivatives of $f(x,y)=e^{xy}$
Solution
When differentiating partially with respect to $x$, we regard $y$ as a constant and use the formula for differentiating a composite function, $(e^u)'=e^u\cdot u'$ (here $u=xy$, and differentiating $u$ with respect to $x$ gives $y$).
$$ \pdiff{f}{x} = \pdiff{}{x}e^{xy} = e^{xy}\cdot\pdiff{}{x}(xy) = e^{xy}\cdot y = ye^{xy} $$Similarly, when differentiating partially with respect to $y$, we regard $x$ as a constant and use the fact that differentiating $u=xy$ with respect to $y$ gives $x$, so we obtain
$$ \pdiff{f}{y} = \pdiff{}{y}e^{xy} = e^{xy}\cdot\pdiff{}{y}(xy) = e^{xy}\cdot x = xe^{xy} $$(verified with SymPy: $f_x=ye^{xy}$, $f_y=xe^{xy}$).
Exercise 6.2: Proof that $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^2y}{x^4+y^2}$ does not exist
Solution
First, Method (I): we examine the behavior along the lines $y=mx$. Substituting $y=mx$, we obtain
$$ \frac{x^2y}{x^4+y^2} = \frac{x^2\cdot mx}{x^4+(mx)^2} = \frac{mx^3}{x^2(x^2+m^2)} = \frac{mx}{x^2+m^2} $$(We factored $x^2$ out of the denominator and canceled.) When $m\ne0$, as $x\to0$ the numerator $mx\to0$ and the denominator $x^2+m^2\to m^2$ (a constant other than $0$), so
$$ \lim_{x\to0}\frac{mx}{x^2+m^2} = \frac{0}{m^2} = 0 $$When $m=0$ (the case along the $x$-axis), $f(x,0)=0$, so the limit is simply $0$. Therefore the limit is $0$ along every line (along the $y$-axis, $x=0$, we also have $f(0,y)=0$, so the limit is again $0$).
Next, we examine the behavior along a path different from a line—the parabola $y=x^2$.
$$ f(x,x^2) = \frac{x^2\cdot x^2}{x^4+(x^2)^2} = \frac{x^4}{x^4+x^4} = \frac{x^4}{2x^4} = \frac12 $$(As long as $x\ne0$, the value is always the constant $\frac12$, regardless of the value of $x$.)
Although every limit along a line was $0$, along the parabola $y=x^2$ the value is always $\frac12$, and $0\ne\frac12$. Since the function approaches different values depending on the way of approach, the limit $\displaystyle\lim_{(x,y)\to(0,0)}\frac{x^2y}{x^4+y^2}$ does not exist (verified with SymPy: confirmed that the limit along the lines $y=mx$ is $0$ while the value along the parabola $y=x^2$ is $\frac12$, so they do not agree). This is a pitfall with exactly the same structure as Example 6.3 of this chapter ($xy^2/(x^2+y^4)$)—with the roles of the $x$-axis direction and the $y$-axis direction interchanged.
Exercise 6.3: The total differential of $z=xy$
Solution
The first-order part (the total differential) in Definition 6.3 generally has the form $\dd z=\pdiff{z}{x}\dd x+\pdiff{z}{y}\dd y$. Computing the partial derivatives of $z=xy$, we get
$$ \pdiff{z}{x} = y\ ,\qquad \pdiff{z}{y} = x $$(When differentiating partially with respect to $x$, we treat $y$ as a constant and regard $xy$ as a linear expression in $x$, so the derivative is $y$; likewise, when differentiating partially with respect to $y$, $x$ remains.) Therefore we obtain
$$ \dd z = y\,\dd x+x\,\dd y $$(verified with SymPy). Since $z=xy$ is a polynomial (and hence totally differentiable), this $\dd z$ may be used as “the first-order (linear) approximation to the change in $z$ when $x,y$ are moved by the small amounts $\dd x,\dd y$, respectively” without error—more precisely, to an accuracy at which the error $\varepsilon$ converges to $0$ strictly faster than the distance moved.
Exercise 6.4: Extrema of $f(x,y)=x^3-3xy^2$ (the case $D=0$)
Solution
First we find the points where $\nabla f=\bm0$.
$$ f_x = 3x^2-3y^2\ ,\qquad f_y = -6xy $$From $f_y=0$, we have $x=0$ or $y=0$.
When $x=0$, $f_x=-3y^2=0$ gives $y=0$.
When $y=0$, $f_x=3x^2=0$ gives $x=0$.
Therefore the only critical point is $(x,y)=(0,0)$. Computing the second-order partial derivatives, we get
$$ f_{xx}=6x\ ,\qquad f_{xy}=-6y\ ,\qquad f_{yy}=-6x $$Evaluating all of these at the point $(0,0)$, we get $A=f_{xx}(0,0)=0$, $B=f_{xy}(0,0)=0$, $C=f_{yy}(0,0)=0$, so we obtain
$$ D = B^2-AC = 0^2-0\times0 = 0 $$As stated in the Caution following Theorem 6.3, when $D=0$ this test alone cannot decide the matter. So we examine the values of $f$ directly near the origin. Moving along $y=0$, we have
$$ f(x,0) = x^3-3x\cdot0^2 = x^3 $$Now $x^3$ is positive for $x>0$ and negative for $x\lt0$, so its sign changes even in the immediate vicinity of $x=0$ (for example, for $x=0.01$ we have $f=10^{-6}>0=f(0,0)$, and for $x=-0.01$ we have $f=-10^{-6}\lt0=f(0,0)$). Therefore, arbitrarily close to the origin there exist both points where $f$ is greater than $f(0,0)=0$ and points where it is smaller, and $(0,0)$ is neither a local maximum nor a local minimum (verified with SymPy: confirmed that the origin is the only critical point, that $A=B=C=0$ (and hence $D=0$), and that $f(x,0)=x^3$ changes sign). Incidentally, $f(x,y)=x^3-3xy^2$ is the real part of the cube $z^3=x^3-3xy^2+i(3x^2y-y^3)$ of the complex number $z=x+iy$; it is a representative example of the surface called the “monkey saddle,” in which three valleys and three ridges gather alternately around the origin, and it is known as a typical example in which $D=0$.
Exercise 6.5: $\pdiff{z}{\theta}$ in polar coordinates
Solution
Let $z=f(x,y)$, $x=r\cos\theta$, $y=r\sin\theta$. Using Formula 6.4 (the partial derivative formula for composite functions, with $v\to\theta$), we have
$$ \pdiff{z}{\theta} = \pdiff{f}{x}\pdiff{x}{\theta}+\pdiff{f}{y}\pdiff{y}{\theta} $$Here, differentiating $x=r\cos\theta$ partially with respect to $\theta$ (regarding $r$ as a constant) gives $\pdiff{x}{\theta}=-r\sin\theta$, and differentiating $y=r\sin\theta$ in the same way gives $\pdiff{y}{\theta}=r\cos\theta$. Substituting, we obtain
$$ \pdiff{z}{\theta} = f_x\cdot(-r\sin\theta)+f_y\cdot(r\cos\theta) = -r\sin\theta\cdot f_x+r\cos\theta\cdot f_y $$This is exactly the same expression as the one we obtained when we derived $f_\theta$ in Section 6.5 (this agreement is only natural, since $z$ and $f$ refer to the same function), and it is precisely the expression that we used as the starting point of the proof of Formula 6.5.
Exercise 6.6: The method of Lagrange multipliers: extrema of $xy$ subject to $x^2+y^2=1$
Solution
Let $g(x,y)=x^2+y^2-1$. Since $f_x=y,\,f_y=x$ and $g_x=2x,\,g_y=2y$, the system of equations in Theorem 6.4 becomes
$$ y-2\lambda x=0\ ,\qquad x-2\lambda y=0\ ,\qquad x^2+y^2=1 $$that is, $y=2\lambda x$ …① and $x=2\lambda y$ …②. Substituting ① into ②, we get
$$ x = 2\lambda(2\lambda x) = 4\lambda^2x \quad\Longrightarrow\quad x(1-4\lambda^2)=0 $$The case $x=0$. From the constraint $x^2+y^2=1$, we get $y=\pm1$. But from ①, $y=2\lambda x=2\lambda\times0=0$, which contradicts $y=\pm1$. Therefore $x=0$ cannot give a solution.
The case $1-4\lambda^2=0$, that is, $\lambda=\pm\dfrac12$.
When $\lambda=\dfrac12$, ① gives $y=2\times\dfrac12\times x=x$. Substituting into the constraint, we get $x^2+x^2=1$, $x^2=\dfrac12$, $x=\pm\dfrac{1}{\sqrt2}$. Since $y=x$, we obtain the two points $\left(\dfrac{1}{\sqrt2},\dfrac{1}{\sqrt2}\right)$ and $\left(-\dfrac{1}{\sqrt2},-\dfrac{1}{\sqrt2}\right)$. At these points,
$$ f = xy = \left(\pm\frac{1}{\sqrt2}\right)^2 = \frac12 $$When $\lambda=-\dfrac12$, ① gives $y=2\times\left(-\dfrac12\right)\times x=-x$. Substituting into the constraint, we similarly get $x=\pm\dfrac{1}{\sqrt2}$, and since $y=-x$, we obtain the two points $\left(\dfrac{1}{\sqrt2},-\dfrac{1}{\sqrt2}\right)$ and $\left(-\dfrac{1}{\sqrt2},\dfrac{1}{\sqrt2}\right)$. At these points,
$$ f = xy = -\left(\frac{1}{\sqrt2}\right)^2 = -\frac12 $$The unit circle is a figure (the circle itself) that is connected without any break and lies within a finite range, and $f=xy$ is continuous on it. Hence the values of $xy$ as the point moves over the unit circle must include a largest value and a smallest value (this basic property of continuous functions is, to be precise, the statement “a continuous function on a bounded closed set has a maximum and a minimum,” known as the Weierstrass extreme value theorem—for details, see a textbook on analysis), and each of them is attained at one of the four candidates found above. Therefore,
$$ \text{maximum value}=\frac12\ \left(\text{at the points }\left(\tfrac{1}{\sqrt2},\tfrac{1}{\sqrt2}\right),\left(-\tfrac{1}{\sqrt2},-\tfrac{1}{\sqrt2}\right)\right)\ ,\qquad \text{minimum value}=-\frac12\ \left(\text{at the points }\left(\tfrac{1}{\sqrt2},-\tfrac{1}{\sqrt2}\right),\left(-\tfrac{1}{\sqrt2},\tfrac{1}{\sqrt2}\right)\right) $$(verified with SymPy: confirmed the four solutions of the system of equations and that the value of $f=xy$ at each of them is $\pm\frac12$). Geometrically, the four points at which the contour lines of $f=xy$ (the hyperbolas $xy=c$) touch the unit circle are exactly these points.
← Back to Chapter 6, “Partial Derivatives (Differentiation of Multivariable Functions)”
Chapter 7 Multiple Integrals (Integration of Multivariable Functions)
Exercise 7.1: Multiple integral over a triangular region
Solution
The region $D=\{0\le y\le x\le1\}$ has the form of Formula 7.1 (I) (with $g_1(x)=0,\,g_2(x)=x$), so we integrate with respect to $y$ first.
$$ \iint_D(x+y)\,dxdy=\int_0^1\left\{\int_0^x(x+y)\,dy\right\}dx $$The inner integral (integrating with respect to $y$, treating $x$ as a constant) is
$$ \int_0^x(x+y)\,dy=\Big[xy+\frac{y^2}{2}\Big]_0^x=x\cdot x+\frac{x^2}{2}=x^2+\frac{x^2}{2}=\frac{3}{2}x^2 $$Therefore, we obtain
$$ \iint_D(x+y)\,dxdy=\int_0^1\frac{3}{2}x^2\,dx=\frac32\Big[\frac{x^3}{3}\Big]_0^1=\frac32\times\frac13=\frac12 $$(verified with SymPy: $1/2$).
Exercise 7.2: Change to polar coordinates: a multiple integral over an annular region
Solution
Using polar coordinates $x=r\cos\theta,\,y=r\sin\theta$ (the Jacobian is $|J|=r$, as derived in Example 7.8), the annulus $1\le x^2+y^2\le4$ corresponds to $1\le r\le2$, $0\le\theta\lt2\pi$ (there is no restriction on the angle: this is the whole annulus). Also, $\sqrt{x^2+y^2}=\sqrt{r^2}=r$ ($r\ge0$). Therefore,
$$ \iint_D\sqrt{x^2+y^2}\,dxdy=\int_0^{2\pi}\int_1^2 r\cdot r\,drd\theta=\int_0^{2\pi}\int_1^2 r^2\,dr\,d\theta $$Since the integrand is a function of $r$ alone, the integral can be split into a product of two single-variable integrals.
$$ =\left(\int_1^2r^2\,dr\right)\left(\int_0^{2\pi}d\theta\right)=\Big[\frac{r^3}{3}\Big]_1^2\times2\pi=\left(\frac{8}{3}-\frac13\right)\times2\pi=\frac73\times2\pi=\frac{14\pi}{3} $$This gives the value of the integral (verified with SymPy: $14\pi/3\approx14.66$).
Exercise 7.3: Computing a Jacobian
Solution
Taking the partial derivatives of $u=2x-y,\ v=x+y$ with respect to $x,y$, we get
$$ J_2=\pdiff{(u,v)}{(x,y)}=\begin{pmatrix}\pdiff ux&\pdiff uy\\[2mm]\pdiff vx&\pdiff vy\end{pmatrix}=\begin{pmatrix}2&-1\\1&1\end{pmatrix} $$(Differentiating $u=2x-y$ partially with respect to $x$ gives $2$, and partially with respect to $y$ gives $-1$. Differentiating $v=x+y$ partially with respect to $x,y$ gives $1,1$, respectively.) The determinant is
$$ \det J_2=2\times1-(-1)\times1=2+1=3 $$By the Caution in Section 7.3 (the relation to the Jacobian of the inverse transformation, $\det J_1\cdot\det J_2=1$), the Jacobian $J_1=\pdiff{(x,y)}{(u,v)}$ obtained by expressing $x,y$ in terms of $u,v$ satisfies
$$ |\det J_1|=\frac{1}{|\det J_2|}=\frac13 $$Therefore, the area element is expressed as
$$ dxdy=\frac13\,dudv $$(Check: if we actually solve $u=2x-y,v=x+y$ for $x,y$, we get $x=\dfrac{u+v}{3},\,y=\dfrac{2v-u}{3}$. Partially differentiating these directly with respect to $u,v$ and computing the determinant of the Jacobian matrix $J_1=\begin{pmatrix}1/3&1/3\\-1/3&2/3\end{pmatrix}$, we find $\det J_1=\frac13\times\frac23-\frac13\times\left(-\frac13\right)=\frac29+\frac19=\frac13$, so $|\det J_1|=1/3$, in agreement. Verified with SymPy.)
Exercise 7.4: Volume of a cylinder
Solution
The volume of the cylinder is obtained by integrating the constant height $h$ over the base $D=\{(x,y)\mid x^2+y^2\le a^2\}$.
$$ V=\iint_D h\,dxdy=h\iint_D dxdy $$($h$ is a constant that does not depend on $x,y$, so it can be taken outside the integral.) Since $\displaystyle\iint_D dxdy$ is simply the area of the region $D$, using polar coordinates $x=r\cos\theta,y=r\sin\theta$ ($dxdy=rdrd\theta$, and $D$ is given by $0\le r\le a$, $0\le\theta\lt2\pi$), we have
$$ \iint_D dxdy=\int_0^{2\pi}\int_0^a r\,drd\theta=\left(\int_0^a r\,dr\right)\left(\int_0^{2\pi}d\theta\right)=\Big[\frac{r^2}{2}\Big]_0^a\times2\pi=\frac{a^2}{2}\times2\pi=\pi a^2 $$(This is exactly the formula for the area of a circle of radius $a$, so we have in effect rederived a result of high school mathematics by means of a multiple integral.) Therefore, we obtain
$$ V=h\times\pi a^2=\pi a^2h $$(This agrees with the high school mathematics formula “volume of a cylinder = base area × height.” Verified with SymPy.)
Exercise 7.5: Volume of a tetrahedron (triple integral)
Solution
We compute in the same order as Method 1 of Example 7.11 ($z\to y\to x$). From the conditions $x,y,z\ge0,\,x+2y+z\le2$, the range of $z$ for fixed $x,y$ is
$$ 0\le z\le2-x-2y $$Integrating first with respect to $z$ (the integrand is $1$, so we are simply integrating the height), we obtain
$$ V=\iiint_V dxdydz=\iint_D(2-x-2y)\,dxdy,\qquad D=\{(x,y)\mid x,y\ge0,\,x+2y\le2\} $$Next, over $D=\{0\le x\le2,\,0\le y\le(2-x)/2\}$, we integrate with respect to $y$ first.
$$ V=\int_0^2\left\{\int_0^{(2-x)/2}(2-x-2y)\,dy\right\}dx $$The inner integral is easier to follow if we let $a=2-x$ (since $x$ is fixed, $a$ is also a constant).
$$ \int_0^{a/2}(a-2y)\,dy=\Big[ay-y^2\Big]_0^{a/2}=a\cdot\frac a2-\left(\frac a2\right)^2=\frac{a^2}{2}-\frac{a^2}{4}=\frac{a^2}{4} $$Therefore, we need only compute
$$ V=\int_0^2\frac{(2-x)^2}{4}\,dx $$Using the substitution $t=2-x$ ($dt=-dx$; when $x:0\to2$, $t:2\to0$), we obtain
$$ V=\int_2^0\frac{t^2}{4}\,(-dt)=\int_0^2\frac{t^2}{4}\,dt=\frac14\Big[\frac{t^3}{3}\Big]_0^2=\frac14\times\frac83=\frac23 $$(Alternative solution: this tetrahedron is a triangular pyramid that meets the $x$-axis, the $y$-axis, and the $z$-axis at $(2,0,0),(0,1,0),(0,0,2)$, respectively. The formula $V=\frac16|2\times1\times2|=\frac46=\frac23$, which corresponds to the high school mathematics formula “volume of a triangular pyramid $=\frac16\times$ (product of the three edges),” also gives the same value, which serves as a check.) Verified with SymPy: $2/3$.
Exercise 7.6: An application of the Gaussian integral
Solution
Using the substitution $t=\sqrt2\,x$ ($x=t/\sqrt2$, $dx=dt/\sqrt2$), the exponent becomes $-2x^2=-2\left(\dfrac{t}{\sqrt2}\right)^2=-2\cdot\dfrac{t^2}{2}=-t^2$. As for the interval of integration, when $x\to\pm\infty$ we have $t=\sqrt2x\to\pm\infty$, so it is still from $-\infty$ to $\infty$. Therefore,
$$ \int_{-\infty}^{\infty}e^{-2x^2}\,dx=\int_{-\infty}^{\infty}e^{-t^2}\cdot\frac{dt}{\sqrt2}=\frac{1}{\sqrt2}\int_{-\infty}^{\infty}e^{-t^2}\,dt $$Substituting $\displaystyle\int_{-\infty}^{\infty}e^{-t^2}dt=\sqrt\pi$ (Theorem 7.1, the Gaussian integral, already proved in Example 7.8), we obtain
$$ \int_{-\infty}^{\infty}e^{-2x^2}\,dx=\frac{\sqrt\pi}{\sqrt2}=\sqrt{\frac{\pi}{2}} $$(verified with SymPy: $\sqrt{\pi/2}\approx1.2533$; in general, the formula $\displaystyle\int_{-\infty}^{\infty}e^{-ax^2}dx=\sqrt{\pi/a}$ ($a\gt0$) is obtained by the same substitution $t=\sqrt a\,x$).
← Back to Chapter 7, “Multiple Integrals (Integration of Multivariable Functions)”
Chapter 8 Matrices and Determinants
Exercise 8.1: Properties of the transpose
Solution
For $A=\begin{bmatrix}1&-2&3\\0&4&-1\end{bmatrix}$ and $B=\begin{bmatrix}2&1&0\\-3&2&5\end{bmatrix}$, we first compute the sum according to Definition 8.2.
$$ A+B=\begin{bmatrix}1+2&-2+1&3+0\\0+(-3)&4+2&-1+5\end{bmatrix}=\begin{bmatrix}3&-1&3\\-3&6&4\end{bmatrix} $$Transposing this (Definition 8.4: interchange rows and columns), we get
$$ {}^{t}(A+B)=\begin{bmatrix}3&-3\\-1&6\\3&4\end{bmatrix} $$On the other hand, transposing $A,B$ separately gives $ {}^{t}A=\begin{bmatrix}1&0\\-2&4\\3&-1\end{bmatrix}$ and ${}^{t}B=\begin{bmatrix}2&-3\\1&2\\0&5\end{bmatrix}$, and their sum is
$$ {}^{t}A+{}^{t}B=\begin{bmatrix}1+2&0+(-3)\\-2+1&4+2\\3+0&-1+5\end{bmatrix}=\begin{bmatrix}3&-3\\-1&6\\3&4\end{bmatrix} $$so indeed ${}^{t}(A+B)={}^{t}A+{}^{t}B$ holds. (Verified with SymPy.)
We also prove it for general matrices $A=(a_{ij})$ and $B=(b_{ij})$ of type $(m,n)$. The $(i,j)$ entry of $A+B$ (Definition 8.2) is $a_{ij}+b_{ij}$, so the $(j,i)$ entry of ${}^{t}(A+B)$ is, by the definition of the transpose (Definition 8.4: interchange rows and columns), the same $a_{ij}+b_{ij}$. On the other hand, the $(j,i)$ entry of ${}^{t}A$ is $a_{ij}$ and the $(j,i)$ entry of ${}^{t}B$ is $b_{ij}$, so the $(j,i)$ entry of ${}^{t}A+{}^{t}B$ (by Definition 8.2, the sum of the entries in the same positions) is also $a_{ij}+b_{ij}$. Since all the $(j,i)$ entries of the two sides agree, ${}^{t}(A+B)={}^{t}A+{}^{t}B$ holds in general. (This proof follows the same strategy of “comparing the entries one by one” that was used in the proof of Theorem 8.1(ii).)
Exercise 8.2: Conjecturing and proving a slightly more complicated power pattern
Solution
First we actually compute $M^2,M^3$ and conjecture the pattern.
$$ M^{2}=\begin{bmatrix}2&3\\0&2\end{bmatrix}\begin{bmatrix}2&3\\0&2\end{bmatrix}=\begin{bmatrix}4&6+6\\0&4\end{bmatrix}=\begin{bmatrix}4&12\\0&4\end{bmatrix} $$ $$ M^{3}=M^{2}M=\begin{bmatrix}4&12\\0&4\end{bmatrix}\begin{bmatrix}2&3\\0&2\end{bmatrix}=\begin{bmatrix}8&12+24\\0&8\end{bmatrix}=\begin{bmatrix}8&36\\0&8\end{bmatrix} $$The diagonal entries are $4=2^2,8=2^3$, powers of the diagonal entry $2$ of $M$. The off-diagonal entries are $12,36$, which can be written as $12=2\times2\times3$ and $36=3\times2^2\times3$, so we can conjecture that the off-diagonal entry of the $n$th power is $n\times2^{n-1}\times3$. That is,
$$ M^{n}\ \overset{?}{=}\ \begin{bmatrix}2^{n}&3n\cdot2^{n-1}\\0&2^{n}\end{bmatrix} $$This is the conjecture we make (indeed, for $n=2$ we get $3\times2\times2^1=12$ and for $n=3$ we get $3\times3\times2^2=36$, which agree). Following the hint, we split $M=2I+N$, $N=\begin{bmatrix}0&3\\0&0\end{bmatrix}$ ($I$ is the identity matrix) and prove it by mathematical induction. First, computing $N^2$, we get
$$ N^{2}=\begin{bmatrix}0&3\\0&0\end{bmatrix}\begin{bmatrix}0&3\\0&0\end{bmatrix}=\begin{bmatrix}0\cdot0+3\cdot0&0\cdot3+3\cdot0\\0\cdot0+0\cdot0&0\cdot3+0\cdot0\end{bmatrix}=\begin{bmatrix}0&0\\0&0\end{bmatrix}=O $$This is the zero matrix. For $n=1$, $M^1=M=\begin{bmatrix}2&3\\0&2\end{bmatrix}=\begin{bmatrix}2^1&3\times1\times2^0\\0&2^1\end{bmatrix}$, so the conjecture holds, as expected. Suppose that for $n=k$ we have $M^{k}=\begin{bmatrix}2^{k}&3k\cdot2^{k-1}\\0&2^{k}\end{bmatrix}=2^{k}I+3k\cdot2^{k-1}\cdot\dfrac{1}{3}N\ (=2^kI+k\cdot2^{k-1}N)$ (this is merely a rewriting as the sum of the diagonal matrix $2^kI=\begin{bmatrix}2^k&0\\0&2^k\end{bmatrix}$ and the constant multiple $k\cdot2^{k-1}N=\begin{bmatrix}0&3k\cdot2^{k-1}\\0&0\end{bmatrix}$ of $N$). Then
$$ M^{k+1}=M^{k}M=(2^{k}I+k\cdot2^{k-1}N)(2I+N) $$and we expand this product. Since $I$ is the identity matrix, $IA=AI=A$ (multiplying by it does not change any matrix $A$); also $NI=IN=N$; and using $N^2=O$, which we showed above, we obtain
$$ \begin{aligned} M^{k+1}&=2^{k}I\cdot2I+2^{k}I\cdot N+k\cdot2^{k-1}N\cdot2I+k\cdot2^{k-1}N\cdot N\\ &=2^{k+1}I+2^{k}N+k\cdot2^{k}N+k\cdot2^{k-1}N^{2}\\ &=2^{k+1}I+(2^{k}+k\cdot2^{k})N+k\cdot2^{k-1}\cdot O\\ &=2^{k+1}I+(k+1)2^{k}N \end{aligned} $$Writing this back in terms of entries, since $2^{k+1}I=\begin{bmatrix}2^{k+1}&0\\0&2^{k+1}\end{bmatrix}$ and $(k+1)2^{k}N=\begin{bmatrix}0&3(k+1)2^{k}\\0&0\end{bmatrix}$, we have
$$ M^{k+1}=\begin{bmatrix}2^{k+1}&3(k+1)\cdot2^{k}\\0&2^{k+1}\end{bmatrix} $$which is exactly the form of the conjecture for $n=k+1$. Hence, by mathematical induction, the following holds for all natural numbers $n$:
$$ M^{n}=\begin{bmatrix}2^{n}&3n\cdot2^{n-1}\\0&2^{n}\end{bmatrix} $$(For $n=2,\ldots,5$ we computed directly and verified with SymPy that the results agree with the conjecture. Incidentally, in general, for a matrix $N$ with $N^2=O$ (called a nilpotent matrix), the reason that $(2I+N)^n=2^nI+n\cdot2^{n-1}N$ holds is that in the binomial expansion $(2I+N)^n=\sum_{j=0}^n\binom{n}{j}(2I)^{n-j}N^j$, all the terms with $j\ge2$ vanish because $N^2=O$, and only the two terms $j=0,1$ remain.)
Exercise 8.3: Classifying the permutations for $n=4$ as even or odd
Solution
We classify all $24$ permutations by the parity of the number of inversions used in Example 8.3 (the number of pairs whose order of size is reversed). For each arrangement $(i_1,i_2,i_3,i_4)$ of the lower row we count the inversions; the permutation is even if this number is even and odd if it is odd. The results are as follows (the upper row is always $1,2,3,4$, so we write only the lower row).
Even permutations ($12$ of them; the number of inversions is one of $0,2,4,6$):
$(1,2,3,4)$ [number of inversions: $0$], $(1,3,4,2)$ [$2$], $(1,4,2,3)$ [$2$], $(2,1,4,3)$ [$2$], $(2,3,1,4)$ [$2$], $(2,4,3,1)$ [$4$], $(3,1,2,4)$ [$2$], $(3,2,4,1)$ [$4$], $(3,4,1,2)$ [$4$], $(4,1,3,2)$ [$4$], $(4,2,1,3)$ [$4$], $(4,3,2,1)$ [$6$]
Odd permutations ($12$ of them; the number of inversions is one of $1,3,5$):
$(1,2,4,3)$ [$1$], $(1,3,2,4)$ [$1$], $(1,4,3,2)$ [$3$], $(2,1,3,4)$ [$1$], $(2,3,4,1)$ [$3$], $(2,4,1,3)$ [$3$], $(3,1,4,2)$ [$3$], $(3,2,1,4)$ [$3$], $(3,4,2,1)$ [$5$], $(4,1,2,3)$ [$3$], $(4,2,3,1)$ [$5$], $(4,3,1,2)$ [$5$]
Therefore, of the $4!=24$ permutations for $n=4$, $12$ are even and $12$ are odd, so they split into exactly two halves. (In general, for $n\ge2$ it is known that there are always the same number, $n!/2$, of even permutations and of odd permutations. Outline of the reason: to each odd permutation, apply exactly one additional transposition of our choice (for example, swapping the first two numbers of the lower row); this gives an exact one-to-one correspondence with the even permutations.) (We generated all $24$ permutations in Python, classified each of them both by the parity of its number of inversions and with SymPy's `Permutation.is_even`, and verified that the two results agree.)
Exercise 8.4: Computing a determinant of order $4$ by cofactor expansion
Solution
Row 3 of $Q=\begin{bmatrix}3&0&1&2\\1&-1&0&4\\0&2&1&0\\2&1&-1&3\end{bmatrix}$, which is $(0,2,1,0)$, contains two entries equal to $0$, so, as the hint suggests, if we expand by cofactors along row 3 (the formula in Chapter 8, $i=3$), we need not compute the terms whose coefficient is $0$.
$$ |Q| = 0\cdot A_{31}+2\cdot A_{32}+1\cdot A_{33}+0\cdot A_{34} = 2A_{32}+A_{33} $$$A_{32}$ is the determinant of order $3$ obtained by removing row 3 and column 2 from $Q$, multiplied by $(-1)^{3+2}=-1$:
$$ A_{32}=(-1)^{3+2}\begin{vmatrix}3&1&2\\1&0&4\\2&-1&3\end{vmatrix}=-\begin{vmatrix}3&1&2\\1&0&4\\2&-1&3\end{vmatrix} $$Computing with Sarrus's rule (the formula in Chapter 8), we get $3\times0\times3+1\times4\times2+2\times1\times(-1)-2\times0\times2-1\times1\times3-3\times4\times(-1)=0+8-2-0-3+12=15$. Hence $A_{32}=-15$.
$A_{33}$ is the determinant of order $3$ obtained by removing row 3 and column 3 from $Q$, multiplied by $(-1)^{3+3}=1$:
$$ A_{33}=(-1)^{3+3}\begin{vmatrix}3&0&2\\1&-1&4\\2&1&3\end{vmatrix}=\begin{vmatrix}3&0&2\\1&-1&4\\2&1&3\end{vmatrix} $$By Sarrus's rule, $3\times(-1)\times3+0\times4\times2+2\times1\times1-2\times(-1)\times2-0\times1\times3-3\times4\times1=-9+0+2+4-0-12=-15$. Hence $A_{33}=-15$.
From the above, we obtain
$$ |Q| = 2\times(-15)+1\times(-15) = -30-15=-45 $$(We computed $\det$ directly with SymPy and verified that it gives the same $-45$.)
Exercise 8.5: Efficient computation of a determinant of order $4$ using the properties of rows
Solution
For $R=\begin{bmatrix}1&2&1&0\\2&4&0&1\\1&1&2&2\\0&1&1&3\end{bmatrix}$, first, as the hint suggests, perform $R_2\leftarrow R_2-2R_1$ and $R_3\leftarrow R_3-R_1$ (Theorem 8.3(iii): adding a constant multiple of another row does not change the determinant).
$$ \begin{vmatrix}1&2&1&0\\2&4&0&1\\1&1&2&2\\0&1&1&3\end{vmatrix} =\begin{vmatrix}1&2&1&0\\0&0&-2&1\\0&-1&1&2\\0&1&1&3\end{vmatrix} $$Now the $(2,2)$ entry of row 2 (row $2$, column 2) has become $0$, so we cannot continue sweeping out column 2 as it is. So we use Theorem 8.3(ii) (interchanging two rows reverses the sign) and interchange rows 2 and 3.
$$ \begin{vmatrix}1&2&1&0\\0&0&-2&1\\0&-1&1&2\\0&1&1&3\end{vmatrix} =-\begin{vmatrix}1&2&1&0\\0&-1&1&2\\0&0&-2&1\\0&1&1&3\end{vmatrix} $$(Note that the sign has become negative. From here on we compute the determinant on the right-hand side, and reverse the sign at the end.) Next, we make the entries of column 2 below row 2 equal to $0$: $R_4\leftarrow R_4+R_2$ (the $(2,2)$ entry of row 2 is $-1$, so we can simply add).
$$ \begin{vmatrix}1&2&1&0\\0&-1&1&2\\0&0&-2&1\\0&1&1&3\end{vmatrix} =\begin{vmatrix}1&2&1&0\\0&-1&1&2\\0&0&-2&1\\0&0&2&5\end{vmatrix} $$Finally, we make the entries of column 3 below row 3 equal to $0$: $R_4\leftarrow R_4+R_3$.
$$ \begin{vmatrix}1&2&1&0\\0&-1&1&2\\0&0&-2&1\\0&0&2&5\end{vmatrix} =\begin{vmatrix}1&2&1&0\\0&-1&1&2\\0&0&-2&1\\0&0&0&6\end{vmatrix} $$Up to this point (apart from the single row interchange) we have used only property (iii). The last determinant is that of an upper triangular matrix, so it equals the product of the diagonal entries, $1\times(-1)\times(-2)\times6=12$. Since we interchanged rows once, reversing the sign gives
$$ |R| = -12 $$(We computed $\det$ directly with SymPy and verified that it gives the same $-12$. Incidentally, if we try $R_4\leftarrow R_4+R_2$ first without interchanging rows, the $(2,2)$ entry of row 2 remains $0$, so we cannot divide by it; this is an example of the general point that in Gaussian elimination (the “sweep-out” method), row interchanges are often needed in order to secure a nonzero leading entry (pivot).)
Exercise 8.6: Testing linear dependence and the geometric meaning of the determinant
Solution
We compute the determinant whose columns are $\vec p=(1,1,2)$, $\vec q=(2,-1,1)$, $\vec r=(0,3,3)$.
$$ \begin{vmatrix}1&2&0\\1&-1&3\\2&1&3\end{vmatrix} =1\times\{(-1)\times3-3\times1\}-2\times(1\times3-3\times2)+0\times\{1\times1-(-1)\times2\} $$ $$ =1\times(-3-3)-2\times(3-6)+0=-6-(-6)=0 $$By Theorem 8.5, since $|{\,}|=0$, the vectors $\vec p,\vec q,\vec r$ are linearly dependent. If they are linearly dependent, $\vec r$ should be expressible as a sum of real multiples of $\vec p,\vec q$, so we find real numbers $a,b$ satisfying $\vec r=a\vec p+b\vec q$. Writing an equation for each component, we get
$$ \begin{cases} a+2b=0\\ a-b=3\\ 2a+b=3 \end{cases} $$From the first equation, $a=-2b$. Substituting this into the second equation gives $-2b-b=3$, that is, $-3b=3$, so $b=-1$, and hence $a=2$. Checking with the third equation, $2\times2+(-1)=3$, which indeed holds. Therefore,
$$ \vec r=2\vec p-\vec q $$(indeed, $2(1,1,2)-(2,-1,1)=(2-2,\,2+1,\,4-1)=(0,3,3)=\vec r$, which agrees). Relating this to the meaning of Theorem 8.5 (volume): since $\vec r$ already lies inside the plane spanned by $\vec p,\vec q$ (the plane containing $\vec p,\vec q$), the three vectors do not extend in three independent directions, and the height of the “parallelepiped” formed by $\vec p,\vec q,\vec r$ collapses to $0$. This is exactly the same phenomenon as in the example of $\vec f,\vec g,\vec h$ ($\vec h=\frac35\vec f+\frac15\vec g$) in Section 8.6.2, and the volume is $0$. (Both the value of the determinant and the relation $\vec r=2\vec p-\vec q$ were verified with SymPy.)
← Back to Chapter 8, “Matrices and Determinants”
Chapter 9 Systems of Linear Equations
Exercise 9.1: Finding the inverse matrix using the adjugate matrix
Solution
We compute the nine cofactors of $A=\begin{bmatrix}3&1&-1\\1&2&0\\0&1&1\end{bmatrix}$ by the same procedure as in Example 9.1.
$$ \begin{aligned} A_{11}&=+\begin{vmatrix}2&0\\1&1\end{vmatrix}=2\cdot1-0\cdot1=2, & A_{12}&=-\begin{vmatrix}1&0\\0&1\end{vmatrix}=-(1\cdot1-0\cdot0)=-1, \\ A_{13}&=+\begin{vmatrix}1&2\\0&1\end{vmatrix}=1\cdot1-2\cdot0=1, & A_{21}&=-\begin{vmatrix}1&-1\\1&1\end{vmatrix}=-(1\cdot1-(-1)\cdot1)=-2, \\ A_{22}&=+\begin{vmatrix}3&-1\\0&1\end{vmatrix}=3\cdot1-(-1)\cdot0=3, & A_{23}&=-\begin{vmatrix}3&1\\0&1\end{vmatrix}=-(3\cdot1-1\cdot0)=-3, \\ A_{31}&=+\begin{vmatrix}1&-1\\2&0\end{vmatrix}=1\cdot0-(-1)\cdot2=2, & A_{32}&=-\begin{vmatrix}3&-1\\1&0\end{vmatrix}=-(3\cdot0-(-1)\cdot1)=-1, \\ A_{33}&=+\begin{vmatrix}3&1\\1&2\end{vmatrix}=3\cdot2-1\cdot1=5. && \end{aligned} $$We transpose the matrix of cofactors $\begin{bmatrix}2&-1&1\\-2&3&-3\\2&-1&5\end{bmatrix}$ to obtain the adjugate matrix
$$ \tilde A=\begin{bmatrix}2&-2&2\\-1&3&-1\\1&-3&5\end{bmatrix} $$Expanding $|A|$ along the first row by cofactors, we get $|A|=3\cdot2+1\cdot(-1)+(-1)\cdot1=6-1-1=4$. Since $|A|\neq0$, $A$ is invertible, and by Formula 9.1 its inverse is
$$ A^{-1}=\frac14\begin{bmatrix}2&-2&2\\-1&3&-1\\1&-3&5\end{bmatrix} =\begin{bmatrix}\dfrac12&-\dfrac12&\dfrac12\\[4pt]-\dfrac14&\dfrac34&-\dfrac14\\[4pt]\dfrac14&-\dfrac34&\dfrac54\end{bmatrix} $$(verified with SymPy: $A\cdot A^{-1}=E$).
Exercise 9.2: Degrees of freedom and solutions of a homogeneous system of linear equations in four unknowns
Solution
The coefficient matrix is $A=\begin{bmatrix}1&1&-1&2\\2&1&1&1\\1&-1&5&-5\\3&2&0&3\end{bmatrix}$, and there are $n=4$ unknowns. We sweep out the first column: $R_2\to R_2-2R_1$ ($2-2=0,1-2=-1,1-(-2)=3,1-4=-3$), $R_3\to R_3-R_1$ ($1-1=0,-1-1=-2,5-(-1)=6,-5-2=-7$), $R_4\to R_4-3R_1$ ($3-3=0,2-3=-1,0-(-3)=3,3-6=-3$).
$$ \begin{bmatrix}1&1&-1&2\\2&1&1&1\\1&-1&5&-5\\3&2&0&3\end{bmatrix} \to \begin{bmatrix}1&1&-1&2\\0&-1&3&-3\\0&-2&6&-7\\0&-1&3&-3\end{bmatrix} $$We sweep out the second column: $R_3\to R_3-2R_2$ ($-2-2(-1)=0,6-2\cdot3=0,-7-2(-3)=-1$), $R_4\to R_4-R_2$ ($-1-(-1)=0,3-3=0,-3-(-3)=0$).
$$ \begin{bmatrix}1&1&-1&2\\0&-1&3&-3\\0&-2&6&-7\\0&-1&3&-3\end{bmatrix} \to \begin{bmatrix}1&1&-1&2\\0&-1&3&-3\\0&0&0&-1\\0&0&0&0\end{bmatrix} $$There are three nonzero rows, so $\rank A=3$; the degrees of freedom $=4-3=1$. The pivots lie in column 1 (row 1), column 2 (row 2), and column 4 (row 3), and the variable $x_3$, which corresponds to column 3, is the free variable. Rewriting the equations from the row echelon matrix, we obtain
$$ \begin{cases} x_1+x_2-x_3+2x_4=0\\ -x_2+3x_3-3x_4=0\\ -x_4=0 \end{cases} $$From the third equation, $x_4=0$. Letting $x_3=t$ ($t\in\R$), the second equation gives $-x_2+3t-0=0$, that is, $x_2=3t$. Substituting into the first equation gives $x_1+3t-t+0=0$, so $x_1=-2t$. Hence the solutions are given by
$$ \begin{cases}x_1=-2t\\x_2=3t\\x_3=t\\x_4=0\end{cases}\qquad(t\in\R) $$These are all the solutions (verified with SymPy: substituting $(-2,3,1,0)$, the case $t=1$, into all four equations gives $0$ identically).
Exercise 9.3: Condition for the existence of solutions of a nonhomogeneous system containing a parameter
Solution
The augmented matrix is $\left[\begin{array}{ccc|c}1&2&-1&2\\2&-1&3&9\\4&3&1&k\end{array}\right]$. We perform the same elementary row operations as in Example 9.6 ($R_2\to R_2-2R_1$, $R_3\to R_3-4R_1$).
$$ \left[\begin{array}{ccc|c}1&2&-1&2\\2&-1&3&9\\4&3&1&k\end{array}\right] \to \left[\begin{array}{ccc|c}1&2&-1&2\\0&-5&5&5\\0&-5&5&k-8\end{array}\right] $$(The rightmost entry of row 3: $k-4\cdot2=k-8$.) Next, applying $R_3\to R_3-R_2$ ($-5-(-5)=0,5-5=0,(k-8)-5=k-13$), we obtain
$$ \left[\begin{array}{ccc|c}1&2&-1&2\\0&-5&5&5\\0&-5&5&k-8\end{array}\right] \to \left[\begin{array}{ccc|c}1&2&-1&2\\0&-5&5&5\\0&0&0&k-13\end{array}\right] $$The rank of the coefficient part $A'=\begin{bmatrix}1&2&-1\\0&-5&5\\0&0&0\end{bmatrix}$ is always $\rank A'=2$ (independent of $k$). On the other hand, the rank $\rank A_0'$ of the augmented matrix depends on whether the rightmost entry $k-13$ of row 3 is $0$.
When $k=13$: All entries of row 3 become $0$ and $\rank A_0'=2=\rank A'$, so a solution exists. The degrees of freedom $=3-2=1$. Dividing row 2 by $-5$ and then applying $R_1\to R_1-2R_2$ (using the new row 2, $[0,1,-1,-1]$), row 1 becomes $[1,0,-1+2,2+2]=[1,0,1,4]$, and the row echelon matrix is $\begin{bmatrix}1&0&1&4\\0&1&-1&-1\\0&0&0&0\end{bmatrix}$. Letting the free variable be $x_3=t$, we get $x_2=-1+t$ (from row 2, $x_2-x_3=-1$) and $x_1=4-t$ (from row 1, $x_1+x_3=4$). Hence the solutions are given by
$$ \begin{cases}x_1=4-t\\x_2=-1+t\\x_3=t\end{cases}\qquad(t\in\R) $$These are all the solutions.
When $k\neq13$: Row 3 becomes $[0,0,0\mid k-13]$ ($k-13\neq0$), which is a contradictory equation $0\cdot x_1+0\cdot x_2+0\cdot x_3=k-13\neq0$. Since $\rank A'=2 \lt \rank A_0'=3$, by Theorem 9.3(iii) there is no solution.
In summary, this system of linear equations has a solution only when $k=13$ (verified with SymPy by computing the ranks for $k=13,0,5,-7$: only for $k=13$ do we have $\rank A'=\rank A_0'=2$).
Exercise 9.4: Solving a system of linear equations in four unknowns by Gaussian elimination
Solution
The augmented matrix is $\left[\begin{array}{cccc|c}1&1&0&1&6\\2&1&1&0&3\\0&1&2&1&3\\1&0&1&2&6\end{array}\right]$. We sweep out the first column: $R_2\to R_2-2R_1$ ($2-2=0,1-2=-1,1-0=1,0-2=-2,3-12=-9$), $R_4\to R_4-R_1$ ($1-1=0,0-1=-1,1-0=1,2-1=1,6-6=0$).
$$ \left[\begin{array}{cccc|c}1&1&0&1&6\\2&1&1&0&3\\0&1&2&1&3\\1&0&1&2&6\end{array}\right] \to \left[\begin{array}{cccc|c}1&1&0&1&6\\0&-1&1&-2&-9\\0&1&2&1&3\\0&-1&1&1&0\end{array}\right] $$We sweep out the second column: $R_3\to R_3+R_2$ ($1-1=0,2+1=3,1-2=-1,3-9=-6$), $R_4\to R_4-R_2$ ($-1-(-1)=0,1-1=0,1-(-2)=3,0-(-9)=9$).
$$ \left[\begin{array}{cccc|c}1&1&0&1&6\\0&-1&1&-2&-9\\0&1&2&1&3\\0&-1&1&1&0\end{array}\right] \to \left[\begin{array}{cccc|c}1&1&0&1&6\\0&-1&1&-2&-9\\0&0&3&-1&-6\\0&0&0&3&9\end{array}\right] $$At this point the matrix is a row echelon matrix ($\rank A'=\rank A_0'=4=n$, degrees of freedom $0$), so it only remains to solve by substituting from the bottom up (we could also continue the sweeping out all the way to the identity matrix, but here we use substitution). From row 4, $3x_4=9$, that is, $x_4=3$. Substituting this into row 3, $3x_3-x_4=-6$, gives $3x_3-3=-6$, so $3x_3=-3$ and $x_3=-1$. Substituting these into row 2, $-x_2+x_3-2x_4=-9$, gives $-x_2+(-1)-6=-9$, so $-x_2-7=-9$, $-x_2=-2$, and $x_2=2$. Finally, substituting into row 1, $x_1+x_2+x_4=6$ (the coefficient of $x_3$ is $0$), gives $x_1+2+3=6$, so $x_1=1$. Therefore the solution is
$$ x_1=1,\quad x_2=2,\quad x_3=-1,\quad x_4=3 $$(verified with SymPy: substituting the solution into $A\bm x=\bm b$, all four equations hold).
Exercise 9.5: Finding the normal form
Solution
Let $A=\begin{bmatrix}1&2&0&-1\\2&4&1&1\\3&6&1&0\end{bmatrix}$. We reduce it to a row echelon matrix by elementary row operations: $R_2\to R_2-2R_1$ ($2-2=0,4-4=0,1-0=1,1+2=3$), $R_3\to R_3-3R_1$ ($3-3=0,6-6=0,1-0=1,0+3=3$).
$$ \begin{bmatrix}1&2&0&-1\\2&4&1&1\\3&6&1&0\end{bmatrix} \to \begin{bmatrix}1&2&0&-1\\0&0&1&3\\0&0&1&3\end{bmatrix} $$Applying $R_3\to R_3-R_2$ ($1-1=0,3-3=0$), we obtain
$$ \begin{bmatrix}1&2&0&-1\\0&0&1&3\\0&0&1&3\end{bmatrix} \xrightarrow{R_3\to R_3-R_2} \begin{bmatrix}1&2&0&-1\\0&0&1&3\\0&0&0&0\end{bmatrix} $$There are two nonzero rows, so $\rank A=2$. The pivot of row 1 is in column 1, and that of row 2 is in column 3. We use elementary column operations to move the pivots to the left. First, we swap columns 2 and 3 ($C_2\leftrightarrow C_3$).
$$ \begin{bmatrix}1&2&0&-1\\0&0&1&3\\0&0&0&0\end{bmatrix} \xrightarrow{C_2\leftrightarrow C_3} \begin{bmatrix}1&0&2&-1\\0&1&0&3\\0&0&0&0\end{bmatrix} $$We eliminate the remaining nonzero entries: $C_3\to C_3-2C_1$ (row 1: $2-2=0$; the other rows stay $0$) and $C_4\to C_4+C_1$ (row 1: $-1+1=0$; row 2 stays $3+0=3$).
$$ \begin{bmatrix}1&0&2&-1\\0&1&0&3\\0&0&0&0\end{bmatrix} \xrightarrow[C_4\to C_4+C_1]{C_3\to C_3-2C_1} \begin{bmatrix}1&0&0&0\\0&1&0&3\\0&0&0&0\end{bmatrix} $$Finally, applying $C_4\to C_4-3C_2$ (row 1: $0-0=0$; row 2: $3-3=0$), we obtain
$$ \begin{bmatrix}1&0&0&0\\0&1&0&3\\0&0&0&0\end{bmatrix} \xrightarrow{C_4\to C_4-3C_2} \begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&0\end{bmatrix} $$This is the normal form, and the $2\times2$ ($=\rank A$) identity matrix $I_2$ appears in the upper left (verified with SymPy: $\mathrm{rref}$ also shows that $\rank A=2$).
Exercise 9.6: Testing invertibility by the rank and, if the matrix is invertible, finding its inverse
Solution
Let $A=\begin{bmatrix}1&2&1\\0&1&3\\2&3&4\end{bmatrix}$. We apply elementary row operations: $R_3\to R_3-2R_1$ ($2-2=0,3-4=-1,4-2=2$).
$$ \begin{bmatrix}1&2&1\\0&1&3\\2&3&4\end{bmatrix} \to \begin{bmatrix}1&2&1\\0&1&3\\0&-1&2\end{bmatrix} $$Applying $R_3\to R_3+R_2$ ($-1+1=0,2+3=5$), we obtain
$$ \begin{bmatrix}1&2&1\\0&1&3\\0&-1&2\end{bmatrix} \xrightarrow{R_3\to R_3+R_2} \begin{bmatrix}1&2&1\\0&1&3\\0&0&5\end{bmatrix} $$There are three nonzero rows ($=n$), so $\rank A=3$. By Theorem 9.5, $A$ is invertible. We find the inverse matrix by Gaussian elimination (Theorem 9.4). Applying the same elementary row operations ($R_3\to R_3-2R_1$, $R_3\to R_3+R_2$) to $[\,A\mid E\,]$, we obtain
$$ \left[\begin{array}{ccc|ccc}1&2&1&1&0&0\\0&1&3&0&1&0\\2&3&4&0&0&1\end{array}\right] \to \left[\begin{array}{ccc|ccc}1&2&1&1&0&0\\0&1&3&0&1&0\\0&0&5&-2&1&1\end{array}\right] $$(The identity-matrix part of row 3: $0-2\cdot1=-2$, $0-2\cdot0+1=1$ (added by $R_3\to R_3+R_2$), $1$. Concretely, $R_3\to R_3-2R_1$ gives $[0,-1,2,-2,0,1]$, and then $R_3\to R_3+R_2$ gives $[0,0,5,-2,1,1]$.) Dividing row 3 by $5$ gives $[0,0,1,-2/5,1/5,1/5]$. Using this row, we sweep out the rows above it: $R_2\to R_2-3R_3$ ($3-3=0,0-3(-2/5)=6/5,1-3/5=2/5,0-3/5=-3/5$), $R_1\to R_1-R_3$ ($1-1=0,1+2/5=7/5,0-1/5=-1/5,0-1/5=-1/5$).
$$ \left[\begin{array}{ccc|ccc}1&2&1&1&0&0\\0&1&3&0&1&0\\0&0&1&-\frac25&\frac15&\frac15\end{array}\right] \to \left[\begin{array}{ccc|ccc}1&2&0&\frac75&-\frac15&-\frac15\\0&1&0&\frac65&\frac25&-\frac35\\0&0&1&-\frac25&\frac15&\frac15\end{array}\right] $$Finally, applying $R_1\to R_1-2R_2$ ($\frac75-\frac{12}5=-\frac55=-1,-\frac15-\frac45=-1,-\frac15+\frac65=1$), we obtain
$$ \left[\begin{array}{ccc|ccc}1&0&0&-1&-1&1\\0&1&0&\frac65&\frac25&-\frac35\\0&0&1&-\frac25&\frac15&\frac15\end{array}\right] $$Therefore the inverse matrix is
$$ A^{-1}=\begin{bmatrix}-1&-1&1\\[2pt]\dfrac65&\dfrac25&-\dfrac35\\[6pt]-\dfrac25&\dfrac15&\dfrac15\end{bmatrix} $$(verified with SymPy: $A\cdot A^{-1}=E$).
← Back to Chapter 9, “Systems of Linear Equations”
Chapter 10 Vector Spaces (Linear Spaces)
Exercise 10.1: Determining linear independence
Solution
For $g_1=\begin{bmatrix}1\\2\\0\end{bmatrix},\ g_2=\begin{bmatrix}0\\1\\3\end{bmatrix},\ g_3=\begin{bmatrix}2\\0\\-1\end{bmatrix}$, we write the linear relation $c_1g_1+c_2g_2+c_3g_3=0$ in the form of a product of a matrix and a vector.
$$ G=[g_1\ g_2\ g_3]=\begin{bmatrix}1&0&2\\2&1&0\\0&3&-1\end{bmatrix} $$Computing the determinant by Sarrus's rule gives
$$ |G|=1\cdot1\cdot(-1)+0\cdot0\cdot0+2\cdot2\cdot3-2\cdot1\cdot0-1\cdot0\cdot3-0\cdot2\cdot(-1)=-1+0+12-0-0-0=11 $$Thus $|G|=11\neq0$. By Theorem 10.1 (the relation between linear independence and the determinant and rank), $g_1,g_2,g_3$ are linearly independent. (SymPy check: $\det G=11$.)
Exercise 10.2: Dimension and basis of a subspace
Solution
Solving the conditional equation $2x-y+3z=0$ for $y$ gives $y=2x+3z$. Since $x,z$ are variables that can be chosen freely, the elements of $W$ have the form
$$ \begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}x\\2x+3z\\z\end{bmatrix}=x\begin{bmatrix}1\\2\\0\end{bmatrix}+z\begin{bmatrix}0\\3\\1\end{bmatrix} $$that is, they can be written as linear combinations of two vectors. As one sees by comparing the first and third components, these two vectors $(1,2,0),(0,3,1)$ are not constant multiples of each other, and hence they are linearly independent. Therefore
$$ \dim W=3-1=2,\qquad \text{basis }\begin{bmatrix}1\\2\\0\end{bmatrix},\begin{bmatrix}0\\3\\1\end{bmatrix} $$(Theorem 10.6, $\dim W=n-\rank A$, gives the same result: there is a single conditional equation (the $1\times3$ coefficient matrix $A=[2\ -1\ 3]$ has rank 1), so $\dim W=3-1=2$. SymPy check: both basis vectors satisfy $2x-y+3z=0$, and the two vectors have rank 2.)
Exercise 10.3: Determining whether a sum is direct
Solution
Let $U_1=\langle p_1,p_2\rangle$ ($p_1=(1,1,0),\ p_2=(0,1,1)$) and $U_2=\langle q_1\rangle$ ($q_1=(1,0,0)$). First we confirm that $U_1$ really is two-dimensional. The vectors $p_1,p_2$ are not constant multiples of each other (their third components differ: $0$ and $1$), so they are linearly independent, and $\dim U_1=2$.
The condition for a direct sum (Definition 10.10(iii)) is $U_1\cap U_2=\{0\}$. We examine this through the rank of the matrix formed by the three vectors $p_1,p_2,q_1$ taken together.
$$ [p_1\ p_2\ q_1]=\begin{bmatrix}1&0&1\\1&1&0\\0&1&0\end{bmatrix} $$Computing the determinant gives $|{\cdot}|=1\cdot1\cdot0+0\cdot0\cdot0+1\cdot1\cdot1-1\cdot1\cdot0-1\cdot0\cdot1-0\cdot1\cdot0=0+0+1-0-0-0=1\neq0$, so $\rank=3$.
Suppose that $U_1\cap U_2$ contained an element $v$ other than $0$. Since $v\in U_1$, we have $v=\alpha p_1+\beta p_2$ (at least one of $\alpha,\beta$ is nonzero), and since $v\in U_2$, we can write $v=\gamma q_1$. This would give a linear relation $\alpha p_1+\beta p_2-\gamma q_1=0$ whose coefficients are not all $0$. But $\rank[p_1\ p_2\ q_1]=3$ (equal to the number of vectors) means, by Theorem 10.1, that these three vectors are linearly independent, so no such nontrivial relation can exist. This is a contradiction, so $U_1\cap U_2=\{0\}$.
Moreover, $\dim U_1+\dim U_2=2+1=3=\dim\R^3$, and since the three vectors $p_1,p_2,q_1$ that span $U_1+U_2$ are independent ($\rank=3$), we have $\dim(U_1+U_2)=3=\dim\R^3$; that is, $U_1+U_2=\R^3$ as well. Hence $\R^3=U_1\oplus U_2$ (a direct sum) holds. (SymPy check: $\rank[p_1,p_2,q_1]=3$.)
Exercise 10.4: Working backward with the dimension theorem
Solution
Solving the formula $\dim W_1+\dim W_2=\dim(W_1+W_2)+\dim(W_1\cap W_2)$ of Theorem 10.8 (the dimension theorem) for $\dim(W_1\cap W_2)$, we obtain
$$ \dim(W_1\cap W_2)=\dim W_1+\dim W_2-\dim(W_1+W_2) $$Substituting $\dim W_1=3,\ \dim W_2=3,\ \dim(W_1+W_2)=5$ gives
$$ \dim(W_1\cap W_2)=3+3-5=1 $$(Inside $\R^5$ we have $\dim(W_1+W_2)=5=\dim\R^5$, so $W_1+W_2=\R^5$; this corresponds to the situation in which $W_1,W_2$, each a three-dimensional subspace, overlap in only one dimension (a single line).)
Exercise 10.5: Checking the subspace axioms (a counterexample)
Solution
The set $W=\{(x,y)\mid x\ge0,\ y\ge0\}$ (the first quadrant, including its boundary) is not a subspace of $\R^2$. We show with a concrete example that Definition 10.7(III), “$a\in W,\ k\in\R\Rightarrow ka\in W$,” is violated.
Take $a=(1,1)\in W$ (it satisfies $x=1\ge0,\ y=1\ge0$) and multiply it by the scalar $k=-1$:
$$ ka=(-1)\cdot(1,1)=(-1,-1) $$The vector $(-1,-1)$ has $x=-1\lt0$, so it does not satisfy the condition $x\ge0$ of $W$; that is, $ka\notin W$. Hence $W$ is not closed under scalar multiplication, and so is not a subspace of $\R^2$. (Note that scalar multiples with $k\ge0$ alone stay inside $W$, but the definition of a subspace requires closure under multiplication by every real number $k$, negative numbers included.)
Exercise 10.6: Choosing a basis from a spanning set
Solution
Let $h_1=(1,0,0),\ h_2=(0,1,0),\ h_3=(1,1,0),\ h_4=(0,0,1)$. First we check whether any information is duplicated among these four vectors, and find that
$$ h_1+h_2=(1,0,0)+(0,1,0)=(1,1,0)=h_3 $$holds. That is, $h_3$ can be written as a linear combination of $h_1,h_2$, so the four vectors $h_1,h_2,h_3,h_4$ are linearly dependent, and $h_3$ is the “redundant” one.
So we check whether the three vectors $h_1,h_2,h_4$ obtained by removing $h_3$ really form a basis of $\R^3$.
$$ [h_1\ h_2\ h_4]=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}=E_3 $$This is the identity matrix, and $|E_3|=1\neq0$, so $h_1,h_2,h_4$ are linearly independent by Theorem 10.1. Since the number of these independent vectors, three, is exactly $\dim\R^3=3$, by Theorem 10.2 (the meaning of $\dim W$) they automatically span $\R^3$ and form a basis. Therefore the required basis is
$$ h_1=\begin{bmatrix}1\\0\\0\end{bmatrix},\quad h_2=\begin{bmatrix}0\\1\\0\end{bmatrix},\quad h_4=\begin{bmatrix}0\\0\\1\end{bmatrix} $$(Sets containing $h_3$, such as $h_1,h_2,h_3$ or $h_1,h_3,h_4$, may fail to be independent, and hence fail to be bases, because of the relation $h_3=h_1+h_2$, so some care is needed in choosing which single vector to remove. Here, only the choice of removing $h_3$ lets us confirm independence in the transparent form of the identity matrix. SymPy check: $\mathrm{rank}[h_1,h_2,h_4]=3$ and $h_3=h_1+h_2$.)
← Back to Chapter 10, “Vector Spaces (Linear Spaces)”
Chapter 11 Linear Maps
Exercise 11.1: Deciding whether a map is linear
Solution
(a) We verify that $f(x,y)=(x-y,\ 2x+y,\ 3y)$ is a linear map using the two conditions of Definition 11.4. First we check additivity. Let $\bm x_1=(x_1,y_1),\ \bm x_2=(x_2,y_2)$. Then
$$ f(\bm x_1+\bm x_2)=f(x_1+x_2,\ y_1+y_2)=\big((x_1+x_2)-(y_1+y_2),\ 2(x_1+x_2)+(y_1+y_2),\ 3(y_1+y_2)\big) $$On the other hand,
$$ f(\bm x_1)+f(\bm x_2)=(x_1-y_1,2x_1+y_1,3y_1)+(x_2-y_2,2x_2+y_2,3y_2)=\big((x_1+x_2)-(y_1+y_2),\ 2(x_1+x_2)+(y_1+y_2),\ 3(y_1+y_2)\big) $$The two expressions agree completely, because one is obtained from the other merely by changing the order of the additions component by component. Next we check homogeneity. For $k\in\R$,
$$ f(k\bm x_1)=f(kx_1,ky_1)=(kx_1-ky_1,\ 2kx_1+ky_1,\ 3ky_1)=k(x_1-y_1,\ 2x_1+y_1,\ 3y_1)=kf(\bm x_1) $$(we only factored $k$ out of each component), so this condition also holds. Hence $f$ satisfies both conditions of Definition 11.4, so it is a linear map.
(b) For $g(x,y)=(xy,\ x,\ y)$, we show with a concrete example that additivity already fails. Let $\bm x_1=(1,0),\ \bm x_2=(0,1)$. Then
$$ g(\bm x_1)+g(\bm x_2)=g(1,0)+g(0,1)=(1\cdot0,\ 1,\ 0)+(0\cdot1,\ 0,\ 1)=(0,1,0)+(0,0,1)=(0,1,1) $$On the other hand, since $\bm x_1+\bm x_2=(1,1)$,
$$ g(\bm x_1+\bm x_2)=g(1,1)=(1\cdot1,\ 1,\ 1)=(1,1,1) $$Since $(1,1,1)\neq(0,1,1)$, we have $g(\bm x_1+\bm x_2)\neq g(\bm x_1)+g(\bm x_2)$, and additivity fails. Hence $g$ is not a linear map. (The cause lies in the product form $xy$ of the first component. In general, computing with $x_1,x_2,y_1,y_2$ shows that the difference in additivity is $(x_1+x_2)(y_1+y_2)-(x_1y_1+x_2y_2)=x_1y_2+x_2y_1$, which is not identically $0$.) (SymPy check: we confirmed that the difference in additivity is identically $0$ in part (a) and is not in part (b), and we confirmed each of the numerical values of the concrete example.)
Exercise 11.2: Finding bases and dimensions of $\mathrm{Im}\,f$ and $\mathrm{Ker}\,f$ from the representation matrix
Solution
We apply elementary row operations to $A=\begin{bmatrix}2&-1&1\\4&-2&2\end{bmatrix}$. The second row is exactly twice the first row ($4=2\times2,\ -2=2\times(-1),\ 2=2\times1$), so applying $R_2\to R_2-2R_1$ gives
$$ A=\begin{bmatrix}2&-1&1\\4&-2&2\end{bmatrix}\ \xrightarrow{R_2\to R_2-2R_1}\ \begin{bmatrix}2&-1&1\\0&0&0\end{bmatrix} $$Since there is only one nonzero row, $\rank A=1$.
$\mathrm{Im}\,f$: $\mathrm{Im}\,f$ is the subspace spanned by the three column vectors $\begin{bmatrix}2\\4\end{bmatrix},\begin{bmatrix}-1\\-2\end{bmatrix},\begin{bmatrix}1\\2\end{bmatrix}$ of $A$. All three are scalar multiples of $\begin{bmatrix}1\\2\end{bmatrix}$ ($2$ times, $-1$ times, and $1$ times), so $\mathrm{Im}\,f=\left\langle\begin{bmatrix}1\\2\end{bmatrix}\right\rangle$; a basis consists of the single vector $\begin{bmatrix}1\\2\end{bmatrix}$, and $\dim(\mathrm{Im}\,f)=1=\rank A$.
$\mathrm{Ker}\,f$: We solve $A\bm x=\bm0$, that is, $2x_1-x_2+x_3=0$ (the second equation is twice the first, so there is only one independent equation). Setting $x_1=s,\ x_3=t$ ($s,t$ arbitrary real numbers), we obtain $x_2=2s+t$, hence
$$ \bm x=\begin{bmatrix}s\\2s+t\\t\end{bmatrix}=s\begin{bmatrix}1\\2\\0\end{bmatrix}+t\begin{bmatrix}0\\1\\1\end{bmatrix} $$Therefore a basis of $\mathrm{Ker}\,f$ consists of the two vectors $\begin{bmatrix}1\\2\\0\end{bmatrix},\begin{bmatrix}0\\1\\1\end{bmatrix}$, and $\dim(\mathrm{Ker}\,f)=2=n-\rank A=3-1$.
Dimension check and determination: We have $\dim(\mathrm{Im}\,f)+\dim(\mathrm{Ker}\,f)=1+2=3=n$, in agreement with the dimension theorem (Theorem 11.4, the rank–nullity theorem). Since $\dim(\mathrm{Im}\,f)=1\lt2=\dim\R^2$, we have $\mathrm{Im}\,f\neq\R^2$, so $f$ is not surjective (the criterion of Exercise 11.5). Also, since $\mathrm{Ker}\,f\neq\{\bm0\}$ (for example, $\bm x=(1,2,0)^{\mathsf T}\neq\bm0$ is contained in $\mathrm{Ker}\,f$), $f$ is not injective either (the criterion of Exercise 11.4). (Verified with SymPy's $\mathrm{rank}$, $\mathrm{nullspace}$, and $\mathrm{columnspace}$: $\rank A=1$; the two basis vectors of $\mathrm{Ker}\,f$ (SymPy's basis is $\left(\tfrac12,1,0\right),\left(-\tfrac12,0,1\right)$, which is related to the basis in this solution by scalar multiples and linear combinations, and we confirmed that the two bases span the same two-dimensional subspace); and the single basis vector of $\mathrm{Im}\,f$.)
Exercise 11.3: Representation matrix of a composite map
Solution
By Theorem 11.5, the representation matrix of $g\circ f$ that we seek is the product $BA$. Since $A$ is of type $(2,3)$ and $B$ is of type $(2,2)$, $BA$ is of type $(2,3)$ (the product can be computed because the number of columns of $B$, $2$, equals the number of rows of $A$, $2$).
$$ BA=\begin{bmatrix}3&1\\-1&2\end{bmatrix}\begin{bmatrix}1&-1&2\\0&1&1\end{bmatrix} $$We compute each entry according to the definition of the matrix product (Chapter 8: multiply the corresponding entries of the row on the left and the column on the right, and add).
$$ (1,1)\text{ entry}:\ 3\cdot1+1\cdot0=3,\qquad (1,2)\text{ entry}:\ 3\cdot(-1)+1\cdot1=-3+1=-2,\qquad (1,3)\text{ entry}:\ 3\cdot2+1\cdot1=6+1=7 $$ $$ (2,1)\text{ entry}:\ (-1)\cdot1+2\cdot0=-1,\qquad (2,2)\text{ entry}:\ (-1)\cdot(-1)+2\cdot1=1+2=3,\qquad (2,3)\text{ entry}:\ (-1)\cdot2+2\cdot1=-2+2=0 $$Putting these together,
$$ BA=\begin{bmatrix}3&-2&7\\-1&3&0\end{bmatrix} $$(SymPy check: we obtained the same $BA$ as above.)
Exercise 11.4: Equivalence of injectivity and $\mathrm{Ker}\,f=\{\bm0\}$
Solution
(a) We prove both directions.
($\Rightarrow$) If $f$ is injective, then $\mathrm{Ker}\,f=\{\bm0\}$: By Theorem 11.1(i), $f(\bm0)=\bm0'$ always holds. Now let $\bm x\in\mathrm{Ker}\,f$. By Definition 11.7, $f(\bm x)=\bm0'$. Therefore $f(\bm x)=\bm0'=f(\bm0)$, and since $f$ is injective (Definition 11.2), we can conclude that $\bm x=\bm0$. Hence the only element of $\mathrm{Ker}\,f$ is $\bm0$, that is, $\mathrm{Ker}\,f=\{\bm0\}$.
($\Leftarrow$) If $\mathrm{Ker}\,f=\{\bm0\}$, then $f$ is injective: Take arbitrary $\bm x_1,\bm x_2\in V$ satisfying $f(\bm x_1)=f(\bm x_2)$. By Theorem 11.1(ii) (the formula for the image of a linear combination, in the case $c_1=1,c_2=-1$),
$$ f(\bm x_1-\bm x_2)=f(\bm x_1)+f(-\bm x_2)=f(\bm x_1)-f(\bm x_2)=\bm0' $$(in the middle step, $f(-\bm x_2)=-f(\bm x_2)$ is the relation obtained from homogeneity $f(\lambda\bm x)=\lambda f(\bm x)$ with $\lambda=-1$). By Definition 11.7, this means $\bm x_1-\bm x_2\in\mathrm{Ker}\,f$. By the hypothesis $\mathrm{Ker}\,f=\{\bm0\}$, we obtain $\bm x_1-\bm x_2=\bm0$, that is, $\bm x_1=\bm x_2$. Hence, by Definition 11.2, $f$ is injective.
Since we have proved both ($\Rightarrow$) and ($\Leftarrow$), “$f$ is injective” $\iff$ “$\mathrm{Ker}\,f=\{\bm0\}$” holds.
(b) Let $A=\begin{bmatrix}1&2\\3&7\end{bmatrix}$. Since $\det A=1\cdot7-2\cdot3=7-6=1\neq0$ (Chapter 8), $A$ is invertible. Multiplying both sides of $A\bm x=\bm0$ by $A^{-1}$ from the left gives $\bm x=A^{-1}\bm0=\bm0$, so the only solution of $A\bm x=\bm0$ is $\bm x=\bm0$. That is, $\mathrm{Ker}\,f=\{\bm0\}$. By the result of (a), $f$ is injective. (SymPy check: $\det A=1$, $\mathrm{nullspace}(A)$ is empty (no solutions other than $\bm0$), and $\rank A=2=n$.)
Exercise 11.5: Equivalence of surjectivity and $\mathrm{Im}\,f=V'$
Solution
(a) Definition 11.1 (surjective) says “$\forall\bm y\in V',\ \exists\bm x\in V,\ f(\bm x)=\bm y$”, that is, “whichever element $\bm y$ of $V'$ we take, there exists (at least one) $\bm x\in V$ whose image is that element”. Put differently, this says precisely that “every element of $V'$ appears as the image of some element under $f$”. On the other hand, by Definition 11.6, $\mathrm{Im}\,f=f(V)=\{f(\bm x)\mid\bm x\in V\}$ is “the set of those elements of $V'$ that actually appear as images under $f$”. Therefore,
“every element of $V'$ appears as an image under $f$” (= surjective) is exactly the same assertion as “$\mathrm{Im}\,f$ (the set of elements that actually appear as images) coincides with all of $V'$”, that is, $\mathrm{Im}\,f=V'$. Moreover, since $\mathrm{Im}\,f\subset V'$ always holds (the elements of $\mathrm{Im}\,f$ are elements of $V'$ to begin with), $\mathrm{Im}\,f=V'$ means that an arbitrary element of $V'$ is also contained in $\mathrm{Im}\,f$, which coincides exactly with the surjectivity condition above. Hence “$f$ is surjective” $\iff$ “$\mathrm{Im}\,f=V'$”, and this is not so much a new theorem as a fact that is immediately apparent just by comparing the two definitions (Definition 11.1 and Definition 11.6).
(b) Let $A=\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}$. The column vectors of $A$ are $\begin{bmatrix}1\\0\end{bmatrix},\begin{bmatrix}0\\1\end{bmatrix},\begin{bmatrix}1\\1\end{bmatrix}$. The first two, $\begin{bmatrix}1\\0\end{bmatrix},\begin{bmatrix}0\\1\end{bmatrix}$, are themselves the standard basis of $\R^2$; they are clearly linearly independent and span $\R^2$ (the third, $\begin{bmatrix}1\\1\end{bmatrix}$, is the sum of the first two and so already lies in the space spanned by them). Hence $\mathrm{Im}\,f=\langle A\bm e_1,A\bm e_2,A\bm e_3\rangle=\R^2$, and $\dim(\mathrm{Im}\,f)=\rank A=2=\dim\R^2$. By the result of (a), $\mathrm{Im}\,f=\R^2=V'$, so $f$ is surjective. (Verified with SymPy: $\rank A=2$, and the basis of SymPy's columnspace is $\begin{bmatrix}1\\0\end{bmatrix},\begin{bmatrix}0\\1\end{bmatrix}$, so the column space coincides with all of $\R^2$.)
Exercise 11.6: Representation matrix and rank of a linear map in three variables
Solution
Writing each component of $f(x_1,x_2,x_3)=(x_1+x_2,\ x_2+x_3,\ x_1+2x_2+x_3)$ in terms of the coefficients of $x_1,x_2,x_3$, we have
$$ \begin{bmatrix}x_1+x_2\\x_2+x_3\\x_1+2x_2+x_3\end{bmatrix}=\begin{bmatrix}1&1&0\\0&1&1\\1&2&1\end{bmatrix}\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} $$so the representation matrix is $A=\begin{bmatrix}1&1&0\\0&1&1\\1&2&1\end{bmatrix}$.
Now look at the third row of $A$: the sum of the first row $(1,1,0)$ and the second row $(0,1,1)$ is exactly $(1,1,0)+(0,1,1)=(1,2,1)$, which coincides with the third row. That is, the third row is a linear combination of the first and second rows (it is dependent), and the three rows of $A$ are not independent. Therefore $\rank A\lt3$. On the other hand, looking only at the first and second rows, $(1,1,0)$ and $(0,1,1)$ are not constant multiples of each other, so they are linearly independent, and $\rank A\ge2$. Hence
$$ \rank A=2 $$Since the rows are linearly dependent, $\det A=0$ (a determinant is always $0$ if the rows (or columns) are linearly dependent; Chapter 8). For $f$, which is given by a square matrix ($n=m=3$), to be bijective, it is necessary that $A$ be invertible ($\rank A=3$, $\det A\neq0$); but since $\rank A=2\neq3$, $A$ is not invertible. By the dimension theorem (Theorem 11.4), $\dim(\mathrm{Ker}\,f)=n-\rank A=3-2=1\gt0$, so by the result of Exercise 11.4(a), $f$ is not injective. Also, since $\dim(\mathrm{Im}\,f)=\rank A=2\lt3=\dim\R^3$, by the result of Exercise 11.5(a), $f$ is not surjective either. Therefore $f$ is not bijective. (Verified with SymPy: $\rank A=2$, $\det A=0$, third row $-$ (first row + second row) $=(0,0,0)$, and the basis vector $(1,-1,1)$ of $\mathrm{Ker}\,f$.)
← Back to Chapter 11, “Linear Maps”
Chapter 12 Eigenvalues, Eigenvectors, and Diagonalization of Matrices
Exercise 12.1: Eigenvalues and the characteristic equation of a 3×3 matrix
Solution
We form the characteristic equation of $A=\begin{bmatrix}1&0&0\\1&0&2\\-1&2&0\end{bmatrix}$.
$$ A-\lambda E=\begin{bmatrix}1-\lambda&0&0\\1&-\lambda&2\\-1&2&-\lambda\end{bmatrix} $$Since the first row contains two $0$'s, cofactor expansion along the first row (Theorem 8.2 of Chapter 8) is the simplest approach.
$$ \det(A-\lambda E)=(1-\lambda)\begin{vmatrix}-\lambda&2\\2&-\lambda\end{vmatrix}-0+0=(1-\lambda)(\lambda^2-4) $$(The $2\times2$ minor is $(-\lambda)(-\lambda)-2\cdot2=\lambda^2-4$.) Using the factorization $\lambda^2-4=(\lambda-2)(\lambda+2)$, we have
$$ \det(A-\lambda E)=(1-\lambda)(\lambda-2)(\lambda+2)=0 \qquad\therefore\ \lambda=1,\ 2,\ -2 $$Thus there are three eigenvalues, all of them distinct real numbers. Next, we find the eigenvectors for each eigenvalue.
The case $\lambda=1$. Writing $(A-E)\bm x=\bm0$ in components gives $\begin{cases}0=0\\x_1-x_2+2x_3=0\\-x_1+2x_2-x_3=0\end{cases}$. The first equation holds identically (the first row of $A-E$ is $(0,0,0)$), so there are effectively just two equations. From the second equation, $x_1=x_2-2x_3$. Substituting this into the third equation gives $-(x_2-2x_3)+2x_2-x_3=x_2+x_3=0$, that is, $x_2=-x_3$. Letting $x_3=t$, we get $x_2=-t$ and $x_1=x_2-2x_3=-t-2t=-3t$. Therefore
$$ \bm x=\begin{bmatrix}-3t\\-t\\t\end{bmatrix}=t\begin{bmatrix}-3\\-1\\1\end{bmatrix}\qquad(t\neq0) $$The case $\lambda=2$. The equation $(A-2E)\bm x=\bm0$ reads $\begin{cases}-x_1=0\\x_1-2x_2+2x_3=0\\-x_1+2x_2-2x_3=0\end{cases}$. From the first equation, $x_1=0$. Substituting this into the second equation gives $-2x_2+2x_3=0$, that is, $x_2=x_3$ (the third equation reduces to the same condition). Letting $x_3=t$, we get $x_2=t$ and $x_1=0$. Therefore
$$ \bm x=\begin{bmatrix}0\\t\\t\end{bmatrix}=t\begin{bmatrix}0\\1\\1\end{bmatrix}\qquad(t\neq0) $$The case $\lambda=-2$. The equation $(A+2E)\bm x=\bm0$ reads $\begin{cases}3x_1=0\\x_1+2x_2+2x_3=0\\-x_1+2x_2+2x_3=0\end{cases}$. From the first equation, $x_1=0$. Substituting this into the second equation gives $2x_2+2x_3=0$, that is, $x_2=-x_3$ (the third equation gives the same condition). Letting $x_3=t$, we get $x_2=-t$ and $x_1=0$. Therefore
$$ \bm x=\begin{bmatrix}0\\-t\\t\end{bmatrix}=t\begin{bmatrix}0\\-1\\1\end{bmatrix}\qquad(t\neq0) $$To summarize, the eigenvalues are $\lambda=1,2,-2$ (each of multiplicity one), and the corresponding eigenvectors are, respectively, constant multiples of $(-3,-1,1)^{\mathsf T}$, $(0,1,1)^{\mathsf T}$, and $(0,-1,1)^{\mathsf T}$. (SymPy check: $A(-3,-1,1)^{\mathsf T}=(-3,-1,1)^{\mathsf T}$, $A(0,1,1)^{\mathsf T}=(0,2,2)^{\mathsf T}=2(0,1,1)^{\mathsf T}$, and $A(0,-1,1)^{\mathsf T}=(0,2,-2)^{\mathsf T}=-2(0,-1,1)^{\mathsf T}$ were all confirmed directly.)
Exercise 12.2: Determining diagonalizability
Solution
Since $A=\begin{bmatrix}4&1&0\\0&4&0\\0&0&-1\end{bmatrix}$ is an upper triangular matrix, $A-\lambda E$ is also upper triangular, and the characteristic equation is given by the product of the diagonal entries:
$$ \det(A-\lambda E)=(4-\lambda)^2(-1-\lambda)=0 $$Hence the eigenvalues are $\lambda=4$ (algebraic multiplicity $a=2$) and $\lambda=-1$ (algebraic multiplicity $a=1$).
We examine the eigenspace for $\lambda=4$. Writing $(A-4E)\bm x=\bm0$ in components gives $\begin{bmatrix}0&1&0\\0&0&0\\0&0&-5\end{bmatrix}\bm x=\bm0$, that is, $x_2=0$ and $x_3=0$ ($x_1$ is free). Hence $W(4)=\{(t,0,0)^{\mathsf T}\mid t\in\R\}$ is one-dimensional, and the geometric multiplicity is $g=1$.
We have $g=1\lt a=2$, so for $\lambda=4$ the geometric multiplicity falls short of the algebraic multiplicity. By Theorem 12.5 (the restatement, in terms of multiplicities, of the necessary and sufficient condition for diagonalizability), $A$ is not diagonalizable. (SymPy check: the eigenvalues of $A$ are $\{4:2,-1:1\}$ (counted with multiplicity), and $\mathrm{Ker}(A-4E)$ was confirmed to be one-dimensional, spanned by $(1,0,0)^{\mathsf T}$.)
Exercise 12.3: Powers of a matrix via diagonalization
Solution
The characteristic equation of $A=\begin{bmatrix}0&1\\-4&5\end{bmatrix}$ is
$$ \det(A-\lambda E)=\begin{vmatrix}-\lambda&1\\-4&5-\lambda\end{vmatrix}=-\lambda(5-\lambda)+4=\lambda^2-5\lambda+4=(\lambda-1)(\lambda-4)=0 $$From this, the eigenvalues are $\lambda=1,4$ (each of multiplicity one).
$\lambda=1$: $(A-E)\bm x=\bm0$ reads $\begin{cases}-x_1+x_2=0\\-4x_1+4x_2=0\end{cases}$ (the second equation is four times the first). Hence $x_1=x_2$, and $\bm v_1=(1,1)^{\mathsf T}$.
$\lambda=4$: $(A-4E)\bm x=\bm0$ reads $\begin{cases}-4x_1+x_2=0\\-4x_1+x_2=0\end{cases}$ (the two equations are identical). Hence $x_2=4x_1$, and $\bm v_2=(1,4)^{\mathsf T}$.
Since the eigenvalues are distinct, $\bm v_1,\bm v_2$ are linearly independent by Theorem 12.3, and $A$ is diagonalizable by Theorem 12.5. Let $P=\begin{bmatrix}1&1\\1&4\end{bmatrix}$; then $\det P=4-1=3\neq0$. By the formula using the adjugate matrix (Chapter 9), we have
$$ P^{-1}=\frac13\begin{bmatrix}4&-1\\-1&1\end{bmatrix} $$(Check: $PP^{-1}=\frac13\begin{bmatrix}1\cdot4+1\cdot(-1)&1\cdot(-1)+1\cdot1\\1\cdot4+4\cdot(-1)&1\cdot(-1)+4\cdot1\end{bmatrix}=\frac13\begin{bmatrix}3&0\\0&3\end{bmatrix}=E$.) By Theorem 12.6, $A^n=PD^nP^{-1}$ (where $D=\mathrm{diag}(1,4)$ and $D^n=\mathrm{diag}(1,4^n)$). First,
$$ PD^n=\begin{bmatrix}1&1\\1&4\end{bmatrix}\begin{bmatrix}1&0\\0&4^n\end{bmatrix}=\begin{bmatrix}1&4^n\\1&4^{n+1}\end{bmatrix} $$Multiplying this on the right by $P^{-1}$, we obtain
$$ A^n=\frac13\begin{bmatrix}1&4^n\\1&4^{n+1}\end{bmatrix}\begin{bmatrix}4&-1\\-1&1\end{bmatrix}=\frac13\begin{bmatrix}4-4^n&4^n-1\\4-4^{n+1}&4^{n+1}-1\end{bmatrix} $$which is the general formula. Substituting $n=5$ and using $4^5=1024$ and $4^6=4096$, we get
$$ A^5=\frac13\begin{bmatrix}4-1024&1024-1\\4-4096&4096-1\end{bmatrix}=\frac13\begin{bmatrix}-1020&1023\\-4092&4095\end{bmatrix}=\begin{bmatrix}-340&341\\-1364&1365\end{bmatrix} $$(SymPy check: both the result of directly multiplying together five copies of $A$ and the result of substituting $n=5$ into the general formula were confirmed to agree with $\begin{bmatrix}-340&341\\-1364&1365\end{bmatrix}$.)
Exercise 12.4: The relation between the eigenvalue 0 and Ker f
Solution
(1) The characteristic equation of $A=\begin{bmatrix}1&2\\2&4\end{bmatrix}$ is
$$ \det(A-\lambda E)=(1-\lambda)(4-\lambda)-2\cdot2=\lambda^2-5\lambda+4-4=\lambda^2-5\lambda=\lambda(\lambda-5)=0 $$so the eigenvalues are $\lambda=0,5$. In particular, $\lambda=0$ is indeed one of the eigenvalues of $A$. To find the eigenvectors for $\lambda=0$, we write $(A-0\cdot E)\bm x=A\bm x=\bm0$ in components:
$$ \begin{cases}x_1+2x_2=0\\2x_1+4x_2=0\end{cases} $$(the second equation is twice the first and gives the same condition). From $x_1=-2x_2$, letting $x_2=t$ gives $x_1=-2t$. Hence the eigenvectors are $\bm x=t(-2,1)^{\mathsf T}$ ($t\neq0$).
(2) Applying Definition 12.1 (eigenvalue and eigenvector) to the case $\lambda=0$, the statement “$\lambda=0$ is an eigenvalue of $A$” means “there exists an $\bm x\neq\bm0$ satisfying $A\bm x=0\cdot\bm x=\bm0$.” On the other hand, applying Definition 11.7 (kernel) of Chapter 11 to the linear map $f(\bm x)=A\bm x$ whose representation matrix is $A$, we have $\mathrm{Ker}\,f=\{\bm x\mid A\bm x=\bm0\}$. Therefore,
$$ \lambda=0\text{ is an eigenvalue}\iff \exists\,\bm x\neq\bm0,\ A\bm x=\bm0\iff \mathrm{Ker}\,f\neq\{\bm0\} $$—that is, in the terminology of Definition 12.2, the statement that $\lambda=0$ is an eigenvalue means precisely that the eigenspace $W(0)=\mathrm{Ker}(A-0\cdot E)=\mathrm{Ker}\,f$ is strictly larger than $\{\bm0\}$. Furthermore, taking the contrapositive of the invertibility conditions learned in Chapter 9 ($A$ is invertible $\iff$ $A\bm x=\bm0$ has only the trivial solution $\bm x=\bm0$ $\iff$ $\det A\neq0$), we see that $\mathrm{Ker}\,f\neq\{\bm0\}$ ($A\bm x=\bm0$ has a nontrivial solution) is equivalent to $A$ being not invertible ($\det A=0$). Combining the three, we obtain the equivalence
$$ \lambda=0\text{ is an eigenvalue of }A\text{ }\iff \mathrm{Ker}\,f\neq\{\bm0\}\iff A\text{ is not invertible (}\det A=0\text{)} $$In fact, for the matrix $A=\begin{bmatrix}1&2\\2&4\end{bmatrix}$ of this exercise, $\det A=1\cdot4-2\cdot2=0$, and the fact that the matrix is not invertible indeed corresponds to the fact that $\lambda=0$ is an eigenvalue.
Exercise 12.5: Directly checking linear independence
Solution
We form the matrix whose columns are the three eigenvectors found in Exercise 12.1, $\bm v_1=(-3,-1,1)^{\mathsf T}$ ($\lambda=1$), $\bm v_2=(0,1,1)^{\mathsf T}$ ($\lambda=2$), and $\bm v_3=(0,-1,1)^{\mathsf T}$ ($\lambda=-2$), and compute its determinant.
$$ M=[\bm v_1\ \bm v_2\ \bm v_3]=\begin{bmatrix}-3&0&0\\-1&1&-1\\1&1&1\end{bmatrix} $$Since the first row contains two $0$'s, cofactor expansion along the first row is simple.
$$ \det M=(-3)\begin{vmatrix}1&-1\\1&1\end{vmatrix}-0+0=(-3)(1\cdot1-(-1)\cdot1)=(-3)(1+1)=-6 $$Since $\det M=-6\neq0$, Theorem 10.1 of Chapter 10 (the relation between linear independence and rank) shows that $\bm v_1,\bm v_2,\bm v_3$ are linearly independent. This confirms directly, by means of a determinant in this concrete example, what Theorem 12.3 (eigenvectors corresponding to distinct eigenvalues are linearly independent) asserts. (SymPy check: $\det M=-6$ was confirmed (or, although the sign or the way the absolute value is taken may change depending on how the columns are arranged, in any case it was confirmed that the determinant is not $0$).)
Exercise 12.6: Constructing a non-diagonalizable matrix yourself
Solution
(One example of such a construction.) Let $A=\begin{bmatrix}3&1\\0&3\end{bmatrix}$. Since $A$ is an upper triangular matrix, the characteristic equation is the product of the diagonal entries, $(3-\lambda)^2=0$, and so the only eigenvalue is $\lambda=3$ (algebraic multiplicity $a=2$).
We examine the eigenspace. Writing $(A-3E)\bm x=\bm0$ in components gives $\begin{bmatrix}0&1\\0&0\end{bmatrix}\bm x=\bm0$, that is, $x_2=0$ ($x_1$ is free). Hence $W(3)=\{(t,0)^{\mathsf T}\mid t\in\R\}$ is one-dimensional, and the geometric multiplicity is $g=1$.
Since $g=1\lt a=2$, Theorem 12.5 (in its restatement in terms of multiplicities) shows that $A$ is not diagonalizable—the reason is that the eigenvectors of $A$ are only constant multiples of $(1,0)^{\mathsf T}$, and no matter what we try we cannot find another eigenvector linearly independent of this one, so the “two linearly independent eigenvectors” required to diagonalize a $2\times2$ matrix cannot be assembled. (In general, a 2×2 square matrix that has only one eigenvalue (algebraic multiplicity two) and is not itself a diagonal matrix can never be diagonalized, for exactly the same reason as in Example 12.4(b). The same argument goes through unchanged if the eigenvalue is changed to a number other than 3, or if the off-diagonal entry is changed to any number other than 1 and $0$.) (SymPy check: the eigenvalues of $A$ are $\{3:2\}$, and $\mathrm{Ker}(A-3E)$ was confirmed to be one-dimensional, spanned by $(1,0)^{\mathsf T}$.)
← Back to Chapter 12, “Eigenvalues, Eigenvectors, and Diagonalization of Matrices”
Chapter 13 Sets and the Probability of Events
Exercise 13.1: Verifying the distributive law with a Venn diagram and with logical formulas
Solution
(a) Verification with a Venn diagram: Draw three circles $A,B,C$ in general position (positions in which they overlap one another). The $B\cup C$ on the right-hand side is the entire interior of circle $B$ and circle $C$ (including their overlap). The $A\cap(B\cup C)$ on the left-hand side is the part of the interior of circle $A$ that also belongs to $B\cup C$—that is, the region obtained by combining, within the interior of circle $A$, “the part inside circle $B$” and “the part inside circle $C$.” On the other hand, the right-hand side $(A\cap B)\cup(A\cap C)$ is the region obtained by combining $A\cap B$ (the overlap of $A$ and $B$) and $A\cap C$ (the overlap of $A$ and $C$). If we shade them in the figure, both regions turn out to be the same region, “the part of the interior of circle $A$ that also belongs to at least one of $B$ and $C$,” so we can confirm visually that they coincide.
(b) Proof by the membership conditions of elements: For any element $x$ of the universal set, the following chain of equivalences holds.
$$ x\in A\cap(B\cup C) \iff x\in A\text{ and }x\in B\cup C \iff x\in A\text{ and }(x\in B\text{ or }x\in C) $$Here, using the distributive law of logical operations, “$P$ and ($Q$ or $R$) $\iff$ ($P$ and $Q$) or ($P$ and $R$)” (the distributive law for conjunction and disjunction, which appears in the study of propositions in high school mathematics), we have
$$ \iff (x\in A\text{ and }x\in B)\text{ or }(x\in A\text{ and }x\in C) \iff x\in A\cap B\text{ or }x\in A\cap C \iff x\in(A\cap B)\cup(A\cap C) $$Therefore, for any $x$ we have $x\in A\cap(B\cup C)\iff x\in(A\cap B)\cup(A\cap C)$, and hence $A\cap(B\cup C)=(A\cap B)\cup(A\cap C)$. ∎
Let us also check with concrete numbers. Let $U=\{1,\ldots,12\}$, $A=\{1,2,3,4,5,6\}$, $B=\{2,4,6,8,10\}$, $C=\{3,6,9,12\}$. Then $B\cup C=\{2,3,4,6,8,9,10,12\}$, and
$$ A\cap(B\cup C)=\{1,\ldots,6\}\cap\{2,3,4,6,8,9,10,12\}=\{2,3,4,6\} $$On the other hand, $A\cap B=\{2,4,6\}$ and $A\cap C=\{3,6\}$, so
$$ (A\cap B)\cup(A\cap C)=\{2,4,6\}\cup\{3,6\}=\{2,3,4,6\} $$Thus the two sides coincide (verified with Python's set operations).
Exercise 13.2: De Morgan's laws for three sets
Solution
Let $D=B\cup C$. Then $A\cup B\cup C=A\cup D$. Applying Theorem 13.1 (De Morgan's laws for two sets) to $A,D$, we obtain
$$ \overline{A\cup D}=\bar A\cap\bar D $$Applying Theorem 13.1 once more, this time to $D=B\cup C$, gives $\bar D=\overline{B\cup C}=\bar B\cap\bar C$. Substituting this, we obtain
$$ \overline{A\cup B\cup C}=\overline{A\cup D}=\bar A\cap\bar D=\bar A\cap(\bar B\cap\bar C)=\bar A\cap\bar B\cap\bar C $$(The last equality follows from the fact that the intersection operation is associative—$(\bar A\cap\bar B)\cap\bar C=\bar A\cap(\bar B\cap\bar C)$. This is clear because, if we extend the definition of the intersection, “belonging to both,” naturally to three sets, the condition becomes the same one, “belonging to all three,” regardless of how the parentheses are placed.) Hence we have shown that $\overline{A\cup B\cup C}=\bar A\cap\bar B\cap\bar C$. ∎
Let us also check with concrete numbers. Let $U=\{1,\ldots,12\}$, $A=\{1,\ldots,6\}$, $B=\{2,4,6,8,10\}$, $C=\{3,6,9,12\}$. Then $A\cup B\cup C=\{1,2,3,4,5,6,8,9,10,12\}$ (the only elements missing are $7,11$), so
$$ \overline{A\cup B\cup C}=\{7,11\} $$On the other hand, $\bar A=\{7,\ldots,12\}$, $\bar B=\{1,3,5,7,9,11,12\}$, and $\bar C=\{1,2,4,5,7,8,10,11\}$; computing the intersection of these three, we get
$$ \bar A\cap\bar B\cap\bar C=\{7,11\} $$so the two sides coincide (verified with Python's set operations).
Exercise 13.3: Probability of a sum event with playing cards
Solution
A deck of playing cards has 52 cards (4 suits $\times$ 13 ranks). Event $A$ (face cards: J, Q, K) has three cards in each suit, so $n(A)=4\times3=12$. Event $B$ (hearts) consists of all 13 cards of one suit, so $n(B)=13$. For the product event $A\cap B$ (the face cards of hearts: the J, Q, and K of hearts), $n(A\cap B)=3$. Hence,
$$ P(A)=\frac{n(A)}{n(U)}=\frac{12}{52}=\frac{3}{13},\qquad P(B)=\frac{n(B)}{n(U)}=\frac{13}{52}=\frac14,\qquad P(A\cap B)=\frac{n(A\cap B)}{n(U)}=\frac{3}{52} $$Since $A$ and $B$ are not mutually exclusive ($A\cap B\neq\emptyset$), we use the general case of Theorem 13.2 (the addition rule). To obtain a common denominator, we rewrite $P(A)=3/13=12/52$, and then
$$ P(A\cup B)=P(A)+P(B)-P(A\cap B)=\frac{12}{52}+\frac{13}{52}-\frac{3}{52}=\frac{22}{52}=\frac{11}{26} $$(Counting directly also works: the number of cards that are face cards or hearts is $n(A\cup B)=n(A)+n(B)-n(A\cap B)=12+13-3=22$, and $22/52=11/26$ agrees with the value above. Verified by actually enumerating the 52 playing cards in Python.)
Exercise 13.4: Extending the addition rule to three mutually exclusive events
Solution
Suppose $A,B,C$ are mutually exclusive ($A\cap B=B\cap C=C\cap A=\emptyset$). Let $D=B\cup C$; we first verify that $A$ and $D$ are mutually exclusive. If $A\cap D\neq\emptyset$, then some element $x$ satisfies $x\in A$ and $x\in D=B\cup C$, that is, $x\in B$ or $x\in C$. In the former case $x\in A\cap B$, which contradicts $A\cap B=\emptyset$; in the latter case $x\in A\cap C$, which contradicts $A\cap C=\emptyset$. Hence $A\cap D=\emptyset$; that is, $A$ and $D$ are mutually exclusive. Therefore, applying Theorem 13.2 (the addition rule for the mutually exclusive case) to $A,D$, we obtain
$$ P(A\cup B\cup C)=P(A\cup D)=P(A)+P(D)=P(A)+P(B\cup C) $$Applying Theorem 13.2 once more, now using the fact that $B,C$ are mutually exclusive, we get $P(B\cup C)=P(B)+P(C)$. Substituting this, we obtain
$$ P(A\cup B\cup C)=P(A)+P(B)+P(C) $$Thus the formula has been shown. ∎ Let us confirm it with a concrete example. Let $U=\{1,\ldots,12\}$, $A=\{1,2,3\}$, $B=\{4,5,6,7\}$, $C=\{8,9,10\}$ (mutually exclusive). Since $n(U)=12$, we have
$$ P(A)=\frac{3}{12}=\frac14,\qquad P(B)=\frac{4}{12}=\frac13,\qquad P(C)=\frac{3}{12}=\frac14 $$Their sum is $\dfrac14+\dfrac13+\dfrac14=\dfrac{3}{12}+\dfrac{4}{12}+\dfrac{3}{12}=\dfrac{10}{12}=\dfrac56$. On the other hand, directly from $A\cup B\cup C=\{1,\ldots,10\}$ we have $P(A\cup B\cup C)=10/12=5/6$, and the two agree (verified with Python).
Exercise 13.5: Probability for two dice using the complementary event
Solution
The two dice can land in $n(U)=6\times6=36$ ways in all. The sum of the numbers shown has a minimum of $2$ ($1+1$) and a maximum of $12$ ($6+6$), so the sum is “a multiple of 5” exactly when it is $5$ or $10$.
(a) Counting directly: The pairs with sum $5$ are $(1,4),(2,3),(3,2),(4,1)$, four ways, and the pairs with sum $10$ are $(4,6),(5,5),(6,4)$, three ways. So, letting $A$ be the event in question, $n(A)=4+3=7$. Hence
$$ P(A)=\frac{7}{36} $$(b) Using the complementary event: The number of cases for $\bar A=$ “the sum is not a multiple of 5” is $n(\bar A)=36-7=29$ (alternatively, among the 11 possible values $2,\ldots,12$ of the sum, counting the number of pairs for each of the nine values other than $5,10$ and adding them up gives 29 as well). Therefore, by Theorem 13.3 (the probability of a complementary event), we obtain
$$ P(A)=1-P(\bar A)=1-\frac{29}{36}=\frac{7}{36} $$which agrees with the direct computation in (a) (verified by enumerating all 36 outcomes in Python).
Exercise 13.6: Application to reliability engineering—the repeated-trials formula
Solution
Let $A$ be the event that a single switch fails. Then $p=P(A)=0.05$, and the probability that it does not fail is $q=1-p=0.95$. The $n=10$ switches fail independently of one another, so Theorem 13.4 (the repeated-trials formula) can be applied with $n=10$, $r=2$. First we compute the number of combinations:
$$ {}_{10}\mathrm{C}_2=\frac{10!}{2!\,8!}=\frac{10\times9}{2\times1}=45 $$Therefore, the probability that exactly two switches fail is
$$ P={}_{10}\mathrm{C}_2\cdot p^2\cdot q^{8}=45\times(0.05)^2\times(0.95)^8 $$Here $(0.05)^2=0.0025$, and squaring successively to compute $(0.95)^8$ gives $(0.95)^2=0.9025$, $(0.95)^4=(0.9025)^2\approx0.814506$, and $(0.95)^8=(0.814506)^2\approx0.663420$. Hence we obtain
$$ P\approx45\times0.0025\times0.663420\approx0.07463 $$That is, about 7.5% (the exact rational value is $P=152852067369/2048000000000$, but since the denominator is large and has no practical meaning, expressing it as a decimal is appropriate; we have confirmed that both an exact computation with SymPy and an ordinary floating-point computation agree with $P\approx0.0746$). Since $np=10\times0.05=0.5$ failures are expected on average among the 10 switches, “exactly two” is somewhat less likely to occur than that, and this is the intuitive meaning of this value.
← Back to Chapter 13, “Sets and the Probability of Events”
Chapter 14 Expected Value — From Discrete to Continuous
Exercise 14.1: Expected value of the sum of the numbers on two dice
Solution
Distinguishing the two dice, let $X_1$ be “the number on the first die” and $X_2$ “the number on the second die,” and let $X=X_1+X_2$ be the sum. There are $6\times6=36$ possible cases in all, and every pair is equally likely (each has probability $\frac1{36}$). Counting the number $n(s)$ of cases in which the sum $X$ takes the value $s$ ($s=2,3,\dots,12$), we get
$$ n(2)=1,\ n(3)=2,\ n(4)=3,\ n(5)=4,\ n(6)=5,\ n(7)=6,\ n(8)=5,\ n(9)=4,\ n(10)=3,\ n(11)=2,\ n(12)=1 $$(The total $1+2+3+4+5+6+5+4+3+2+1=36$ indeed agrees with the total number of cases. For example, $s=4$ arises in three ways: $(1,3),(2,2),(3,1)$.) Since the probability is $P(X=s)=\dfrac{n(s)}{36}$, Definition 14.1 (the formula in Chapter 14) gives
$$ E(X)=\sum_{s=2}^{12} s\cdot\frac{n(s)}{36}=\frac{1}{36}\big(2\cdot1+3\cdot2+4\cdot3+5\cdot4+6\cdot5+7\cdot6+8\cdot5+9\cdot4+10\cdot3+11\cdot2+12\cdot1\big) $$Evaluating the expression in parentheses gives $2+6+12+20+30+42+40+36+30+22+12=252$, so $E(X)=\dfrac{252}{36}=7$.
(Alternative solution: a shortcut using the linearity of the expected value. By Example 14.1, the expected value of the number on one die is $E(X_1)=E(X_2)=\frac72$. The expected value of a sum of two random variables equals the sum of their expected values ($E(X_1+X_2)=E(X_1)+E(X_2)$; this is the property that averaging each random variable separately and then adding gives the same result as adding first and then averaging, and although it is not proved in this chapter, it can be verified by algebra alone if you actually regroup the table of the $36$ cases by their sums), so we obtain $E(X)=\frac72+\frac72=7$, the same result with a far shorter computation.)
(Python check: enumerating all 36 pairs and taking the sum gives a result that agrees with $E(X)=7$ in exact fractions.)
Exercise 14.2: Expected value and spread of a random variable taking three values (Advanced)
Solution
(a) Since $X$ takes the values $2,5,9$ with probability $\frac13$ each, Definition 14.1 (the formula in Chapter 14) gives
$$ E(X)=2\cdot\frac13+5\cdot\frac13+9\cdot\frac13=\frac{2+5+9}{3}=\frac{16}{3} $$This is the expected value.
(b) The values taken by $X^2$ are $X^2=4,25,81$, corresponding to $X=2,5,9$ respectively, and each has the same probability $\frac13$ as for $X$ (because the event “$X=2$” and the event “$X^2=4$” are exactly the same event in this problem, where $X$ takes only positive values). Hence we have
$$ E(X^2)=4\cdot\frac13+25\cdot\frac13+81\cdot\frac13=\frac{4+25+81}{3}=\frac{110}{3} $$This is the expected value of the square.
(c) The variance is properly defined as “the expected value of the square of how far each value is from the expected value,” namely
$$ V(X)=E\big[(X-E(X))^2\big] $$Here $E(X)$ is a constant (once $X$ is given, it has already been determined to be a single value), so when we expand the right-hand side we may compute term by term using the linearity of the expected value ($E(A+B)=E(A)+E(B)$, $E(cA)=cE(A)$, where $c$ is a constant).
$$ E\big[(X-E(X))^2\big]=E\big(X^2-2X\cdot E(X)+\{E(X)\}^2\big)=E(X^2)-2E(X)\cdot E(X)+\{E(X)\}^2=E(X^2)-\{E(X)\}^2 $$(The first term is simply $E(X^2)$; for the second term, since $E(X)$ is a constant, $E\big(2X\cdot E(X)\big)=2E(X)\cdot E(X)=2\{E(X)\}^2$; the third term $\{E(X)\}^2$ is also a constant, so $E\big(\{E(X)\}^2\big)=\{E(X)\}^2$ exactly. Combining these gives $E(X^2)-2\{E(X)\}^2+\{E(X)\}^2=E(X^2)-\{E(X)\}^2$.) Thus, not by fiat but from the definition as the “squared spread around the expected value,” we derive the formula that is convenient for computation:
$$ V(X)=E(X^2)-\{E(X)\}^2 $$Substituting the results $E(X)=\frac{16}{3}$ and $E(X^2)=\frac{110}{3}$ from (a) and (b), we obtain
$$ V(X)=E(X^2)-\{E(X)\}^2=\frac{110}{3}-\left(\frac{16}{3}\right)^2=\frac{110}{3}-\frac{256}{9}=\frac{330}{9}-\frac{256}{9}=\frac{74}{9} $$This is the variance. (Exact-fraction computation in Python has been confirmed to agree with $E(X)=16/3$, $E(X^2)=110/3$, and $V(X)=74/9$. It has also been confirmed in Python that computing directly from the defining expression $E[(X-E(X))^2]=\sum_k(x_k-E(X))^2\cdot\frac13$ gives the same $74/9$.) The value $V(X)=\frac{74}{9}\approx8.22$ means that the values of $X$ are scattered around the expected value $\frac{16}{3}\approx5.33$ with a spread (the standard deviation) of roughly $\sqrt{8.22}\approx2.87$. The three values $2,5,9$ are about $3.33,0.33,3.67$ away from the expected value, respectively, which is also roughly consistent with this order of magnitude.
Exercise 14.3: Normalization constant and expected value of a density function
Solution
(a) Substituting $P(x)=cx$ into the normalization condition (the formula in Chapter 14) $\displaystyle\int_0^2 P(x)\,dx=1$ gives
$$ \int_0^2 cx\,dx=c\left[\frac{x^2}{2}\right]_0^2=c\cdot\frac{4}{2}=2c $$This must equal $1$, so $2c=1$, that is,
$$ c=\frac12 $$This is the normalization constant. (We also check that $P(x)=\frac12 x$ indeed satisfies $P(x)\ge0$ for $0\le x\le2$.)
(b) Substituting $P(x)=\frac12 x$ into the definition of the expected value (the formula in Chapter 14), we obtain
$$ E=\int_0^2 x\cdot\frac12 x\,dx=\frac12\int_0^2 x^2\,dx=\frac12\left[\frac{x^3}{3}\right]_0^2=\frac12\cdot\frac83=\frac43 $$This is the expected value. (SymPy check: both $c=1/2$ and $E=4/3$ agree as exact fractions.) The midpoint of the interval $[0,2]$ is $1$, but because the density grows larger toward the right side (nearer $x=2$), the expected value $\frac43\approx1.33$ lies to the right of the midpoint—this is in accordance with the property stated in Example 14.7, “the expected value is pulled toward the side where the density is higher.”
Exercise 14.4: Practice with the Riemann-sum method ($f(x)=x^2$)
Solution
We regard the sum $\displaystyle\sum_{k=1}^{n}\left(\frac kn\right)^2\cdot\frac1n$ as the sum $\displaystyle\sum_{k=1}^n f\!\left(\frac kn\right)\frac1n$ in Formula 14.1 for the case $L=1$, $f(x)=x^2$. Hence
$$ \lim_{n\to\infty}\sum_{k=1}^{n}\left(\frac{k}{n}\right)^2\cdot\frac1n=\int_0^1 x^2\,dx=\left[\frac{x^3}{3}\right]_0^1=\frac13 $$This is the value of the limit.
Cross-check (an alternative solution by computing the sum directly). Using the formula from high school mathematics $\displaystyle\sum_{k=1}^n k^2=\frac{n(n+1)(2n+1)}{6}$, we have
$$ \sum_{k=1}^{n}\left(\frac kn\right)^2\frac1n=\frac{1}{n^3}\sum_{k=1}^n k^2=\frac{1}{n^3}\cdot\frac{n(n+1)(2n+1)}{6}=\frac{(n+1)(2n+1)}{6n^2}=\frac{2n^2+3n+1}{6n^2} $$As $n\to\infty$, dividing the numerator and the denominator by $n^2$ gives $\dfrac{2+3/n+1/n^2}{6}\to\dfrac26=\dfrac13$, which agrees exactly with the result from the Riemann-sum method. (SymPy check: simplifying summation(k**2,(k,1,n))/n**3 gives $\frac{(n+1)(2n+1)}{6n^2}$, and its limit as $n\to\infty$ is exactly $1/3$.)
Exercise 14.5: Mean lifetime and half-life of radioactive decay
Solution
(a) Using the result $E=\dfrac1\lambda$ of Example 14.8 as it stands, the mean lifetime is
$$ \tau=E(T)=\frac1\lambda $$This is the mean lifetime.
(b) By definition, the half-life is the time at which the number of atoms (the survival probability) is halved. The probability of surviving without decay until time $t$ is, by the properties of the exponential distribution, $1-\int_0^t P(s)\,ds=e^{-\lambda t}$ (indeed, $\int_0^t\lambda e^{-\lambda s}\,ds=\big[-e^{-\lambda s}\big]_0^t=1-e^{-\lambda t}$ is the probability that the atom has finished decaying by time $t$, so the probability of its complementary event is $e^{-\lambda t}$). The time at which this becomes $\frac12$ is the half-life, so we need only solve the equation
$$ e^{-\lambda T_{1/2}}=\frac12 $$Taking the natural logarithm of both sides gives $-\lambda T_{1/2}=\ln\frac12=-\ln2$ ($\ln\frac12=\ln1-\ln2=-\ln2$), so we obtain
$$ T_{1/2}=\frac{\ln2}{\lambda} $$This is the half-life. Rewriting it using $\tau=1/\lambda$ from (a), we obtain
$$ T_{1/2}=\tau\ln2\approx0.693\,\tau $$This is the relation between the half-life and the mean lifetime. The half-life is shorter than the mean lifetime (about $69.3\%$ of it)—this reflects the fact that the exponential distribution is asymmetric, and the fraction of atoms that “decay early” is larger than the fraction that “live much longer than average.”
(c) When $\tau=10$, we have $\lambda=1/\tau=1/10$, and
$$ T_{1/2}=\tau\ln2=10\ln2\approx10\times0.6931=6.931 $$This is the half-life. (SymPy check: tau=1/lam and T_half=log(2)/lam both agree as functions of $\lambda$, and for $\lambda=1/10$ we get $T_{1/2}=10\ln2\approx6.9315$.)
Exercise 14.6: Comparing the expected values of the uniform and triangular distributions
Solution
(a) Integrating $P(x)=\dfrac2L\left(1-\dfrac xL\right)$ ($0\le x\le L$) over $[0,L]$ gives
$$ \int_0^L \frac2L\left(1-\frac xL\right)dx=\frac2L\int_0^L\left(1-\frac xL\right)dx=\frac2L\left[x-\frac{x^2}{2L}\right]_0^L=\frac2L\left(L-\frac L2\right)=\frac2L\cdot\frac L2=1 $$so the normalization condition $\int_0^L P(x)\,dx=1$ is indeed satisfied. (We can also confirm that the maximum value $P(0)=\frac2L$ is attained at $x=0$, that $P(L)=0$ at $x=L$, and that the density decreases linearly.)
(b) By the definition of the expected value (the formula in Chapter 14),
$$ E=\int_0^L x\cdot\frac2L\left(1-\frac xL\right)dx=\frac2L\int_0^L\left(x-\frac{x^2}{L}\right)dx=\frac2L\left[\frac{x^2}{2}-\frac{x^3}{3L}\right]_0^L=\frac2L\left(\frac{L^2}{2}-\frac{L^2}{3}\right)=\frac2L\cdot\frac{L^2}{6}=\frac L3 $$Compared with the expected value $\frac L2$ of the uniform distribution (Example 14.6), the expected value $\frac L3$ of the triangular distribution is smaller: $\dfrac L3\lt\dfrac L2$. (SymPy check: both the normalization integral and the expected value agree exactly for general $L$.)
(c) This result is perfectly consistent with the property stated in Example 14.7, “the expected value is pulled toward the side where the density is higher.” For the triangular distribution (ii), the density is largest near $x=0$ ($P(0)=\frac2L$) and becomes smaller the closer we get to $x=L$ ($P(L)=0$). In other words, this is a distribution in which “smaller values of $x$ are more likely to occur,” and indeed the expected value $\frac L3$ is pulled toward the side smaller than the midpoint $\frac L2$ of the uniform distribution (the side nearer $x=0$). Conversely, the density $P(x)=\frac{2}{L^2}x$ of Example 14.7 is large on the $x=L$ side, and its expected value $\frac{2L}{3}$ was pulled toward the side larger than the midpoint. Comparing with Figure 14.4 (uniform distribution; the expected value is the midpoint), we can confirm from these two opposite examples (a linearly increasing density and a linearly decreasing density) that the position of the expected value shifts from the midpoint toward whichever side the “peak” of the density graph lies on.
← Back to Chapter 14, “Expected Value — From Discrete to Continuous”
Chapter 15 Inner Products and Cross Products of Vectors
Exercise 15.1: Unit vector
Solution
The magnitude of $\vec a=(1,2,2)$ is the square root of the sum of the squares of its components, so we have
$$ \abs{\vec a}=\sqrt{1^2+2^2+2^2}=\sqrt{1+4+4}=\sqrt9=3 $$Therefore, by the formula in Chapter 15 ($\vec e=\vec a/\abs{\vec a}$), the unit vector is
$$ \vec e=\frac13(1,2,2)=\left(\frac13,\frac23,\frac23\right) $$As a check, computing the magnitude gives $\abs{\vec e}=\sqrt{\left(\frac13\right)^2+\left(\frac23\right)^2+\left(\frac23\right)^2}=\sqrt{\frac19+\frac49+\frac49}=\sqrt{\frac99}=\sqrt1=1$, so it is indeed a unit vector. (SymPy check: $\abs{\vec a}=3$, $\vec e=(1/3,2/3,2/3)$, $\abs{\vec e}=1$.)
Exercise 15.2: Inner product and the angle between vectors
Solution
The inner product of $\vec a=(2,1)$ and $\vec b=(-1,3)$ is, by Definition 15.4 (component expression),
$$ \vec a\cdot\vec b=2\times(-1)+1\times3=-2+3=1 $$Also, the magnitudes are, respectively,
$$ \abs{\vec a}=\sqrt{2^2+1^2}=\sqrt5,\qquad \abs{\vec b}=\sqrt{(-1)^2+3^2}=\sqrt{10} $$Hence, by Theorem 15.1 (geometric expression),
$$ \cos\theta=\frac{\vec a\cdot\vec b}{\abs{\vec a}\abs{\vec b}}=\frac{1}{\sqrt5\times\sqrt{10}}=\frac{1}{\sqrt{50}}=\frac{1}{5\sqrt2}=\frac{\sqrt2}{10} $$(The denominator has been rationalized.) Numerically, $\cos\theta\approx0.1414$, and $\theta=\cos^{-1}\left(\dfrac{\sqrt2}{10}\right)\approx81.9^\circ$. (SymPy check: $\vec a\cdot\vec b=1$, $\cos\theta=\sqrt2/10$.)
Exercise 15.3 (Advanced): The scalar triple product and volume
Solution
First, we find $\vec b\times\vec c$ from the component formula $\vec b\times\vec c=(b_2c_3-b_3c_2,\ b_3c_1-b_1c_3,\ b_1c_2-b_2c_1)$ of Theorem 15.6, substituting $\vec b=(0,1,0)$ and $\vec c=(0,0,1)$.
$$ \vec b\times\vec c=(1\times1-0\times0,\ 0\times0-0\times1,\ 0\times0-1\times0)=(1,0,0) $$(Coincidentally, this is exactly the same vector as $\vec a$ itself—considering that $\vec b,\vec c$ are two edges of the unit cube and that, when we turn from $\vec b$ to $\vec c$ according to the right-hand screw rule, the screw advances in the positive direction of the $x$-axis, this is nothing other than $\vec j\times\vec k=\vec i$ of Theorem 15.4(VI).) Next, we compute $\vec a\cdot(\vec b\times\vec c)$ using Definition 15.4 (component expression of the inner product).
$$ \vec a\cdot(\vec b\times\vec c)=(1,0,0)\cdot(1,0,0)=1\times1+0\times0+0\times0=1 $$On the other hand, $\vec a,\vec b,\vec c$ are edges of length 1 pointing in the directions of the $x,y,z$ axes, respectively, and they are mutually orthogonal, so the parallelepiped having them as its three edges is a cube with edge length 1 (the unit cube). Its volume is obviously $1\times1\times1=1$, which agrees exactly with the value of the scalar triple product found above, $\vec a\cdot(\vec b\times\vec c)=1$. (In general, the absolute value of the scalar triple product $\vec a\cdot(\vec b\times\vec c)$ is equal to the volume of the parallelepiped having $\vec a,\vec b,\vec c$ as its three edges, and moreover it is also equal to the determinant of the $3\times3$ matrix whose rows are the three vectors—this problem is the simplest example of that. SymPy check: $\vec a\cdot(\vec b\times\vec c)=1=\det\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}$.)
Exercise 15.4: Proof of the anticommutative law for general components
Solution
By Theorem 15.6 (the formula in Chapter 15), the cross product of $\vec A=(a_1,a_2,a_3)$ and $\vec B=(b_1,b_2,b_3)$ is
$$ \vec A\times\vec B=(a_2b_3-a_3b_2,\ a_3b_1-a_1b_3,\ a_1b_2-a_2b_1) $$Interchanging the roles of $\vec A,\vec B$ in the same formula, we get
$$ \vec B\times\vec A=(b_2a_3-b_3a_2,\ b_3a_1-b_1a_3,\ b_1a_2-b_2a_1) $$Comparing the components, the first component is $b_2a_3-b_3a_2=-(a_2b_3-a_3b_2)$, the second is $b_3a_1-b_1a_3=-(a_3b_1-a_1b_3)$, and the third is $b_1a_2-b_2a_1=-(a_1b_2-a_2b_1)$ (by the commutative law of multiplication of real numbers, $a_ib_j=b_ja_i$, each is merely the corresponding component of $\vec A\times\vec B$ with its sign flipped), and each of them is exactly the corresponding component of $\vec A\times\vec B$ multiplied by $-1$. Therefore, we have confirmed by computation with components that
$$ \vec B\times\vec A=-(\vec A\times\vec B) $$This is exactly the same conclusion as Theorem 15.3, which we proved geometrically in Section 15.3 from the sense of rotation (the right-hand screw rule), and it confirms that two different routes (a geometric argument and an algebraic computation with components) reach the same result. (SymPy check: computing $\vec A\times\vec B+\vec B\times\vec A$ with the symbols $a_1,\ldots,b_3$ left as they are gives identically $\vec 0$.)
Exercise 15.5: Area of a triangle formed by three points
Solution
Let $P(0,0)$, $Q(4,0)$, and $R(2,5)$. Let $\vec u=\vec{PQ}=(4-0,0-0)=(4,0)$ and $\vec v=\vec{PR}=(2-0,5-0)=(2,5)$. Following the same approach as in Example 15.6, we use Theorem 15.5 (component expression of the cross product for vectors in a plane) to find that the area of the parallelogram spanned by $\vec u,\vec v$ is
$$ S_{\text{parallelogram}}=\abs{u_1v_2-u_2v_1}=\abs{4\times5-0\times2}=\abs{20-0}=20 $$Triangle $PQR$ is the figure obtained by cutting this parallelogram in half along a diagonal, so
$$ S_{\triangle PQR}=\frac12\times20=10 $$(SymPy check: $u_1v_2-u_2v_1=20$, area $=10$.)
Exercise 15.6: Does the cross product satisfy the associative law?
Solution
We use Theorem 15.4(VI) ($\vec i\times\vec i=\vec 0$, $\vec i\times\vec j=\vec k$, $\vec k\times\vec i=\vec j$). First we compute $(\vec i\times\vec i)\times\vec j$. Since $\vec i\times\vec i=\vec 0$, we have
$$ (\vec i\times\vec i)\times\vec j=\vec 0\times\vec j=\vec 0 $$(Theorem 15.4(I): the cross product with the zero vector is the zero vector.) Next we compute $\vec i\times(\vec i\times\vec j)$. Since $\vec i\times\vec j=\vec k$, we have
$$ \vec i\times(\vec i\times\vec j)=\vec i\times\vec k $$Here, Theorem 15.4(VI) gives $\vec k\times\vec i=\vec j$, so using Theorem 15.3 (anticommutative law) in the form $\vec i\times\vec k=-(\vec k\times\vec i)=-\vec j$, we obtain
$$ \vec i\times(\vec i\times\vec j)=-\vec j $$From the above, we have
$$ (\vec i\times\vec i)\times\vec j=\vec 0,\qquad \vec i\times(\vec i\times\vec j)=-\vec j $$and since $\vec j\neq\vec 0$, these two do not agree. Therefore, this concrete example is a counterexample, and we conclude that, in general, for the cross product $\times$ the associative law
$$ (\vec a\times\vec b)\times\vec c=\vec a\times(\vec b\times\vec c) $$does not hold (note that, unlike the inner product or the multiplication of real numbers, for the cross product the result can change depending on “which to compute first”). (numpy check: $(\vec i\times\vec i)\times\vec j=(0,0,0)$, $\vec i\times(\vec i\times\vec j)=(0,-1,0)=-\vec j$. Note that $(\vec i\times\vec j)\times\vec k=\vec k\times\vec k=\vec 0$ and $\vec i\times(\vec j\times\vec k)=\vec i\times\vec i=\vec 0$ happen to both equal $\vec 0$ in this case and cannot be told apart, so in this solution we used the triple $\vec i,\vec i,\vec j$, for which the two sides can be told apart, as the counterexample.)
← Back to Chapter 15, “Inner Products and Cross Products of Vectors”
Chapter 16 Coordinate Systems and Basis Vectors
Exercise 16.1: Converting from cylindrical to rectangular coordinates
Solution
Substitute $r=5,\ \varphi=\dfrac{2\pi}{3},\ z=-2$ into Formula 16.6 ($x=r\cos\varphi,\ y=r\sin\varphi,\ z=z$). Since $\varphi=2\pi/3$ is an angle in the second quadrant, we have $\cos\dfrac{2\pi}{3}=-\dfrac12$ and $\sin\dfrac{2\pi}{3}=\dfrac{\sqrt3}{2}$ (because $\dfrac{2\pi}{3}=\pi-\dfrac\pi3$, we find $\cos\left(\pi-\dfrac\pi3\right)=-\cos\dfrac\pi3=-\dfrac12$ and $\sin\left(\pi-\dfrac\pi3\right)=\sin\dfrac\pi3=\dfrac{\sqrt3}{2}$). Therefore,
$$ x=5\times\left(-\frac12\right)=-\frac52,\qquad y=5\times\frac{\sqrt3}{2}=\frac{5\sqrt3}{2},\qquad z=-2 . $$Hence the rectangular coordinates are $\left(-\dfrac52,\ \dfrac{5\sqrt3}{2},\ -2\right)$. (SymPy check: $(-5/2,\ 5\sqrt3/2,\ -2)$.)
Exercise 16.2: Converting from spherical to rectangular coordinates
Solution
Substitute $R=3,\ \theta=\dfrac\pi4,\ \varphi=\dfrac\pi2$ into Formula 16.10 ($x=R\sin\theta\cos\varphi,\ y=R\sin\theta\sin\varphi,\ z=R\cos\theta$). Since $\sin\dfrac\pi4=\cos\dfrac\pi4=\dfrac{1}{\sqrt2}$ and $\cos\dfrac\pi2=0,\ \sin\dfrac\pi2=1$,
$$ x=3\times\frac{1}{\sqrt2}\times0=0,\qquad y=3\times\frac{1}{\sqrt2}\times1=\frac{3}{\sqrt2}=\frac{3\sqrt2}{2},\qquad z=3\times\frac{1}{\sqrt2}=\frac{3\sqrt2}{2} . $$Hence the rectangular coordinates are $\left(0,\ \dfrac{3\sqrt2}{2},\ \dfrac{3\sqrt2}{2}\right)$. The reason that $x=0$ is that $\varphi=\pi/2$ is exactly the direction of the $y$-axis ($90°$ from the $x$-axis), so this makes sense. (SymPy check: $(0,\ 3\sqrt2/2,\ 3\sqrt2/2)$.)
Exercise 16.3: Rotation about the $y$-axis
Solution
Substituting $\theta=\dfrac\pi2$ ($\cos\dfrac\pi2=0,\ \sin\dfrac\pi2=1$) into $R_y(\theta)=\begin{bmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{bmatrix}$ of Theorem 16.3, we obtain
$$ R_y\!\left(\frac\pi2\right)=\begin{bmatrix}0&0&1\\0&1&0\\-1&0&0\end{bmatrix} . $$Applying this to the point $(1,0,1)$ (the column vector $[1,0,1]^{\mathrm T}$), we get
$$ R_y\!\left(\frac\pi2\right)\begin{bmatrix}1\\0\\1\end{bmatrix}=\begin{bmatrix}0\times1+0\times0+1\times1\\0\times1+1\times0+0\times1\\-1\times1+0\times0+0\times1\end{bmatrix}=\begin{bmatrix}1\\0\\-1\end{bmatrix} . $$Hence the image is $(1,0,-1)$. Caution: if one mistakenly used the signs exactly as in the original notes (the $(1,3)$ entry of $R_y(\theta)$ being $-\sin\theta$ and the $(3,1)$ entry being $+\sin\theta$), one would end up with a different answer, $(-1,0,1)$. As we confirmed in the “Caution” immediately after Theorem 16.3, it is important to use the form of $R_y(\theta)$ adopted in this chapter (the $(1,3)$ entry being $+\sin\theta$), whose sign pattern is aligned cyclically with the rotation matrices about the $x$-axis and the $z$-axis. (SymPy check: $(1,0,-1)$.)
Exercise 16.4: Confirming that the spherical basis vectors form a right-handed system
Solution
By Formula 16.12, $\vec e_R=[\sin\theta\cos\varphi,\ \sin\theta\sin\varphi,\ \cos\theta]$ and $\vec e_\theta=[\cos\theta\cos\varphi,\ \cos\theta\sin\varphi,\ -\sin\theta]$. Substitute the components of $\vec a=\vec e_R,\ \vec b=\vec e_\theta$ into the component formula for the cross product learned in the previous chapter, $\vec a\times\vec b=[a_2b_3-a_3b_2,\ a_3b_1-a_1b_3,\ a_1b_2-a_2b_1]$.
First component:
$$ a_2b_3-a_3b_2=(\sin\theta\sin\varphi)(-\sin\theta)-(\cos\theta)(\cos\theta\sin\varphi)=-\sin\varphi(\sin^2\theta+\cos^2\theta)=-\sin\varphi . $$Second component:
$$ a_3b_1-a_1b_3=(\cos\theta)(\cos\theta\cos\varphi)-(\sin\theta\cos\varphi)(-\sin\theta)=\cos\varphi(\cos^2\theta+\sin^2\theta)=\cos\varphi . $$Third component:
$$ a_1b_2-a_2b_1=(\sin\theta\cos\varphi)(\cos\theta\sin\varphi)-(\sin\theta\sin\varphi)(\cos\theta\cos\varphi)=\sin\theta\cos\theta\sin\varphi\cos\varphi-\sin\theta\cos\theta\sin\varphi\cos\varphi=0 . $$Therefore, we obtain
$$ \vec e_R\times\vec e_\theta=[-\sin\varphi,\ \cos\varphi,\ 0] $$This coincides exactly with $\vec e_\varphi=-\sin\varphi\,\vec e_x+\cos\varphi\,\vec e_y=[-\sin\varphi,\cos\varphi,0]$ in Formula 16.12. Thus $\vec e_R\times\vec e_\theta=\vec e_\varphi$ has been verified at the level of components. All three products can be verified in the same way, so $\vec e_R,\vec e_\theta,\vec e_\varphi$ form a right-handed system. (Checked with SymPy.)
Exercise 16.5: Velocity and acceleration in circular motion with a varying radius
Solution
Differentiating $r(t)=r_0(1+\varepsilon\sin\omega t)$ with respect to time (since $r_0,\varepsilon,\omega$ are constants, the only part that gets differentiated is $\sin\omega t$), we obtain
$$ \dot r=r_0\varepsilon\omega\cos\omega t,\qquad \ddot r=-r_0\varepsilon\omega^2\sin\omega t . $$Also, since $\theta(t)=\omega t$, we have $\dot\theta=\omega$ (a constant) and $\ddot\theta=0$. Substituting into Formula 16.16 gives
$$ V_r=\dot r=r_0\varepsilon\omega\cos\omega t, $$ $$ V_\theta=r\dot\theta=r_0(1+\varepsilon\sin\omega t)\,\omega=r_0\omega+r_0\varepsilon\omega\sin\omega t . $$Substituting into Formula 16.17 gives
$$ A_r=\ddot r-r\dot\theta^2=-r_0\varepsilon\omega^2\sin\omega t-r_0(1+\varepsilon\sin\omega t)\,\omega^2 $$ $$ =-r_0\varepsilon\omega^2\sin\omega t-r_0\omega^2-r_0\varepsilon\omega^2\sin\omega t=-r_0\omega^2-2r_0\varepsilon\omega^2\sin\omega t=-r_0\omega^2(1+2\varepsilon\sin\omega t), $$ $$ A_\theta=2\dot r\dot\theta+r\ddot\theta=2(r_0\varepsilon\omega\cos\omega t)(\omega)+r_0(1+\varepsilon\sin\omega t)\times0=2r_0\varepsilon\omega^2\cos\omega t . $$As a check, setting $\varepsilon=0$ ($r=r_0$ constant) gives $V_r=0,\ V_\theta=r_0\omega,\ A_r=-r_0\omega^2,\ A_\theta=0$, which agrees exactly with the result of Example 16.9 (with $a\to r_0$). (Checked with SymPy.)
Exercise 16.6: The partial derivatives of $\vec e_\varphi$
Solution
By Formula 16.12, $\vec e_\varphi=-\sin\varphi\,\vec e_x+\cos\varphi\,\vec e_y$ (it has no $\vec e_z$ component and does not contain $\theta$).
For $\partial\vec e_\varphi/\partial\theta$: Since $\theta$ does not appear on the right-hand side at all, taking the partial derivative with respect to $\theta$ makes every term 0.
$$ \frac{\partial\vec e_\varphi}{\partial\theta}=\frac{\partial}{\partial\theta}\big(-\sin\varphi\,\vec e_x+\cos\varphi\,\vec e_y\big)=0 . $$For $\partial\vec e_\varphi/\partial\varphi$: Taking the partial derivative with respect to $\varphi$, we get
$$ \frac{\partial\vec e_\varphi}{\partial\varphi}=-\cos\varphi\,\vec e_x-\sin\varphi\,\vec e_y . $$We want to express this in terms of $\vec e_R,\vec e_\theta$ (a combination with no $\vec e_z$ component). By Formula 16.12 we have
$$ \vec e_R=\sin\theta\cos\varphi\,\vec e_x+\sin\theta\sin\varphi\,\vec e_y+\cos\theta\,\vec e_z,\qquad \vec e_\theta=\cos\theta\cos\varphi\,\vec e_x+\cos\theta\sin\varphi\,\vec e_y-\sin\theta\,\vec e_z $$Computing $-\sin\theta\,\vec e_R-\cos\theta\,\vec e_\theta$, we get
$$ -\sin\theta\,\vec e_R-\cos\theta\,\vec e_\theta=-\sin\theta(\sin\theta\cos\varphi\,\vec e_x+\sin\theta\sin\varphi\,\vec e_y+\cos\theta\,\vec e_z)-\cos\theta(\cos\theta\cos\varphi\,\vec e_x+\cos\theta\sin\varphi\,\vec e_y-\sin\theta\,\vec e_z) $$ $$ =-(\sin^2\theta+\cos^2\theta)\cos\varphi\,\vec e_x-(\sin^2\theta+\cos^2\theta)\sin\varphi\,\vec e_y+(-\sin\theta\cos\theta+\cos\theta\sin\theta)\vec e_z $$ $$ =-\cos\varphi\,\vec e_x-\sin\varphi\,\vec e_y+0\cdot\vec e_z . $$This coincides exactly with the result computed for $\partial\vec e_\varphi/\partial\varphi$ (including the fact that the $\vec e_z$ components cancel to give 0). Therefore, we obtain
$$ \frac{\partial\vec e_\varphi}{\partial\theta}=0,\qquad \frac{\partial\vec e_\varphi}{\partial\varphi}=-\sin\theta\,\vec e_R-\cos\theta\,\vec e_\theta $$Thus both relations have been derived. (Checked with SymPy.)
← Back to Chapter 16, “Coordinate Systems and Basis Vectors”
Chapter 17 Calculus of Vector-Valued Functions
Exercise 17.1: Differentiation of vector-valued functions
Solution
We differentiate each component of $\vec f(t)=[\,t^3-t,\ e^{2t},\ \ln(t+1)\,]$ with respect to $t$, following Definition 17.1.
First component: $\dfrac{d}{dt}(t^3-t)=3t^2-1$ (we used the differentiation formula for power functions on each term).
Second component: $\dfrac{d}{dt}e^{2t}=2e^{2t}$ (chain rule, $\dfrac{d}{dt}e^{kt}=ke^{kt}$).
Third component: $\dfrac{d}{dt}\ln(t+1)=\dfrac{1}{t+1}$ (chain rule, $\dfrac{d}{dt}\ln u=\dfrac{u'}{u}$ with $u=t+1,\ u'=1$).
Therefore,
$$ \vec f\,'(t) = \left[\,3t^2-1,\ \ 2e^{2t},\ \ \frac{1}{t+1}\,\right] $$Substituting $t=0$, we obtain
$$ \vec f\,'(0) = \left[\,3\cdot0^2-1,\ \ 2e^{0},\ \ \frac{1}{0+1}\,\right] = [\,-1,\ 2,\ 1\,] $$(differentiation verified with SymPy).
Exercise 17.2: Length of a helix
Solution
Differentiating $\vec f(t)=[\,3\cos t,\ 3\sin t,\ 4t\,]$ with respect to $t$ gives
$$ \vec f\,'(t) = [\,-3\sin t,\ \ 3\cos t,\ \ 4\,] $$Its magnitude is
$$ \abs{\vec f\,'(t)} = \sqrt{(-3\sin t)^2+(3\cos t)^2+4^2} = \sqrt{9\sin^2t+9\cos^2t+16} = \sqrt{9(\sin^2t+\cos^2t)+16} $$(we factored the common factor $9$ out of $9\sin^2t$ and $9\cos^2t$). Using $\sin^2t+\cos^2t=1$ (a basic formula from high school mathematics), we obtain
$$ \abs{\vec f\,'(t)} = \sqrt{9\cdot1+16} = \sqrt{25} = 5 $$which is a constant independent of $t$. By Definition 17.2 (the formula in Chapter 17),
$$ S = \int_0^{2\pi}\abs{\vec f\,'(t)}\,dt = \int_0^{2\pi}5\,dt = 5\times[\,t\,]_0^{2\pi} = 5\times2\pi = 10\pi $$($10\pi\fallingdotseq31.4$; verified with SymPy).
Exercise 17.3: Computing a definite integral
Solution
Following Definition 17.4, we compute the definite integral component by component.
First component: $\displaystyle\int_0^1t^2\,dt=\left[\frac{t^3}{3}\right]_0^1=\frac13-0=\frac13$ (the integration formula for power functions).
Second component: $\displaystyle\int_0^1e^t\,dt=[\,e^t\,]_0^1=e^1-e^0=e-1$ (the integration formula for the exponential function).
Third component: $\displaystyle\int_0^1\frac{1}{1+t^2}\,dt=[\,\tan^{-1}t\,]_0^1=\tan^{-1}1-\tan^{-1}0=\frac{\pi}{4}-0=\frac{\pi}{4}$ (we used the derivative of the inverse tangent function from Chapter 3, $\dfrac{d}{dt}\tan^{-1}t=\dfrac{1}{1+t^2}$, in reverse. The value $\tan^{-1}1=\pi/4$ follows from $\tan(\pi/4)=1$).
Therefore, the integral equals
$$ \int_0^1\left[\,t^2,\ e^t,\ \frac{1}{1+t^2}\,\right]dt = \left[\,\frac13,\ \ e-1,\ \ \frac{\pi}{4}\,\right] $$($\frac13\fallingdotseq0.333$, $e-1\fallingdotseq1.718$, $\pi/4\fallingdotseq0.785$; verified with SymPy).
Exercise 17.4: Applying the integration by parts formula
Solution
Differentiating $\vec a(t)=[\,e^t,\ t^2\,]$ gives $\vec a\,'(t)=[\,e^t,\ 2t\,]$. Taking $f(t)=t$ (so that $f'(t)=1$) and substituting into Formula 17.2(I), we obtain
$$ \int t\,\vec a\,'(t)\,dt = t\,\vec a(t) - \int 1\cdot\vec a(t)\,dt = t[\,e^t,\ t^2\,] - \int[\,e^t,\ t^2\,]\,dt $$Computing the indefinite integral $\displaystyle\int\vec a(t)\,dt$ component by component, we have $\displaystyle\int e^t\,dt=e^t+C_1$ and $\displaystyle\int t^2\,dt=\frac{t^3}{3}+C_2$, so that
$$ \int t\,\vec a\,'(t)\,dt = [\,te^t,\ t^3\,] - \left[\,e^t,\ \frac{t^3}{3}\,\right] + \vec C = \left[\,te^t-e^t,\ \ t^3-\frac{t^3}{3}\,\right] + \vec C = \left[\,te^t-e^t,\ \ \frac23t^3\,\right] + \vec C $$(for the second component we combined the terms over a common denominator: $t^3-\dfrac{t^3}{3}=\dfrac{3t^3-t^3}{3}=\dfrac{2t^3}{3}$). As a check, we differentiate this result with respect to $t$. For the first component, the product rule gives $\dfrac{d}{dt}(te^t-e^t)=(e^t+te^t)-e^t=te^t$, and for the second component, $\dfrac{d}{dt}\left(\dfrac23t^3\right)=2t^2$. On the other hand, the original integrand is $t\,\vec a\,'(t)=t[\,e^t,2t\,]=[\,te^t,\ 2t^2\,]$, and the two indeed agree (verified with SymPy).
Exercise 17.5: A first-order linear differential equation for a vector (a case where resonance occurs)
Solution
Since $p(t)=3$ (a constant), we have $\displaystyle\int p\,dt=3t$. We split the equation into its three components and solve them one at a time by variation of parameters (the formula in Chapter 17).
[First component] $y_1'+3y_1=1$. Take the particular solution to be a constant, $y_{1p}=k$; then $3k=1$, so $k=\dfrac13$. The general solution is $y_1(t)=\dfrac13+C_1e^{-3t}$. From the initial condition $y_1(0)=0$ we get $0=\dfrac13+C_1$, so $C_1=-\dfrac13$. Hence $y_1(t)=\dfrac13-\dfrac13e^{-3t}=\dfrac{1-e^{-3t}}{3}$.
[Second component] $y_2'+3y_2=t$. Assuming the particular solution to be $y_{2p}=At+B$ and substituting, we get $A+3(At+B)=t$, that is, $3At+(A+3B)=t$. Comparing coefficients, $3A=1$ gives $A=\dfrac13$, and $A+3B=0$ gives $B=-\dfrac19$. The general solution is $y_2(t)=\dfrac t3-\dfrac19+C_2e^{-3t}$. From the initial condition $y_2(0)=0$ we get $0=-\dfrac19+C_2$, so $C_2=\dfrac19$. Hence $y_2(t)=\dfrac t3-\dfrac19+\dfrac19e^{-3t}$.
[Third component (resonance)] $y_3'+3y_3=e^{-3t}$. The solution of the homogeneous equation $y_3'+3y_3=0$ is $e^{-3t}$ itself, and the nonhomogeneous term $e^{-3t}$ has exactly the same form. A situation like this, in which the nonhomogeneous term has the same form as a solution of the homogeneous equation, is called resonance. In this case, if we assume the particular solution in the usual form of a constant multiple, $Ae^{-3t}$, then the left-hand side becomes identically $0$ the moment we substitute (naturally, since we are substituting a homogeneous solution), and the coefficient $A$ cannot be determined. So we revise our assumption and take the particular solution to be $t$ times this, in the form $y_{3p}=At\,e^{-3t}$. By the product rule, $y_{3p}'=Ae^{-3t}-3Ate^{-3t}$, so substituting into the equation gives
$$ (Ae^{-3t}-3Ate^{-3t})+3(Ate^{-3t}) = Ae^{-3t} = e^{-3t} $$($-3Ate^{-3t}$ and $+3Ate^{-3t}$ canceled each other exactly). Hence $A=1$ and $y_{3p}=te^{-3t}$. The general solution is $y_3(t)=te^{-3t}+C_3e^{-3t}=(t+C_3)e^{-3t}$. From the initial condition $y_3(0)=1$ we get $1=(0+C_3)e^0=C_3$, so $C_3=1$. Hence $y_3(t)=(t+1)e^{-3t}$.
Putting these together, the solution is
$$ \vec y(t) = \left[\ \frac{1-e^{-3t}}{3},\ \ \ \frac t3-\frac19+\frac19e^{-3t},\ \ \ (t+1)e^{-3t}\ \right] $$(verified with SymPy's dsolve. We confirmed that the technique for linear differential equations with constant coefficients learned in Chapters 2 and 3—“assume the particular solution in the same form as the nonhomogeneous term, and multiply by $t$ when it overlaps with a homogeneous solution”—can be used unchanged in the vector case as well).
Exercise 17.6: Lateral area of a cylinder
Solution
Taking the partial derivatives of $\vec P(u,v)=[\,a\cos u,\ a\sin u,\ v\,]$, we get
$$ \pdiff{\vec P}{u} = [\,-a\sin u,\ \ a\cos u,\ \ 0\,],\qquad \pdiff{\vec P}{v} = [\,0,\ \ 0,\ \ 1\,] $$(for $\pdiff{\vec P}{u}$ we differentiated with respect to $u$ with $v$ held fixed, and for $\pdiff{\vec P}{v}$ with respect to $v$ with $u$ held fixed). Using the component formula for the cross product, $\vec u\times\vec v=[\,u_2v_3-u_3v_2,\ u_3v_1-u_1v_3,\ u_1v_2-u_2v_1\,]$ (Chapter 15), with $\vec u=\pdiff{\vec P}{u}=[-a\sin u,a\cos u,0]$ and $\vec v=\pdiff{\vec P}{v}=[0,0,1]$, we compute
$$ \text{First component:}\ a\cos u\cdot1-0\cdot0=a\cos u \qquad \text{Second component:}\ 0\cdot0-(-a\sin u)\cdot1=a\sin u \qquad \text{Third component:}\ (-a\sin u)\cdot0-a\cos u\cdot0=0 $$Hence
$$ \pdiff{\vec P}{u}\times\pdiff{\vec P}{v} = [\,a\cos u,\ \ a\sin u,\ \ 0\,] $$Its magnitude is
$$ \left|\pdiff{\vec P}{u}\times\pdiff{\vec P}{v}\right| = \sqrt{(a\cos u)^2+(a\sin u)^2+0^2} = \sqrt{a^2(\cos^2u+\sin^2u)} = \sqrt{a^2} = a $$(we used $a>0$; we simplified with $\cos^2u+\sin^2u=1$). This is a constant independent of both $u$ and $v$. Substituting into Formula 17.3, we obtain
$$ S = \iint_D\left|\pdiff{\vec P}{u}\times\pdiff{\vec P}{v}\right|\,du\,dv = \int_0^h\!\!\int_0^{2\pi}a\,du\,dv = a\left(\int_0^{2\pi}du\right)\left(\int_0^hdv\right) = a\times2\pi\times h = 2\pi ah $$which confirms that it agrees with the familiar formula “lateral area = circumference of the base $2\pi a$ × height $h$” (verified with SymPy). It also agrees with the intuition that, if we think of the lateral surface of the cylinder as a thin rectangular sheet of paper rolled up, its area is that of a rectangle whose horizontal side is the circumference of the base, $2\pi a$, and whose vertical side is the height, $h$, namely $2\pi ah$.
Exercise 17.7: Why does the cross product point in the normal direction of the surface? (Reasoning from the figure)
Solution
The filled parallelogram in Figure 17.7 is the figure spanned by the two tangent vectors $\pdiff{\vec P}{u}\Delta u$ and $\pdiff{\vec P}{v}\Delta v$ issuing from the point $\vec P(u,v)$. As we saw in the intuition behind the total differential $d\vec P=\pdiff{\vec P}{u}\,du+\pdiff{\vec P}{v}\,dv$ of Definition 17.6 (Section 17.5 of the main text), in the limit $\Delta u,\Delta v\to0$ this parallelogram approaches the tangent plane itself (the plane that touches the surface $\vec P(u,v)$ snugly at the point $\vec P(u,v)$). In other words, the two vectors $\pdiff{\vec P}{u}$ and $\pdiff{\vec P}{v}$ are both vectors contained in this tangent plane.
Now recall the definition of the cross product that we learned in Chapter 15. The cross product $\vec u\times\vec v$ of two vectors $\vec u,\vec v$ is a vector whose direction is perpendicular to both $\vec u$ and $\vec v$ (the direction determined by the right-hand screw rule), and whose magnitude equals the area of the parallelogram spanned by $\vec u,\vec v$.
Here, $\vec u=\pdiff{\vec P}{u}$ and $\vec v=\pdiff{\vec P}{v}$ are both vectors in the tangent plane, so the cross product $\pdiff{\vec P}{u}\times\pdiff{\vec P}{v}$ has a direction perpendicular to both of these two vectors, that is, perpendicular to the tangent plane itself. The direction perpendicular to the plane tangent to the surface is precisely the definition of the normal direction of the surface. Therefore, $\pdiff{\vec P}{u}\times\pdiff{\vec P}{v}$ points in the normal direction of the surface $\vec P(u,v)$. (The fact that the magnitude of this cross product gives the infinitesimal area element was already used in the derivation of Formula 17.3. What is interesting is that a single operation, the cross product, gives exactly the right quantity for both the direction and the magnitude.)
← Back to Chapter 17, “Calculus of Vector-Valued Functions”
Chapter 18 Scalar Fields, Vector Fields, and the Gradient
Exercise 18.1: Computing the values of a scalar field and a vector field
Solution
Following Definitions 18.1 and 18.2, we only need to substitute the coordinates of the point $(2,1,-1)$ directly into $f,\vec F$.
$$ f(2,1,-1) = 2^2+2\cdot1\cdot(-1) = 4-2 = 2 $$ $$ \vec F(2,1,-1) = [\,1+(-1),\ (-1)^2,\ 2\cdot1\,] = [0,\,1,\,2] $$Therefore, $f(2,1,-1)=2$ and $\vec F(2,1,-1)=[0,1,2]$. (verified with SymPy)
Exercise 18.2: Finding a level curve
Solution
First we find the value of $f$ at the point $(1,3)$.
$$ f(1,3) = 1\cdot3 = 3 $$By Definition 18.3, the level curve through the point $(1,3)$ is the set of points satisfying the equation $f(x,y)=3$. Hence the level curve we want is
$$ xy = 3 $$This is a hyperbola with the shape of the graph of inverse proportion, and we can confirm that the point $(1,3)$ lies on it because $1\times3=3$. (verified with SymPy)
Exercise 18.3: Finding a level surface
Solution
We find the value of $f$ at the point $(2,1,3)$.
$$ f(2,1,3) = 2^2-1^2-3 = 4-1-3 = 0 $$By Definition 18.4, the level surface through the point $(2,1,3)$ is given by the equation $f(x,y,z)=0$, that is,
$$ x^2-y^2-z = 0 \qquad\Longleftrightarrow\qquad z = x^2-y^2 $$This is a surface of the form $z=x^2-y^2$. As we learned in Example 6.1 of Chapter 6, it is a surface with a saddle point, curving upward in the $x$-axis direction and downward in the $y$-axis direction (a saddle-shaped surface, resembling a horse's saddle). We can confirm that the point $(2,1,3)$ lies on this surface because $2^2-1^2=4-1=3$. (verified with SymPy)
Exercise 18.4: Finding streamlines
Solution
Since $\vec F=[f,g]=[y,x]$, the equation of the streamlines, $\dfrac{dx}{f}=\dfrac{dy}{g}=\dfrac{dz}{h}$ (Eq. (18.1); in the planar case, omit the $z$ component), becomes
$$ \frac{dx}{y} = \frac{dy}{x} $$Multiplying both sides by $xy$ to clear the denominators gives $x\,dx=y\,dy$. Integrating the two sides separately, we obtain
$$ \int x\,dx = \int y\,dy \quad\Longrightarrow\quad \frac{x^2}{2}+C_1 = \frac{y^2}{2}+C_2 $$Multiplying both sides by $2$ and combining the constants (we rename $2(C_2-C_1)$ as $C$), we get
$$ x^2 - y^2 = C $$Therefore, the streamlines form the family of hyperbolas $x^2-y^2=C$ (for $C=0$, the two lines $y=\pm x$). (Check: if a curve $x(t),y(t)$ satisfies $\dfrac{dx}{dt}=y,\ \dfrac{dy}{dt}=x$, then $\dfrac{d}{dt}(x^2-y^2)=2x\dfrac{dx}{dt}-2y\dfrac{dy}{dt}=2xy-2yx=0$, which confirms that $x^2-y^2$ is constant, independent of $t$. Verified with SymPy.)
Exercise 18.5: Applying the gradient formulas
Solution
(a) $|\vec P|^{-3}$ is the case $n=-3$ of Formula 18.3, so
$$ \nabla|\vec P|^{-3} = (-3)\,|\vec P|^{-3-2}\,\vec P = -3\,|\vec P|^{-5}\,\vec P = -\frac{3\vec P}{|\vec P|^5} $$Let us verify this directly in the case of two variables ($\vec P=[x,y]$). Differentiating $|\vec P|^{-3}=(x^2+y^2)^{-3/2}$ partially with respect to $x$, by the chain rule for composite functions we get
$$ \pdiff{}{x}(x^2+y^2)^{-3/2} = -\frac32(x^2+y^2)^{-5/2}\cdot2x = -3x(x^2+y^2)^{-5/2} = -\frac{3x}{|\vec P|^5} $$The $y$ component is likewise $-\dfrac{3y}{|\vec P|^5}$, so $\nabla|\vec P|^{-3}=\left[-\dfrac{3x}{|\vec P|^5},-\dfrac{3y}{|\vec P|^5}\right]=-\dfrac{3}{|\vec P|^5}[x,y]=-\dfrac{3\vec P}{|\vec P|^5}$, which agrees completely with the result from Formula 18.3.
(b) Let $f=\ln|\vec P|$. Then $\big(\ln|\vec P|\big)^2=f^2$ is the composition of $f$ with the one-variable function $g(u)=u^2$ ($g'(u)=2u$). By Formula 18.1(IV),
$$ \nabla\big(\ln|\vec P|\big)^2 = g'(f)\cdot\nabla f = 2f\cdot\nabla f = 2\ln|\vec P|\cdot\nabla\ln|\vec P| $$Substituting Formula 18.4 ($\nabla\ln|\vec P|=\dfrac{\vec P}{|\vec P|^2}$) here, we get
$$ \nabla\big(\ln|\vec P|\big)^2 = 2\ln|\vec P|\cdot\frac{\vec P}{|\vec P|^2} = \frac{2\ln|\vec P|}{|\vec P|^2}\,\vec P $$(verified with SymPy: this agrees with the direct partial differentiation in the case of two variables)
Exercise 18.6: Geometric meaning of the gradient
Solution
Since $f(x,y)=2x^2+y^2$, we have $\pdiff{f}{x}=4x,\ \pdiff{f}{y}=2y$, and hence
$$ \nabla f = [4x,\,2y] \qquad\therefore\ \nabla f(1,1) = [4,\,2] $$By item (i) of the Summary, the direction in which the value of $f$ increases fastest is the same as the direction of $\nabla f(1,1)=[4,2]$ (as a unit vector, $\left[\dfrac{2}{\sqrt5},\dfrac{1}{\sqrt5}\right]$).
Next, we find the slope of the tangent line to the level curve through the point $(1,1)$, $f(x,y)=f(1,1)=2+1=3$, that is, $2x^2+y^2=3$, by implicit differentiation. Differentiating both sides with respect to $x$ gives
$$ 4x + 2yy' = 0 \quad\Longrightarrow\quad y' = -\frac{4x}{2y} = -\frac{2x}{y} $$At the point $(1,1)$ we have $y'=-\dfrac{2\cdot1}{1}=-2$, so we may take $[1,\,-2]$ as a direction vector of the tangent line.
Check of perpendicularity. The inner product of $\nabla f(1,1)=[4,2]$ and the direction vector $[1,-2]$ is
$$ [4,2]\cdot[1,-2] = 4\cdot1+2\cdot(-2) = 4-4 = 0 $$so the two vectors are indeed orthogonal (as Theorem 18.1 states). (verified with SymPy)
Exercise 18.7: Equation of the tangent plane via the gradient vector
Solution
First we confirm that the point $(2,1,3)$ lies on the surface: $2^2-1^2=4-1=3$, which agrees. Writing the equation of the surface in the form $F(x,y,z)=0$, we have
$$ F(x,y,z) = x^2-y^2-z = 0 $$Following the same procedure as in Example 18.7, we compute $\nabla F$.
$$ \nabla F = \left[\pdiff{F}{x},\,\pdiff{F}{y},\,\pdiff{F}{z}\right] = [\,2x,\ -2y,\ -1\,] $$The normal vector at the point $(2,1,3)$ is
$$ \nabla F(2,1,3) = [\,2\cdot2,\ -2\cdot1,\ -1\,] = [4,\,-2,\,-1] $$From this normal vector and the point $(2,1,3)$ through which the plane passes, the equation of the tangent plane is
$$ 4(x-2)-2(y-1)-(z-3) = 0 $$Expanding the parentheses gives $4x-8-2y+2-z+3=0$, and combining the constant terms, we obtain
$$ 4x-2y-z-3 = 0 $$(verified with SymPy)
← Back to Chapter 18, “Scalar Fields, Vector Fields, and the Gradient”
Chapter 19 Divergence and Curl
Exercise 19.1: Divergence of a polynomial vector field
Solution
We compute the divergence of $\vec F=[x^3,\ y^3,\ z^3]$ according to Definition 19.2. It suffices to differentiate each component partially with respect to its own variable only and add the results. We have $\pdiff{}{x}(x^3)=3x^2$ (differentiation of a power function; since it does not contain $y,z$, there is no need to differentiate with respect to the other variables), and similarly $\pdiff{}{y}(y^3)=3y^2$ and $\pdiff{}{z}(z^3)=3z^2$, so
$$ \operatorname{div}\vec F=3x^2+3y^2+3z^2 . $$(SymPy check: diff(x**3,x)+diff(y**3,y)+diff(z**3,z) = 3*x**2+3*y**2+3*z**2.) As in the result $\operatorname{div}\vec p=$ (the number of dimensions) seen in Illustrations 19.1 and 19.2, we see that for a symmetric vector field whose components all have the same form ($x^3,y^3,z^3$), the divergence is also an expression symmetric in $x,y,z$.
Exercise 19.2: A spherically symmetric harmonic function
Solution
Let $r=\abs{\vec p}=\sqrt{x^2+y^2+z^2}$ ($\vec p=[x,y,z]$); then $f=\dfrac1r=r^{-1}$. As the hint suggests, we show the claim by the shortcut that uses the result of Illustration 19.2 in Section 19.1.
First, substituting $n=-1$ into Chapter 18, Formula 18.3, $\grad(r^n)=nr^{n-2}\vec p$, we obtain
$$ \grad f=\grad(r^{-1})=(-1)\cdot r^{-1-2}\vec p=-r^{-3}\vec p . $$Next, by the definition of the Laplacian (Definition 19.4), $\Delta f=\operatorname{div}(\grad f)$, we have
$$ \Delta f=\operatorname{div}(-r^{-3}\vec p)=-\operatorname{div}(r^{-3}\vec p) $$Now substituting $n=-3$ into the result $\operatorname{div}(r^n\vec p)=(n+3)r^n$ of Illustration 19.2(II), we get
$$ \operatorname{div}(r^{-3}\vec p)=(-3+3)r^{-3}=0\cdot r^{-3}=0 $$(the point of this shortcut is that the coefficient comes out to be exactly $0$). Hence,
$$ \Delta f=-0=0 $$and so $f=1/r$ ($r\neq0$) satisfies Laplace's equation; that is, it is a harmonic function. (SymPy check: simplify(diff(1/sqrt(x**2+y**2+z**2),x,2)+diff(...,y,2)+diff(...,z,2)) = 0.) At $r=0$ (the origin), $f$ itself cannot even be defined (the denominator is $0$), so note that this result is limited to the range $r\neq0$. This function $f=1/r$ appears frequently as the Coulomb potential in electrostatics and as the gravitational potential.
Exercise 19.3: Curl of the position vector field (a recheck)
Solution
For $\vec F=[x,\ y,\ z]$, we substitute $f=x,\ g=y,\ h=z$ into Definition 19.5.
$$ \rot\vec F=\left[\pdiff zy-\pdiff yz,\ \ \pdiff xz-\pdiff zx,\ \ \pdiff yx-\pdiff xy\right] $$Every term is “a partial derivative of one variable with respect to a different variable.” Differentiating $z$ partially with respect to $y$ gives $0$, because $z$ is an independent variable unrelated to $y$; differentiating $y$ partially with respect to $z$ also gives $0$; and so on—all six partial derivatives are $0$. Therefore,
$$ \rot\vec F=[0-0,\ 0-0,\ 0-0]=[0,\ 0,\ 0]=\vec 0 $$and Formula 19.5 ($\rot\vec P=\vec 0$) indeed holds. (Verified with SymPy.)
Exercise 19.4: Curl of a field mixing vortex and shear
Solution
For $\vec F=[-y,\ x,\ z]$, we substitute $f=-y,\ g=x,\ h=z$ into Definition 19.5.
$$ \rot\vec F=\left[\pdiff{z}{y}-\pdiff{x}{z},\ \ \pdiff{(-y)}{z}-\pdiff{z}{x},\ \ \pdiff{x}{x}-\pdiff{(-y)}{y}\right] =[0-0,\ \ 0-0,\ \ 1-(-1)]=[0,\ 0,\ 2] . $$(Verified with SymPy.) We obtain exactly the same result $[0,0,2]$ as in Example 19.5 ($\vec F=[-y,x,0]$). This is because, even if we change the third component from $0$ to $z$, the partial derivatives $\pdiff hy=\pdiff zy=0$ and $\pdiff hx=\pdiff zx=0$ appearing in the first and second components of the curl both remain $0$ ($h=z$ does not contain $x,y$).
Interpretation: Viewed in the $xy$-plane, the $x,y$ components $[-y,x]$ of $\vec F$ represent exactly the same “counterclockwise rotation about the origin” as in Example 19.5. Superimposed on it, as the $z$ component, is a simple upward flow $z$ (a flow in which the velocity in the $z$ direction increases in proportion to the height $z$), so $\vec F$ as a whole represents a helical flow that “goes upward (faster where $z$ is larger) while rotating counterclockwise.” However, the curl vector $\rot\vec F=[0,0,2]$ itself is unaffected by this upward flow and takes the same value as in Example 19.5, representing only the strength and direction of the rotation in the $xy$-plane.
Exercise 19.5: Direct verification of the product formula for divergence
Solution
Let $\varphi=x$ and $\vec F=[y,\ z,\ x]$.
Left-hand side. We compute the divergence of $\varphi\vec F=[xy,\ xz,\ x^2]$ directly from Definition 19.2.
$$ \operatorname{div}(\varphi\vec F)=\pdiff{}{x}(xy)+\pdiff{}{y}(xz)+\pdiff{}{z}(x^2)=y+0+0=y . $$($\pdiff{}{x}(xy)=y$: differentiate with respect to $x$, regarding $y$ as a constant. $\pdiff{}{y}(xz)=0$: $xz$ does not contain $y$. $\pdiff{}{z}(x^2)=0$: $x^2$ does not contain $z$.)
Right-hand side. We have $\grad\varphi=\grad(x)=[1,\ 0,\ 0]$. Also,
$$ \operatorname{div}\vec F=\pdiff{}{x}(y)+\pdiff{}{y}(z)+\pdiff{}{z}(x)=0+0+0=0 $$so
$$ (\grad\varphi)\cdot\vec F+\varphi\operatorname{div}\vec F=[1,0,0]\cdot[y,z,x]+x\cdot0=(1\cdot y+0\cdot z+0\cdot x)+0=y . $$The left-hand side and the right-hand side both equal $y$, so they agree. (Verified with SymPy.)
Exercise 19.6: Direct verification of the product formula for curl
Solution
Let $\varphi=xyz$ and $\vec F=[1,\ 1,\ 1]$.
Left-hand side. We compute the curl of $\varphi\vec F=[xyz,\ xyz,\ xyz]$ directly from Definition 19.5.
$$ \rot(\varphi\vec F)=\left[\pdiff{(xyz)}{y}-\pdiff{(xyz)}{z},\ \ \pdiff{(xyz)}{z}-\pdiff{(xyz)}{x},\ \ \pdiff{(xyz)}{x}-\pdiff{(xyz)}{y}\right] $$Substituting $\pdiff{}{y}(xyz)=xz$, $\pdiff{}{z}(xyz)=xy$, and $\pdiff{}{x}(xyz)=yz$, we obtain
$$ \rot(\varphi\vec F)=[xz-xy,\ \ xy-yz,\ \ yz-xz] . $$Right-hand side. We have $\grad\varphi=[yz,\ zx,\ xy]$. Substituting $\vec a=\grad\varphi=[yz,zx,xy]$ and $\vec b=\vec F=[1,1,1]$ into the component formula for the cross product from Chapter 15, $\vec a\times\vec b=[a_2b_3-a_3b_2,\ a_3b_1-a_1b_3,\ a_1b_2-a_2b_1]$, we obtain
$$ (\grad\varphi)\times\vec F=[zx\cdot1-xy\cdot1,\ \ xy\cdot1-yz\cdot1,\ \ yz\cdot1-zx\cdot1]=[zx-xy,\ \ xy-yz,\ \ yz-zx] . $$Also, since $\vec F=[1,1,1]$ is a constant vector field, all the partial derivatives of its components are $0$, so $\rot\vec F=\vec 0$, and therefore $\varphi\rot\vec F=x yz\cdot\vec 0=\vec 0$. Hence,
$$ (\grad\varphi)\times\vec F+\varphi\rot\vec F=[zx-xy,\ xy-yz,\ yz-zx]+\vec 0=[zx-xy,\ xy-yz,\ yz-zx] . $$This coincides exactly with the left-hand side $[xz-xy,\ xy-yz,\ yz-xz]$ (since $zx=xz$). (Verified with SymPy.)
← Back to Chapter 19, “Divergence and Curl”
Chapter 20 Line Integrals, Surface Integrals, and the Integral Theorems
Exercise 20.1: Find $\int_C f\,\dd s$ for $f(x,y)=x+y$ along $C:x=\cos\theta,y=\sin\theta\ (0\le\theta\le\pi)$
Solution
From $x(\theta)=\cos\theta,\ y(\theta)=\sin\theta$ we obtain $x'(\theta)=-\sin\theta,\ y'(\theta)=\cos\theta$. Therefore
$$ \sqrt{x'(\theta)^2+y'(\theta)^2}=\sqrt{\sin^2\theta+\cos^2\theta}=\sqrt1=1 $$(Since this is the unit circle, the arc length element is always $\dd s=1\cdot\dd\theta$; this is just a restatement of the obvious fact that the length of an arc of a circle of radius 1 is equal to its central angle itself.) Also, $f(x(\theta),y(\theta))=\cos\theta+\sin\theta$. Hence
$$ \int_C f\,\dd s=\int_0^{\pi}(\cos\theta+\sin\theta)\,\dd\theta=\bigl[\sin\theta-\cos\theta\bigr]_0^{\pi} =(\sin\pi-\cos\pi)-(\sin0-\cos0)=(0-(-1))-(0-1)=1+1=2 . $$Answer: $\displaystyle\int_C f\,\dd s=2$ (verified with SymPy).
Exercise 20.2: Find $\int_C\vec f\cdot\dd\vec p$ for $\vec f=[x,-y]$ along the straight line $C:(0,0)\to(2,2)$
Solution
Parametrizing the straight line $C$ as $x=t,\,y=t\ (0\le t\le2)$, we have $x'(t)=1,\ y'(t)=1$. Since the components of the vector field are $\vec f=[x,-y]=[t,-t]$,
$$ \int_C\vec f\cdot\dd\vec p=\int_0^2\bigl[t\cdot1+(-t)\cdot1\bigr]\dd t=\int_0^2(t-t)\,\dd t=\int_0^2 0\,\dd t=0 . $$Answer: $\displaystyle\int_C\vec f\cdot\dd\vec p=0$ (verified with SymPy). On the straight line $y=x$ we have $\vec f=[x,-y]=[x,-x]$, which is exactly orthogonal to the direction of travel $[1,1]$ (the inner product is $x\cdot1+(-x)\cdot1=0$); that is why no work is done at all.
Exercise 20.3: Verify, using two different paths, that the line integral of the gradient of $f=x^2+y^2$ does not depend on the path
Solution
We have $\nabla f=[2x,2y]$.
(a) The straight line $(0,0)\to(1,1)$: taking $x=t,\,y=t\ (0\le t\le1)$ gives $x'=y'=1$, and with $\nabla f=[2t,2t]$,
$$ \int_{C_a}\nabla f\cdot\dd\vec p=\int_0^1(2t\cdot1+2t\cdot1)\,\dd t=\int_0^1 4t\,\dd t=\bigl[2t^2\bigr]_0^1=2 . $$(b) The polygonal path $(0,0)\to(1,0)\to(1,1)$: we split it into two line segments and use additivity (Eq. (20-vec-additive)).
First segment $(0,0)\to(1,0)$: $x=t,\,y=0\ (0\le t\le1)$. With $\nabla f=[2t,0]$ and $x'=1,\,y'=0$,
$$ \int_{C_{b1}}\nabla f\cdot\dd\vec p=\int_0^1(2t\cdot1+0\cdot0)\,\dd t=\int_0^1 2t\,\dd t=\bigl[t^2\bigr]_0^1=1 . $$Second segment $(1,0)\to(1,1)$: $x=1,\,y=t\ (0\le t\le1)$. With $\nabla f=[2,2t]$ and $x'=0,\,y'=1$,
$$ \int_{C_{b2}}\nabla f\cdot\dd\vec p=\int_0^1(2\cdot0+2t\cdot1)\,\dd t=\int_0^1 2t\,\dd t=\bigl[t^2\bigr]_0^1=1 . $$Therefore, over the whole polygonal path, $\int_{C_b}\nabla f\cdot\dd\vec p=1+1=2$.
On the other hand, $f(1,1)-f(0,0)=(1^2+1^2)-(0^2+0^2)=2-0=2$, and (a), (b), and the claim of Theorem 20.1 all agree on the value $2$ (verified with SymPy).
Exercise 20.4: Find the area of the lateral surface $x^2+y^2=1,\ 0\le z\le1$ of a cylinder by a surface integral
Solution
Letting $\vec p(\theta,z)=[\cos\theta,\sin\theta,z]$ ($0\le\theta\le2\pi,\ 0\le z\le1$), we have
$$ \pdiff{\vec p}{\theta}=[-\sin\theta,\cos\theta,0],\qquad \pdiff{\vec p}{z}=[0,0,1] . $$Computing the cross product by the criss-cross method, we obtain
$$ \pdiff{\vec p}{\theta}\times\pdiff{\vec p}{z}=(\cos\theta\cdot1-0\cdot0,\ 0\cdot0-(-\sin\theta)\cdot1,\ (-\sin\theta)\cdot0-\cos\theta\cdot0)=(\cos\theta,\ \sin\theta,\ 0) $$whose magnitude is $\sqrt{\cos^2\theta+\sin^2\theta+0^2}=1$ (a constant). Therefore,
$$ \iint_S 1\,\dd S=\int_0^{2\pi}\!\!\int_0^1 1\,\dd z\,\dd\theta=\int_0^{2\pi}1\,\dd\theta=2\pi . $$Answer: lateral area $=2\pi$ (verified with SymPy). This agrees exactly with the value $2\pi\cdot1\cdot1=2\pi$ given by the formula learned in high school, “lateral area of a cylinder = circumference of the base × height.” The reason for this agreement is that the lateral surface of a cylinder rises vertically at every point, so the Jacobian (the area correction factor) is always $1$.
Exercise 20.5: Verify Gauss's divergence theorem for a ball of radius 2
Solution
The divergence of $\vec f=[x,y,z]$ is $\nabla\cdot\vec f=1+1+1=3$ (the same as in Example 20.8). Since the volume of a ball of radius 2 is $\dfrac43\pi\cdot2^3=\dfrac{32}{3}\pi$, the volume integral is
$$ \iiint_V(\nabla\cdot\vec f)\,\dd V=3\times\frac{32}{3}\pi=32\pi . $$For the surface integral, we use the fact that on the sphere $x^2+y^2+z^2=4$ the outward unit normal is $\hat n=\dfrac{(x,y,z)}{2}$ (the position vector normalized by dividing by its magnitude 2).
$$ \vec f\cdot\hat n=(x,y,z)\cdot\frac{(x,y,z)}{2}=\frac{x^2+y^2+z^2}{2}=\frac{4}{2}=2\quad(\text{always constant on the sphere}) $$so, using the surface area $4\pi(2)^2=16\pi$ of the sphere of radius 2, we obtain
$$ \iint_S\vec f\cdot\dd\vec S=\iint_S 2\,\dd S=2\times16\pi=32\pi . $$Both sides equal $32\pi$, so they agree (verified with SymPy). When the radius is doubled, the volume-integral side grows as the cube of the radius ($2^3=8$ times); the surface-integral side also grows as the cube of the radius, because two facts combine: “the value on the surface grows in proportion to the radius ($\vec f\cdot\hat n=$ radius)” and “the surface area grows as the square of the radius”—and we see that this is consistent with dimensional analysis as well.
Exercise 20.6: Verify Stokes's theorem for $\vec f=[y,-x,0]$ and compare the sign with Example 20.9
Solution
Along the unit circle $C:\vec p(\theta)=[\cos\theta,\sin\theta,0]\ (0\le\theta\le2\pi,\text{ counterclockwise})$, we have $f=y=\sin\theta,\ g=-x=-\cos\theta$, so
$$ \oint_C\vec f\cdot\dd\vec\ell=\int_0^{2\pi}\bigl[\sin\theta\cdot(-\sin\theta)+(-\cos\theta)\cdot\cos\theta\bigr]\dd\theta =\int_0^{2\pi}\bigl[-\sin^2\theta-\cos^2\theta\bigr]\dd\theta=\int_0^{2\pi}(-1)\,\dd\theta=-2\pi . $$On the other hand, the curl is $\nabla\times\vec f=\left[\pdiff{}{y}0-\pdiff{}{z}(-x),\ \pdiff{}{z}y-\pdiff{}{x}0,\ \pdiff{}{x}(-x)-\pdiff{}{y}y\right]=[0,0,-1-1]=[0,0,-2]$. Since $S$ is the unit disk in the $xy$-plane and $\dd\vec S=[0,0,1]\dd S$, we have $(\nabla\times\vec f)\cdot\dd\vec S=-2\,\dd S$, and
$$ \iint_S(\nabla\times\vec f)\cdot\dd\vec S=-2\times(\text{area of the unit disk})=-2\times\pi=-2\pi . $$Both sides equal $-2\pi$, so they agree (verified with SymPy). For $\vec f=[-y,x,0]$ in Example 20.9 the answer was $+2\pi$, whereas this time, for $\vec f=[y,-x,0]=-[-y,x,0]$ (a vector field with exactly the opposite sign), the answer also turned out to be $-2\pi$ (the opposite sign). Since both the line integral and the surface integral are linear (of degree one) in $\vec f$, reversing the sign of $\vec f$ as a whole reverses the signs of the answers on both sides in exactly the same way—this is a natural consequence of the fact that the very definitions of the line integral and the surface integral are linear operations that merely “substitute $\vec f$ and add up.”
← Back to Chapter 20, “Line Integrals, Surface Integrals, and the Integral Theorems”
Chapter 21 Complex Numbers and the Complex Plane
Exercise 21.1: $z^3,\ z^{-1}$ for $z=2e^{i\pi/3}$
Solution
We have $z=2e^{i\pi/3}=2\left(\cos\dfrac{\pi}3+i\sin\dfrac{\pi}3\right)$. By de Moivre's theorem (the formula in Chapter 21), in general $z^n=r^n(\cos n\theta+i\sin n\theta)$ holds.
For $z^3$. Substituting $r=2,\theta=\pi/3,n=3$, we obtain
$$z^3=2^3\left(\cos\left(3\cdot\frac{\pi}3\right)+i\sin\left(3\cdot\frac{\pi}3\right)\right)=8(\cos\pi+i\sin\pi)$$Since $\cos\pi=-1,\ \sin\pi=0$,
$$z^3=8(-1+i\cdot0)=-8$$For $z^{-1}$. Substituting $n=-1$, we obtain
$$z^{-1}=2^{-1}\left(\cos\left(-\frac{\pi}3\right)+i\sin\left(-\frac{\pi}3\right)\right)=\frac12(\cos\tfrac{\pi}3-i\sin\tfrac{\pi}3)$$(Since $\cos$ is an even function and $\sin$ is an odd function, $\cos(-\pi/3)=\cos(\pi/3)$ and $\sin(-\pi/3)=-\sin(\pi/3)$.) Substituting $\cos\frac{\pi}3=\frac12,\ \sin\frac{\pi}3=\frac{\sqrt3}2$, we obtain
$$z^{-1}=\frac12\left(\frac12-i\frac{\sqrt3}2\right)=\frac14-\frac{\sqrt3}4i$$(Check: $z\cdot z^{-1}=2e^{i\pi/3}\cdot\frac12e^{-i\pi/3}=1\cdot e^{i(\pi/3-\pi/3)}=e^{0}=1$, which shows that $z^{-1}$ is indeed the reciprocal of $z$.)
Exercise 21.2: Computing $(1+i)^{10}$
Solution
We convert $1+i$ to polar form. Since $a=1,b=1$, we have $r=\sqrt{1^2+1^2}=\sqrt2$. The angle satisfying $\cos\theta=\dfrac1{\sqrt2},\sin\theta=\dfrac1{\sqrt2}$ is $\theta=\dfrac{\pi}4$. Hence $1+i=\sqrt2\left(\cos\dfrac{\pi}4+i\sin\dfrac{\pi}4\right)$. Using de Moivre's theorem with $n=10$, we obtain
$$(1+i)^{10}=(\sqrt2)^{10}\left(\cos\left(10\cdot\frac{\pi}4\right)+i\sin\left(10\cdot\frac{\pi}4\right)\right)$$Here $(\sqrt2)^{10}=(2^{1/2})^{10}=2^5=32$. Also, $10\cdot\dfrac{\pi}4=\dfrac{10\pi}4=\dfrac{5\pi}2$, and this angle is equivalent to $\dfrac{5\pi}2-2\pi=\dfrac{\pi}2$ (the functions $\cos,\sin$ have period $2\pi$). Therefore,
$$(1+i)^{10}=32\left(\cos\frac{\pi}2+i\sin\frac{\pi}2\right)=32(0+i\cdot1)=32i$$(Check: $(1+i)^2=1+2i+i^2=2i$. $(1+i)^4=(2i)^2=4i^2=-4$. $(1+i)^8=(-4)^2=16$. $(1+i)^{10}=(1+i)^8\cdot(1+i)^2=16\times2i=32i$, which agrees with the result above.)
Exercise 21.3: The $n$th roots of $1$ form a regular $n$-gon (general $n$)
Solution
Let $z_k=e^{i2k\pi/n}$ ($k=0,1,\ldots,n-1$). We compute the distance between two adjacent points.
$$|z_{k+1}-z_k|=\left|e^{i\frac{2(k+1)\pi}n}-e^{i\frac{2k\pi}n}\right|=\left|e^{i\frac{2k\pi}n}\left(e^{i\frac{2\pi}n}-1\right)\right|$$(We used the law of exponents $e^{i\frac{2(k+1)\pi}n}=e^{i\frac{2k\pi}n}\cdot e^{i\frac{2\pi}n}$ and factored out $e^{i\frac{2k\pi}n}$.) The product of absolute values equals the absolute value of the product ($|AB|=|A||B|$, which corresponds to the case $r_1=|A|,r_2=|B|$ of Formula 21.3), so
$$=\left|e^{i\frac{2k\pi}n}\right|\cdot\left|e^{i\frac{2\pi}n}-1\right|$$By Formula 21.5 ($|e^{i\theta}|=1$), $\left|e^{i\frac{2k\pi}n}\right|=1$ (it is always $1$, regardless of $k$). Therefore,
$$|z_{k+1}-z_k|=\left|e^{i\frac{2\pi}n}-1\right|$$The right-hand side does not contain $k$; that is, it is constant, independent of $k$. (Incidentally, if we actually compute this value, we obtain $\left|e^{i\frac{2\pi}n}-1\right|^2=\left(\cos\frac{2\pi}n-1\right)^2+\sin^2\frac{2\pi}n=2-2\cos\frac{2\pi}n=4\sin^2\frac{\pi}n$ (we used the half-angle formula $1-\cos\phi=2\sin^2(\phi/2)$ with $\phi=2\pi/n$), so the distance between two adjacent points is $2\sin(\pi/n)$.)
Moreover, as we saw in Section 21.5.3, all the $z_k$ lie at distance $1$ from the origin (on the unit circle), and their arguments are equally spaced at intervals of $\frac{2\pi}n$. The statement “$n$ points equidistant from the center are arranged so that the distances between adjacent vertices are all equal and the central angles are also equal” is precisely the definition of a regular $n$-gon, so for any natural number $n\ (\ge3)$ the $n$th roots of $1$ form the vertices of a regular $n$-gon inscribed in the unit circle.
Exercise 21.4: Proof that $\tanh ix=i\tan x$
Solution
Substituting $y=ix$ into the definition of the hyperbolic tangent $\tanh y=\dfrac{\sinh y}{\cosh y}$, we obtain
$$\tanh ix=\frac{\sinh ix}{\cosh ix}$$Substituting Formula 21.10 (i) $\cosh ix=\cos x$ and Formula 21.10 (ii) $\sinh ix=i\sin x$, we obtain
$$\tanh ix=\frac{i\sin x}{\cos x}=i\cdot\frac{\sin x}{\cos x}$$Since $\tan x=\dfrac{\sin x}{\cos x}$ (the definition of the tangent),
$$\therefore \tanh ix=i\tan x$$(Check: for $x=\pi/4$, the right-hand side $=i\tan(\pi/4)=i\cdot1=i$. For the left-hand side, $\sinh(i\pi/4)=i\sin(\pi/4)=i\frac{\sqrt2}2$ and $\cosh(i\pi/4)=\cos(\pi/4)=\frac{\sqrt2}2$, so $\tanh(i\pi/4)=\dfrac{i\sqrt2/2}{\sqrt2/2}=i$, which agrees.)
Exercise 21.5: The line equation when $\alpha$ is a pure imaginary number
Solution
Recall the correspondence $\alpha=\dfrac a2+\dfrac b2i$ of Formula 21.11 ($a,b$ are the coefficients of the original line $ax+by+c=0$). That $\alpha$ is a pure imaginary number means that its real part is $0$, that is, $\dfrac a2=0$, in other words $a=0$.
Substituting $a=0$ into the equation of the line $ax+by+c=0$, we obtain
$$by+c=0\ \Longleftrightarrow\ y=-\frac cb\quad(b\ne0)$$This is an equation that does not contain $x$; that is, it is a line parallel to the real axis (a horizontal line).
We can also check this directly using the equation in $z,\bar z$. When $\alpha=\dfrac b2i$ (a pure imaginary number), $\bar\alpha=-\dfrac b2i$, so the equation of Formula 21.11 becomes
$$-\frac b2iz+\frac b2i\bar z+c=0\ \Longleftrightarrow\ \frac b2i(\bar z-z)+c=0$$Substituting $z=x+iy,\bar z=x-iy$, we have $\bar z-z=-2iy$, so
$$\frac b2i\cdot(-2iy)+c=-bi^2y+c=by+c=0$$(We used $i^2=-1$.) This is indeed $by+c=0$, that is, a horizontal line, in agreement with the argument above.
Exercise 21.6: The circle equation when $\alpha=0$
Solution
Substituting $\alpha=0$ into $C=\alpha\bar\alpha-r^2$ of Formula 21.12, we have $\bar\alpha=\overline{0}=0$, so
$$C=0\cdot0-r^2=-r^2$$Also, substituting $\alpha=0$ (hence $\alpha\bar z=0,\ \bar\alpha z=0$) and $C=-r^2$ into the equation $z\bar z-(\alpha\bar z+\bar\alpha z)+C=0$ of Formula 21.12, we obtain
$$z\bar z-(0+0)+(-r^2)=0\ \Longleftrightarrow\ z\bar z-r^2=0\ \Longleftrightarrow\ z\bar z=r^2$$This coincides exactly with what we get by squaring both sides of $|z-0|=r$, that is, $|z|=r$, the equation of the circle with center at the origin ($\alpha=0$) and radius $r$, to obtain $|z|^2=r^2$, and then rewriting it using Formula 21.1 ($|z|^2=z\bar z$). Thus we have verified that Formula 21.12 gives, for $\alpha=0$, a special case that is consistent and correct.
← Back to Chapter 21, “Complex Numbers and the Complex Plane”
Chapter 22 Complex Functions and Mappings
Exercise 22.1: Is $W=\bar z$ (the conjugation mapping) one-to-one or many-to-one?
Solution
Let $z=x+iy$. Since $\bar z=x-iy$, we have
$$ u(x,y)=x,\qquad v(x,y)=-y $$If the value of $(u,v)$ is known, then, setting
$$ x=u,\qquad y=-v $$the original $z=x+iy=u-iv$ can be recovered in exactly one way. Hence distinct $(x,y)$ always give distinct $(u,v)$, so this mapping is one-to-one.
Geometrically, the correspondence $(x,y)\mapsto(x,-y)$ is the operation that flips only the sign of the $y$-coordinate, so it is nothing other than a reflection across the real axis (the $x$-axis). This is the same geometric operation, the “reflection across the real axis,” that appeared in Section 22.4 when we examined the polar form of $W=1/z$.
Exercise 22.2: The image of the imaginary axis under $W=z^2+1$
Solution
A point on the imaginary axis can be written $z=iy$ ($y$ an arbitrary real number, $x=0$). Substituting $x=0$ into the equations of Chapter 22 in the main text ($u=x^2-y^2,\ v=2xy$), we obtain
$$ u(0,y)=0^2-y^2=-y^2,\qquad v(0,y)=2\cdot0\cdot y=0 $$so the real and imaginary parts of $W=z^2+1$ are
$$ u=1-y^2,\qquad v=0 $$Since $v$ is identically $0$, the image lies on the real axis of the $W$-plane ($v=0$). As $y$ ranges over all real numbers, $y^2\ge0$ gives $1-y^2\le1$, and the maximum value $u=1$ is attained when $y=0$. Also, as $y\to\pm\infty$ we have $u\to-\infty$, so $u$ takes every value from $-\infty$ up to $1$. Therefore the image is
$$ \{u+iv : u\le1,\ v=0\} $$that is, a half-line of the real axis in the $W$-plane (the part not exceeding $1$). Note also that $y$ and $-y$ give the same $u=1-y^2$, so (except at $y=0$) this mapping is two-to-one on the imaginary axis (e.g., $y=\pm2\to u=-3$; verified with SymPy).
Exercise 22.3: The image of the circle $\abs z=2$ under $W=1/\bar z$
Solution
A point on the circle $\abs z=2$ can be written in polar form as $z=2e^{i\theta}$ ($0\le\theta\lt2\pi$). Taking the conjugate gives $\bar z=2e^{-i\theta}$, so
$$ w=\frac1{\bar z}=\frac1{2e^{-i\theta}}=\frac12\,e^{i\theta} $$Hence the absolute value of $w$ is $\abs w=\dfrac12$ (constant, independent of the value of $\theta$), and its argument is $\arg w=\theta$ (the same as the argument of the original $z$). As $\theta$ runs from $0$ up to (but not including) $2\pi$, $w=\frac12e^{i\theta}$ goes around the circle with center at the origin and radius $\frac12$ exactly once. Therefore the image is the circle
$$ \abs w=\frac12 $$(we also verified numerically that $\abs w=0.5$ for several values of $\theta$). Compare this with Formula 22.3 in the main text (for $W=1/z$ we had $R=1/r,\ \Theta=-\theta$, so the sign of the argument was reversed), and note the difference: because the conjugate is taken first, the sign of the argument is reversed once more, so in the end the original argument $\theta$ is preserved unchanged.
Exercise 22.4: Where the linear fractional function $W=\dfrac{z-1}{z+1}$ sends the special points
Solution
When $z=1$: Substituting directly, we get
$$ W=\frac{1-1}{1+1}=\frac02=0 $$When $z=-1$: The denominator becomes $\gamma z+\delta=z+1=0$, and the absolute value of $W$ becomes arbitrarily large ($\abs W\to\infty$ as $z$ approaches $-1$). Following Definition 22.4, we agree that $z=-1$ is mapped to $W=\infty$ (the point at infinity).
When $z=\infty$: Dividing the numerator and denominator by $z$ gives
$$ W=\frac{z-1}{z+1}=\frac{1-\dfrac1z}{1+\dfrac1z} $$As $z\to\infty$ we have $\dfrac1z\to0$, so
$$ W\to\frac{1-0}{1+0}=1 $$Hence $z=\infty$ is mapped to $W=1$. To summarize, $z=1\to W=0$, $z=-1\to W=\infty$, and $z=\infty\to W=1$ (also verified with SymPy's limit computation). In general, for a linear fractional function $W=\dfrac{\alpha z+\beta}{\gamma z+\delta}$, the same computation shows that $z=-\delta/\gamma$ (the point that makes the denominator $0$) corresponds to $W=\infty$, and that $z=\infty$ corresponds to $W=\alpha/\gamma$ (the $C_2$ of Formula 22.4).
Exercise 22.5: The image of the unit circle under $W=z^n$ winds around the unit circle $n$ times
Solution
A point on the unit circle can be written $z=e^{i\theta}$ ($0\le\theta\lt2\pi$). Then
$$ W=z^n=e^{in\theta} $$As $\theta$ runs from $0$ up to (but not including) $2\pi$ (exactly once around the unit circle), $n\theta$ runs from $0$ up to (but not including) $2\pi n$. Since $e^{i\phi}$ is a periodic function that returns to the original point each time $\phi$ increases by $2\pi$, the fact that $n\theta$ runs from $0$ to $2\pi n$ corresponds to going around the unit circle exactly $n$ times. Therefore the image is the unit circle $\abs W=1$ (the same as the original), and it winds around the unit circle exactly $n$ times.
We also see at the same time that this mapping is $n$-to-one: the points in the $z$-plane that correspond to a point $W_0=e^{i\Phi_0}$ on the unit circle in the $W$-plane are those with $\theta$ satisfying $n\theta=\Phi_0+2\pi k$ ($k$ an integer)—which is also written as the congruence $n\theta\equiv\Phi_0\pmod{2\pi}$ (“congruent modulo $2\pi$,” a notation meaning that the difference $n\theta-\Phi_0$ is an integer multiple of $2\pi$)—that is,
$$ \theta=\frac{\Phi_0}n+\frac{2\pi k}n\qquad(k=0,1,\dots,n-1) $$These are $n$ angles in all, and this is nothing other than Theorem 22.1 (the $n$-to-one property of $W=z^n$) restricted to the unit circle (for the case $n=4$ we computed with a specific $\theta_0$ and verified with SymPy that four distinct values of $\theta$ give the same $W$).
Exercise 22.6: Which circle corresponds to the equator of the Riemann sphere?
Solution
Let $R$ be the radius of the sphere, let $S$ (the point where the sphere touches the $z$-plane) be the origin, and let $h$ be the height measured from it ($0\le h\le2R$; $h=0$ is $S$ and $h=2R$ is $N$). The center of the sphere is at height $R$ above $S$, so if we let $\rho$ be the radius of the cross section of the sphere at height $h$ (the radius in the direction parallel to the $z$-plane), then the equation of the sphere (in the cross section: the circle with center $(0,R)$ and radius $R$) is
$$ \rho^2+(h-R)^2=R^2 $$Consider the line drawn from $N=(0,2R)$ through a point on the sphere at height $h$ and horizontal distance $\rho$, and extended down to the $z$-plane (height $0$). The height from $N$ to the $z$-plane is $2R$, and the difference in height from $N$ to the point at height $h$ is $2R-h$. So, by similar triangles (two right triangles with vertex $N$, in which the horizontal extent at vertical distance $2R-h$ from the vertex is $\rho$, and the horizontal extent at vertical distance $2R$ from the vertex, namely at the $z$-plane, is $r$), the following relation holds:
$$ \frac{r}{2R}=\frac{\rho}{2R-h}\qquad\therefore\ r=\rho\cdot\frac{2R}{2R-h} $$The equator is the great circle exactly midway between $S$ and $N$, that is, at height $h=R$. Substituting $h=R$ into the equation of the sphere, we get
$$ \rho^2+(R-R)^2=R^2\quad\therefore\ \rho=R $$(at height $R$ the radius of the cross section of the sphere is exactly equal to the radius $R$ of the sphere itself; that is, this is the “widest” part of the sphere). Substituting this into the formula for $r$, we obtain
$$ r=R\cdot\frac{2R}{2R-R}=R\cdot\frac{2R}{R}=2R $$Therefore the equator corresponds to the circle in the $z$-plane with center at the origin and radius $2R$ (a circle whose radius equals the diameter of the sphere),
$$ \abs z=2R $$(also verified with SymPy that $\rho=R,\ r=2R$). Let us check the endpoints as well. At $h=0$ (the south pole $S$), $\rho^2=0\cdot2R=0$ gives $\rho=0$, and hence it corresponds to $r=0\cdot\dfrac{2R}{2R}=0$ (the origin). In the case $h\to2R$ (the north pole $N$), not only the denominator $2R-h$ but also the numerator $\rho$ approaches $0$ ($\rho^2=h(2R-h)\to2R\cdot0=0$), so we cannot simply say “the denominator is $0$, so $r\to\infty$”; we need to compare how the two approach zero. So set $h=2R-\varepsilon$ ($\varepsilon\to0^+$). Then
$$ \rho^2=h(2R-h)=(2R-\varepsilon)\varepsilon=2R\varepsilon-\varepsilon^2\approx2R\varepsilon\quad(\varepsilon\to0^+\ \text{limit}) $$gives $\rho\approx\sqrt{2R\varepsilon}$ (the numerator approaches $0$ at the order of the $\frac12$ power of $\varepsilon$). On the other hand, the denominator is $2R-h=\varepsilon$ (on the order of the $1$st power of $\varepsilon$), so
$$ r=\rho\cdot\frac{2R}{2R-h}\approx\sqrt{2R\varepsilon}\cdot\frac{2R}{\varepsilon}=2R\sqrt{\frac{2R}{\varepsilon}}\ \longrightarrow\ \infty\qquad(\varepsilon\to0^+) $$(the numerator is of order $\sqrt\varepsilon$ and the denominator is of order $\varepsilon$, and since the denominator approaches $0$ faster, the whole expression diverges—it is an indeterminate form $0/0$, but by comparing the orders we can conclude that $r\to\infty$). In this way we have confirmed that $h\to2R$ (the north pole $N$) corresponds to $r\to\infty$ (the point at infinity), which is consistent with the content of Definitions 22.4 and 22.5. That is, the lower half of the sphere (the side near $S$) corresponds to points near the origin of the $z$-plane, the equator corresponds to the circle of radius $2R$, and the upper half (the side near $N$) corresponds to points outside the circle of radius $2R$.
← Back to Chapter 22, “Complex Functions and Mappings”
Chapter 23 Elementary Complex Functions — Exponential, Logarithm, Power, and Trigonometric Functions
Exercise 23.1: Solving an exponential equation
Solution
We write $-2$ in polar form. We have $\abs{-2}=2$, and since $-2$ lies on the negative part of the real axis, its argument is $\pi$ (or that value plus an integer multiple of $2\pi$). That is,
$$ -2=2e^{i(\pi+2n\pi)}\qquad(n\in\Z) $$By Definition 23.2 (complex logarithm), any $z$ satisfying $e^z=-2$ is given by $z=\log(-2)$, and so
$$ z=\log\abs{-2}+i\arg(-2)=\log2+i(\pi+2n\pi)\qquad(n\in\Z) $$As a check, we verify the case $n=0$. We get $e^{\log2+i\pi}=e^{\log2}\cdot e^{i\pi}=2\cdot(\cos\pi+i\sin\pi)=2\cdot(-1+0)=-2$, so the equation is indeed satisfied (for the other values of $n$, the same holds by the periodicity in property (iv), $e^{i2n\pi}=1$).
Answer: $z=\log2+i(\pi+2n\pi)$ ($n\in\Z$). There are infinitely many solutions.
Exercise 23.2: The principal value of a complex logarithm
Solution
Let $z=3+4i$. The absolute value is
$$ \abs z=\sqrt{3^2+4^2}=\sqrt{9+16}=\sqrt{25}=5 $$(the right triangle with sides $3,4,5$). As for the argument, since $z$ lies in the first quadrant (the real and imaginary parts are both positive), within the range of principal values $-\pi\lt\arg z\le\pi$ we have
$$ \arg z=\tan^{-1}\frac43 $$(since the denominator is positive, the case-dependent correction of $\pm\pi$ is not needed). Therefore, by Definition 23.2, the principal value is
$$ \log(3+4i)=\log5+i\tan^{-1}\frac43 $$Numerically, $\log5=1.6094\ldots$ and $\tan^{-1}(4/3)=0.9273\ldots$ (in radians), so $\log(3+4i)=1.6094\ldots+0.9273\ldots\,i$ (verified with SymPy and numpy: the value agrees with $e^{1.6094+0.9273i}=3+4i$).
Answer: $\log(3+4i)=\log5+i\tan^{-1}(4/3)$.
Exercise 23.3: A square root as a complex power
Solution
By Definition 23.3, $z^c=e^{c\log z}$. Substituting $z=-1$ and $c=1/2$ and using the principal value $\log(-1)=i\pi$ found in Example 23.3, we get
$$ (-1)^{1/2}=e^{\frac12\log(-1)}=e^{\frac12\cdot i\pi}=e^{i\pi/2} $$By Euler's formula, $e^{i\pi/2}=\cos\dfrac\pi2+i\sin\dfrac\pi2=0+i\cdot1=i$. Therefore
$$ (-1)^{1/2}=i $$This agrees exactly with what you remember from high school mathematics, $\sqrt{-1}=i$. That is, even if we start from the definition of complex powers, the principal value of $\sqrt{-1}$ settles on the familiar $i$. (However, if we use a general branch $n\ne0$, we get $(-1)^{1/2}=e^{i(\pi/2+n\pi)}$, and when $n$ is odd we also obtain $-i$. The fact that the square root has “two values” can be explained here in the language of the branches of the logarithm.)
Answer: $(-1)^{1/2}=i$ (principal value). It agrees with what we remember about the ordinary square root.
Exercise 23.4: The image of a strip (revisited)
Solution
By the derivation in Section 23.2, for $z=x+iy$ the function $e^z$ gives the correspondence $R=e^x$, $\theta=y$ in polar form. In the strip-shaped region $\{0\le y\lt2\pi\}$, $x$ can range over all real numbers without restriction, so $R=e^x$ takes every value in $(0,\infty)$ ($R\to0$ as $x\to-\infty$ and $R\to\infty$ as $x\to+\infty$), and since $y$ ranges over $[0,2\pi)$, $\theta$ takes exactly one full turn's worth of the possible values of the argument (from $0$ up to, but not including, $2\pi$). Therefore this strip is mapped exactly one-to-one, with no overlap, onto the whole $W$-plane with the origin removed (as we saw in Figure 23.3).
Suppose we take the width of the strip wider than $2\pi$, for example $\{0\le y\lt4\pi\}$. Then the range of $y$ exceeds one full turn of the argument ($2\pi$). In that case, for example, the point with $y=\pi/2$ and the point with $y=\pi/2+2\pi=5\pi/2$ are different values of $z$ for the same value of $x$, and as values of $\theta=y$ they appear to be different, namely $\pi/2$ and $5\pi/2$; but since the argument does not distinguish differences of integer multiples of $2\pi$, they point in the same direction (the same $\theta\bmod2\pi$). That is, for the same $x$ (that is, the same $R=e^x$), two distinct points $y$ and $y+2\pi$ are mapped to the same image point in the $W$-plane. This is precisely property (iv) of the previous section (the periodicity $e^{z+2\pi i}=e^z$): once the width of the strip exceeds $2\pi$, the mapping is no longer one-to-one but becomes a two-to-one correspondence (and, if we widen the strip further, a three-to-one correspondence, and so on).
Answer: A strip of width $2\pi$ is mapped one-to-one onto the whole $W$-plane with the origin removed, but if the width of the strip is taken wider than $2\pi$, the correspondence becomes many-to-one because of the periodicity.
Exercise 23.5: A complex trigonometric equation
Solution
By Theorem 23.2, $\cos z=\dfrac{e^{iz}+e^{-iz}}2$. Setting $\cos z=2$, we get
$$ \frac{e^{iz}+e^{-iz}}2=2\quad\Longleftrightarrow\quad e^{iz}+e^{-iz}=4 $$Setting $t=e^{iz}$ (and noting that $e^{-iz}=1/t$), we have
$$ t+\frac1t=4\quad\Longleftrightarrow\quad t^2-4t+1=0 $$This is a quadratic equation in $t$. By the quadratic formula, we get
$$ t=\frac{4\pm\sqrt{16-4}}2=\frac{4\pm2\sqrt3}2=2\pm\sqrt3 $$Note that $2+\sqrt3=3.732\ldots\gt0$ and $2-\sqrt3=0.268\ldots\gt0$ are both positive real numbers. For $t=e^{iz}$, the fact that $t$ is a positive real number means that $iz$ is real ($z$ is a pure imaginary number). In the case $t=2+\sqrt3$, we have $iz=\log(2+\sqrt3)$ (the real logarithm), so
$$ z=-i\log(2+\sqrt3) $$Check: $\cos\bigl(-i\log(2+\sqrt3)\bigr)=\cosh\bigl(\log(2+\sqrt3)\bigr)=\dfrac{(2+\sqrt3)+(2+\sqrt3)^{-1}}2$. Since $(2+\sqrt3)^{-1}=2-\sqrt3$ (because $(2+\sqrt3)(2-\sqrt3)=4-3=1$), this equals $\dfrac{(2+\sqrt3)+(2-\sqrt3)}2=\dfrac42=2$, so indeed $\cos z=2$ is satisfied (verified numerically with SymPy and numpy). The other solution $t=2-\sqrt3$ gives $z=-i\log(2-\sqrt3)=i\log(2+\sqrt3)$ (since $\log(2-\sqrt3)=-\log(2+\sqrt3)$), and this too satisfies $\cos z=2$ by the same check.
Answer: $z=-i\log(2+\sqrt3)$ (or equivalently $z=i\log(2+\sqrt3)$) satisfies $\cos z=2$. In the world of real numbers, $\abs{\cos\theta}\le1$, so there is no real number $\theta$ satisfying $\cos\theta=2$, but in the world of complex numbers a solution exists.
Exercise 23.6: The logarithmic mapping: the image of a half-line
Solution
A point on the half-line $\arg z=\pi/4$ ($z\neq0$) can be written in polar form as $z=re^{i\pi/4}$ ($r\gt0$ arbitrary). Then we have
$$ \log z=\log r+i\cdot\frac\pi4 $$As $r$ runs over all values in $(0,\infty)$, $\log r$ takes every value in $(-\infty,\infty)$ (as the range of the real logarithm function). Meanwhile, the imaginary part always stays equal to $\pi/4$ and does not change. Therefore the image is given by
$$ v=\frac\pi4\qquad(u\ \text{is any real number}) $$That is, the image is the horizontal line $v=\pi/4$ in the $W$-plane (a line parallel to the $u$-axis). This is the case $\theta_0=\pi/4$ of the general rule seen in Example 23.5, “a half-line is mapped to a horizontal line” (the half-line $\arg z=\theta_0$ is mapped to the horizontal line $v=\theta_0$).
Answer: The image is the horizontal line $v=\pi/4$ ($u\in\R$).
Chapter 24 Holomorphic Functions and the Cauchy–Riemann Equations
Exercise 24.1: Holomorphy of $f(z)=x^2-y^2+2ixy$
Solution
Let $u(x,y)=x^2-y^2$ and $v(x,y)=2xy$. The partial derivatives are
$$ u_x=2x,\quad u_y=-2y,\quad v_x=2y,\quad v_y=2x $$Therefore $u_x=2x=v_y$ and $u_y=-2y=-(2y)=-v_x$, so the C-R equations hold identically for all $(x,y)$. Hence $f(z)$ is holomorphic on the whole plane (all of $\mathbb C$). By Corollary 24.1, the derivative is
$$ f'(z) = u_x+iv_x = 2x+i\cdot2y = 2(x+iy) = 2z $$Incidentally, if we notice that $(x+iy)^2=x^2-y^2+2ixy$, we see that $f(z)$ is in fact $z^2$ itself, and that the result is consistent with the computation for $z^2+3z$ in Example 24.5 (or with $(x^2)'=2x$ from high school mathematics) (verified with SymPy).
Exercise 24.2: Harmonic conjugate—constructing a holomorphic function from $u=x^3-3xy^2$
Solution
We find the partial derivatives of $u(x,y)=x^3-3xy^2$.
$$ u_x = 3x^2-3y^2 ,\qquad u_y = -6xy $$From the C-R equation $v_y=u_x$,
$$ v_y = 3x^2-3y^2 $$Integrating this with respect to $y$ (regarding $x$ as a constant), we obtain
$$ v(x,y) = \int(3x^2-3y^2)\,dy = 3x^2y-y^3+h(x) $$(Instead of an integration constant, an arbitrary function $h(x)$ that does not depend on $y$ appears—in order to capture all the terms that vanish upon differentiation with respect to $x$.) We determine $h(x)$ by using the other C-R equation, $v_x=-u_y$. Differentiating the left-hand side partially with respect to $x$ gives
$$ v_x = 6xy+h'(x) $$The right-hand side is $-u_y=-(-6xy)=6xy$. Comparing the two sides,
$$ 6xy+h'(x) = 6xy \quad\Longrightarrow\quad h'(x)=0 \quad\Longrightarrow\quad h(x)=C\ (\text{constant}) $$Taking the simplest case $C=0$, we get
$$ v(x,y) = 3x^2y-y^3 $$Therefore the required holomorphic function is
$$ f(z) = u+iv = (x^3-3xy^2)+i(3x^2y-y^3) $$Indeed, expanding gives $(x+iy)^3=x^3+3x^2(iy)+3x(iy)^2+(iy)^3=x^3+3ix^2y-3xy^2-iy^3=(x^3-3xy^2)+i(3x^2y-y^3)$, so this is precisely $f(z)=z^3$. Checking the derivative by Corollary 24.1,
$$ f'(z) = u_x+iv_x = (3x^2-3y^2)+i(6xy) = 3(x^2-y^2+2ixy) = 3(x+iy)^2 = 3z^2 $$This has the same form as $(x^3)'=3x^2$ in high school mathematics, and it agrees with the natural result $f(z)=z^3$, $f'(z)=3z^2$ (verified with SymPy).
Exercise 24.3: Holomorphy and derivative of $f(z)=\cos z$
Solution
By the “Math Note” in Section 24.4, $\cos z=\cos x\cosh y-i\sin x\sinh y$. Hence
$$ u(x,y)=\cos x\cosh y ,\qquad v(x,y)=-\sin x\sinh y $$We compute the partial derivatives.
$$ u_x = -\sin x\cosh y ,\qquad u_y = \cos x\sinh y ,\qquad v_x = -\cos x\sinh y ,\qquad v_y = -\sin x\cosh y $$Comparing them, $u_x=-\sin x\cosh y=v_y$ and $u_y=\cos x\sinh y=-(-\cos x\sinh y)=-v_x$, so the C-R equations hold identically for all $(x,y)$. Hence $\cos z$ is holomorphic on the whole plane. By Corollary 24.1, the derivative is
$$ f'(z) = u_x+iv_x = -\sin x\cosh y+i(-\cos x\sinh y) = -(\sin x\cosh y+i\cos x\sinh y) $$Since, by the “Math Note” in Section 24.4, $\sin z=\sin x\cosh y+i\cos x\sinh y$,
$$ f'(z) = -\sin z $$This agrees with $\dfrac{d}{dz}\cos z=-\sin z$, which we derived in Formula 24.3 (verified numerically with SymPy at six points with random complex numbers).
Exercise 24.4: Application of the quotient rule—$g(z)=\dfrac{z^2+1}{z-1}$
Solution
Let $f(z)=z^2+1$ and $h(z)=z-1$; then $g(z)=f(z)/h(z)$. Since $f'(z)=2z$ and $h'(z)=1$, Formula 24.2 (the quotient rule) gives
$$ g'(z) = \frac{f'(z)h(z)-f(z)h'(z)}{\{h(z)\}^2} = \frac{2z(z-1)-(z^2+1)\cdot1}{(z-1)^2} $$Expanding and simplifying the numerator,
$$ 2z(z-1)-(z^2+1) = 2z^2-2z-z^2-1 = z^2-2z-1 $$Therefore
$$ g'(z) = \frac{z^2-2z-1}{(z-1)^2} $$The function $g(z)$ cannot be defined at the point where the denominator $z-1$ becomes $0$, that is, at $z=1$, so differentiation there is out of the question. Therefore the function is not holomorphic at $z=1$ (at every other point it is holomorphic, being a quotient of polynomials; verified with SymPy: direct differentiation and the formula give the same result).
Exercise 24.5: A concrete check that the limits from two directions agree—$f(z)=z^2$
Solution
From $f(z)=z^2=(x+iy)^2=(x^2-y^2)+i(2xy)$, we have $u=x^2-y^2$ and $v=2xy$.
[1] $\beta=0,\alpha\to0$ (real-axis direction): By the formula in Chapter 24,
$$ u_x+iv_x = 2x+i(2y) = 2x+2iy $$[2] $\alpha=0,\beta\to0$ (imaginary-axis direction): By the formula in Chapter 24,
$$ -iu_y+v_y = -i(-2y)+2x = 2x+2iy $$(We substituted $u_y=-2y$ and $v_y=2x$.) Both [1] and [2] agree with $2x+2iy=2(x+iy)=2z$, so they indeed take the same value. This is also consistent with the fact that the C-R equations $u_x=2x=v_y$ and $u_y=-2y=-v_x$ hold ($-v_x=-2y$ because $v_x=2y$)—recall that the very condition that [1] and [2] agree was precisely the C-R equations (Section 24.3.1). The result also agrees with $f'(z)=2z$ found in Example 24.5 and Exercise 24.1 (this is the $2z+3$ of the case $z^2+3z$ with the constant term $3$ removed) (verified with SymPy).
Exercise 24.6: The real part of a holomorphic function is a harmonic function
Solution
Suppose that $f=u+iv$ is holomorphic and that the C-R equations $u_x=v_y$ and $u_y=-v_x$ hold (wherever $u,v$ are twice continuously differentiable). Differentiating both sides of the first equation $u_x=v_y$ partially with respect to $x$ gives
$$ u_{xx} = v_{yx} $$Differentiating both sides of the second equation $u_y=-v_x$ partially with respect to $y$ gives
$$ u_{yy} = -v_{xy} $$Now we use Schwarz's theorem in Chapter 6, Section 6.3 (if $v$ is twice continuously differentiable, the result does not change when the order of partial differentiation is exchanged: $v_{xy}=v_{yx}$). The right-hand sides of the two equations are equal in absolute value and differ only in sign—since $v_{yx}=v_{xy}$, we have $u_{xx}=v_{yx}=v_{xy}=-u_{yy}$. Therefore
$$ u_{xx}+u_{yy} = v_{yx}+(-v_{xy}) = v_{yx}-v_{xy} = 0 $$That is, the real part $u$ of a holomorphic function is a harmonic function ($u_{xx}+u_{yy}=0$, a solution of Laplace's equation). (Similarly, one can show that the imaginary part $v$ is also a harmonic function.) As a concrete example, checking directly with the real part $u=e^x\cos y$ of $f(z)=e^z$, we obtain
$$ u_{xx} = e^x\cos y ,\qquad u_{yy} = -e^x\cos y \quad\Longrightarrow\quad u_{xx}+u_{yy} = e^x\cos y-e^x\cos y = 0 $$so we confirm that it is indeed a harmonic function (verified with SymPy). This fact is used in the following way: the real and imaginary parts of holomorphic functions serve as tools for describing the potentials of physical phenomena governed by Laplace's equation, such as electrostatic fields and heat conduction—this is one of the important bridges connecting complex analysis with physics and engineering.
← Back to Chapter 24, “Holomorphic Functions and the Cauchy–Riemann Equations”
Chapter 25 Complex Integration and Cauchy's Integral Theorem
Exercise 25.1: Contour integral of the exponential function
Solution
Writing $f(z)=e^z$ in the form $u+iv$, we have $e^z=e^{x+iy}=e^x\cos y+ie^x\sin y$, so $u=e^x\cos y,\ v=e^x\sin y$. Checking the Cauchy–Riemann equations, we compute
$$\frac{\partial u}{\partial x}=e^x\cos y=\frac{\partial v}{\partial y},\qquad \frac{\partial u}{\partial y}=-e^x\sin y=-\frac{\partial v}{\partial x}$$Both equations hold on the whole complex plane, and moreover these partial derivatives (such as $e^x\cos y$ and $e^x\sin y$) are continuous on the whole complex plane, being products of exponential and trigonometric functions. Therefore $f(z)=e^z$ is holomorphic on the whole complex plane, and its derivative $f'(z)=e^z$ is also continuous.
Let $C$ be any simple closed curve in the complex plane. Then $C$ and its interior $D$ are both contained in the complex plane, and $f$ is holomorphic there with a continuous derivative. Hence the hypotheses of Theorem 25.2 (Cauchy's integral theorem) are satisfied as they stand, so that
$$\oint_C e^z\,dz=0$$holds. (Numerical-integration check with mpmath: computing over the unit circle gives $\approx-6\times10^{-38}-9\times10^{-31}i$, which is $0$ to within floating-point error.)
Exercise 25.2: Handling three poles with partial fractions
Solution
Set $\dfrac{z+2}{z(z-1)(z+1)}=\dfrac{A}z+\dfrac{B}{z-1}+\dfrac{C}{z+1}$ and multiply both sides by $z(z-1)(z+1)$ to get
$$z+2=A(z-1)(z+1)+Bz(z+1)+Cz(z-1)$$Substituting $z=0$: $2=A(-1)(1)=-A$, so $A=-2$. Substituting $z=1$: $3=B(1)(2)=2B$, so $B=\dfrac32$. Substituting $z=-1$: $1=C(-1)(-2)=2C$, so $C=\dfrac12$. Hence
$$\frac{z+2}{z(z-1)(z+1)}=-\frac2z+\frac3{2(z-1)}+\frac1{2(z+1)}$$The singularities $z=0,1,-1$ all lie inside $|z|=3$ (since $|0|=0,\ |1|=1,\ |-1|=1$ are all less than $3$). Applying Formula 25.3 (the contour integral formula) to each of the three poles, we find that the contour integral of each term is $2\pi i$ in every case, and
$$\oint_{|z|=3}\frac{z+2}{z(z-1)(z+1)}\,dz=-2\cdot(2\pi i)+\frac32\cdot(2\pi i)+\frac12\cdot(2\pi i)=2\pi i\Big(-2+\frac32+\frac12\Big)=2\pi i\cdot0=0$$Even though all three poles are enclosed, the answer is $0$. This is because the sum $A+B+C$ of the coefficients of the partial fraction decomposition (this is the sum of the residues at the poles; a residue is the coefficient that appears when a contour integral is taken around a singularity—the coefficient of $\frac1{z-\alpha}$ in the contour integral formula, Formula 25.3, is exactly this—and residues will be studied properly in a later chapter) happened to be $0$. (A rational function whose numerator has degree at least two less than that of its denominator decays at a rate of about $1/z^2$ as $z\to\infty$, and the present case is in fact an instance of the general fact that, for such a function, the sum of the residues at the poles is always $0$.) Checking by numerical integration (mpmath), we find that the integral over $|z|=3$ is $\approx1.7\times10^{-38}$, which agrees with $0$ within the numerical error.
Exercise 25.3: Direct computation for a non-holomorphic function
Solution
On the unit circle we have $z=e^{i\theta}\ (0\le\theta\le2\pi)$, $\operatorname{Re}(z)=\cos\theta$, and $dz=ie^{i\theta}d\theta$. Hence
$$\oint_{|z|=1}\operatorname{Re}(z)\,dz=\int_0^{2\pi}\cos\theta\cdot ie^{i\theta}\,d\theta=i\int_0^{2\pi}\cos\theta(\cos\theta+i\sin\theta)\,d\theta=i\int_0^{2\pi}\cos^2\theta\,d\theta-\int_0^{2\pi}\sin\theta\cos\theta\,d\theta$$We have $\displaystyle\int_0^{2\pi}\cos^2\theta\,d\theta=\pi$ (using the half-angle formula $\cos^2\theta=\frac{1+\cos2\theta}2$, we get $\int_0^{2\pi}\frac{1+\cos2\theta}2d\theta=\pi+0=\pi$), and $\displaystyle\int_0^{2\pi}\sin\theta\cos\theta\,d\theta=\frac12\int_0^{2\pi}\sin2\theta\,d\theta=0$ (it is an integral over one period, so it is $0$). Therefore
$$\oint_{|z|=1}\operatorname{Re}(z)\,dz=i\pi-0=\pi i$$Writing $f(z)=\operatorname{Re}(z)=x$ in the form $u+iv$, we have $u=x,\ v=0$. Checking the Cauchy–Riemann equations, we have $\dfrac{\partial u}{\partial x}=1$ and $\dfrac{\partial v}{\partial y}=0$, so $u_x=v_y$ (that is, $1=0$) fails to hold anywhere in the complex plane. Hence $f$ is nowhere holomorphic and does not satisfy the hypotheses of Cauchy's integral theorem (Theorem 25.2), so there is no contradiction with the theorem even though the integral is not $0$. (SymPy check: $\pi i$.)
Exercise 25.4: Finding an area with Green's theorem
Solution
Setting $f(x,y)=x$ in the second equation of Theorem 25.1 (Green's theorem), we have $\dfrac{\partial f}{\partial x}=1$, so
$$\oint_C x\,dy=\iint_D 1\,dx\,dy=\text{(area of $D$)}$$Also, setting $f(x,y)=y$ in the first equation, we have $\dfrac{\partial f}{\partial y}=1$, so
$$\oint_C y\,dx=-\iint_D 1\,dx\,dy=-\text{(area of $D$)}$$Therefore, subtracting the second equation from the first and dividing by two, we get
$$\frac12\Big(\oint_C x\,dy-\oint_C y\,dx\Big)=\frac12\Big(\text{area}-(-\text{area})\Big)=\text{area}$$That is, the area of $D$ can be computed as $\displaystyle\frac12\oint_C(x\,dy-y\,dx)$. For the unit circle $C:x=\cos\theta,\ y=\sin\theta\ (0\le\theta\le2\pi)$, substituting $dx=-\sin\theta\,d\theta,\ dy=\cos\theta\,d\theta$, we get
$$\frac12\oint_C(x\,dy-y\,dx)=\frac12\int_0^{2\pi}\big[\cos\theta\cdot\cos\theta-\sin\theta\cdot(-\sin\theta)\big]d\theta=\frac12\int_0^{2\pi}(\cos^2\theta+\sin^2\theta)\,d\theta=\frac12\int_0^{2\pi}1\,d\theta=\frac12\cdot2\pi=\pi$$This indeed agrees with the area $\pi$ of the unit disk. (SymPy check: $\pi$.)
Exercise 25.5: The branch point of the logarithm
Solution
Looking back at why the integral was $0$ in Formula 25.2 (the case $n\neq-1$), we see that the essential point was that the antiderivative $\dfrac{z^{n+1}}{n+1}$ of the integrand $z^n$ is a single-valued function (one whose value is uniquely determined for each $z$) on the whole complex plane except $z=0$. Even when $\theta$ changes from $0$ to $2\pi$ as we go once around the circle, $z=re^{i\cdot0}$ and $z=re^{i\cdot2\pi}$ are the same point, so the value of the antiderivative returns to exactly the same value, and as a result the definite integral (a difference of values of the antiderivative) is $0$.
But the function $\log z=\ln r+i\theta$ itself is a multivalued function: each time we go once around $z=0$ (increase $\theta$ by $2\pi$), its imaginary part keeps increasing by $2\pi$. Although $z=re^{i\cdot0}$ and $z=re^{i\cdot2\pi}$ are the same point in the complex plane, the values of $\log z$ are the different values $\ln r$ and $\ln r+2\pi i$. The point $z=0$ is the cause of this discrepancy, and it is called a branch point. Since $\log z$ is a function that “does not return to its original value after one loop” around $z=0$, the reasoning used for $z^n\ (n\neq-1)$, “go around once and everything is back as before, so the integral is $0$,” simply does not hold in the first place. The nonzero value $2\pi ri$ actually computed in Example 25.3 is exactly this “discrepancy after one loop” showing up in the form of an integral.
Exercise 25.6: Why we may shrink the path of integration
Solution
Consider two simple closed curves of different shapes, $C$ (the original path) and $C_r$ (a small circle centered at $\alpha$), each of which encloses just the one singularity $\alpha$ in its interior. Let $D$ be the domain obtained by removing the interior of $C_r$ from the interior of $C$. Then $D$ is a doubly connected domain (with one hole) having outer boundary $C$ and inner boundary $C_r$, and since the singularity $\alpha$ lies outside $D$ (inside $C_r$), the function $f$ is holomorphic on $D$ and its boundary.
Theorem 25.4 (application to multiply connected domains) showed the relation $\oint_C f\,dz=\oint_{C_1}f\,dz+\oint_{C_2}f\,dz$ for a triply connected domain with two holes, but the same proof (insert one bridging cut from the outer boundary to the boundary of a hole to make the domain simply connected, apply Cauchy's integral theorem, and drop the parts that cancel each other) can be used as it is when there is one hole; the equation becomes simpler by one bridging segment and one hole, and the proof gives the relation of Corollary 25.2:
$$\oint_C f(z)\,dz=\oint_{C_r}f(z)\,dz$$That is, as long as the integrand $f$ is holomorphic throughout the domain between $C$ and $C_r$, the integrals over the two boundaries are exactly equal. In other words, however much and into whatever shape we deform $C$, as long as we do not jump over the singularity $\alpha$ (even if we finally shrink it all the way down to the small circle $C_r$), the value of the integral does not change. This is precisely why an integral such as $\oint_C\frac{dz}{z-\alpha}$ may be computed over a small circle centered at $\alpha$, which is easy to work with, instead of directly over the complicated curve $C$ (this is the argument actually used in the proof of Formula 25.3).
← Back to Chapter 25, “Complex Integration and Cauchy's Integral Theorem”
Chapter 26 Cauchy's Integral Formula
Exercise 26.1: Checking $\displaystyle\oint_{|z|=2}\frac{z+1}{z(z-1)}\,dz$ in two ways
Solution
(a) The method of partial fraction decomposition. Let $\dfrac{z+1}{z(z-1)}=\dfrac{A}{z}+\dfrac{B}{z-1}$. Putting the right-hand side over a common denominator, we get
$$ z+1=A(z-1)+Bz $$(We cleared the denominators.) Substituting $z=0$ gives $0+1=A(0-1)+0$, so $1=-A$, that is, $A=-1$. Substituting $z=1$ gives $1+1=0+B\cdot1$, so $B=2$. Hence
$$ \frac{z+1}{z(z-1)}=-\frac1z+\frac{2}{z-1} $$The interior of the circle $|z|=2$ contains both $z=0$ and $z=1$ ($|0|=0\lt2$, $|1|=1\lt2$). Using the contour integral formula (Section 25.5) $\oint_{|z|=2}\dfrac{1}{z-\alpha}dz=2\pi i$ (when $\alpha$ lies in the interior) twice, we obtain
$$ \oint_{|z|=2}\frac{z+1}{z(z-1)}\,dz=-1\cdot(2\pi i)+2\cdot(2\pi i)=2\pi i(-1+2)=2\pi i $$(b) The method of Cauchy's integral formula. Near $z=0$, we view $\dfrac{z+1}{z(z-1)}=\dfrac{f_1(z)}{z-0}$ ($f_1(z):=\dfrac{z+1}{z-1}$, which is holomorphic near $z=0$). Since $f_1(0)=\dfrac{0+1}{0-1}=-1$, by Theorem 26.1 the contribution is $2\pi i\cdot(-1)=-2\pi i$. Near $z=1$, we view $\dfrac{z+1}{z(z-1)}=\dfrac{f_2(z)}{z-1}$ ($f_2(z):=\dfrac{z+1}{z}$). Since $f_2(1)=\dfrac{1+1}{1}=2$, the contribution is $2\pi i\cdot2=4\pi i$. Adding the two contributions gives
$$ \oint_{|z|=2}\frac{z+1}{z(z-1)}\,dz=-2\pi i+4\pi i=2\pi i $$This agrees perfectly with the result $2\pi i$ of (a) (Python check: verify/univmath/ch26_cauchy_examples.py). Note also that the coefficients of the terms of the partial fraction decomposition ($A=-1,\ B=2$) coincide exactly with the values $f_1(0)=-1,\ f_2(1)=2$ computed by Cauchy's integral formula—this is no accident, because each coefficient of the partial fraction decomposition is nothing other than “the value obtained by evaluating at that singularity with Cauchy's integral formula.”
Exercise 26.2: The relation between Step 1 of the proof and the principle of path deformation
Solution
In Section 25.4, we rewrote the contour integral over a multiply connected domain with several holes (for example, a triply connected domain) as the sum of the integral over the outer boundary and the integrals over the small circles surrounding the individual holes. The key at that time was to draw one “bridging segment” connecting one hole to another, or a hole to the outer boundary, so that the whole could be regarded as a single simply connected domain, and then to apply Cauchy's integral theorem (if a function is holomorphic on a simply connected domain, its contour integral is $0$). The bridging segment is traversed twice, once going and once returning, in opposite directions, so the two integrals cancel exactly, and what remained was only the conclusion that “the integral along the outer boundary” equals “the sum of the integrals along the circles surrounding the inner holes.”
Step 1 of the proof of Theorem 26.1 (Figure 26.4) has exactly the same structure. Here the “hole” is the inside of the disk $|\zeta-z|\lt\rho$ of radius $\rho$ centered at the point $z$, and the integrand $\dfrac{f(\zeta)}{\zeta-z}$ cannot be defined inside this hole (it is not holomorphic there), because its denominator becomes $0$ at $\zeta=z$. So we connect the outer boundary $\partial D$ and the circle $C_\rho$, which is the boundary of the hole, by a thin corridor (two bridging segments drawn very close together), as in Figure 26.4. Then the domain obtained from $D$ by removing the disk $|\zeta-z|\lt\rho$ can be regarded as a single simply connected domain if we cut it open along the corridor, and the integrand is holomorphic everywhere inside it. Therefore, by Cauchy's integral theorem, the integral over the entire path consisting of “one counterclockwise circuit of $\partial D$ + passage inward along the corridor + one clockwise circuit of $C_\rho$ (when the hole is viewed as part of the boundary of the simply connected domain, the direction is reversed) + passage outward along the corridor” is $0$. The inward and outward integrals along the corridor cancel, because they follow the same path in opposite directions, and what remains is
$$ \oint_{\partial D}\frac{f(\zeta)}{\zeta-z}\,d\zeta-\oint_{C_\rho}\frac{f(\zeta)}{\zeta-z}\,d\zeta=0 $$(The sign of the $C_\rho$ term is negative because, viewed as part of the boundary of the simply connected domain, $C_\rho$ is traversed clockwise, that is, in the direction opposite to counterclockwise.) Rearranging this, we obtain exactly the equality used in Step 1 of the proof, $\displaystyle\oint_{\partial D}\frac{f(\zeta)}{\zeta-z}\,d\zeta=\oint_{C_\rho}\frac{f(\zeta)}{\zeta-z}\,d\zeta$. In other words, Step 1 of the proof is nothing other than an application of the argument for multiply connected domains in Section 25.4 to “the case with only one hole.”
Exercise 26.3: Behavior of the keyhole integral in the limit
Solution
We list once more the integrals along the four paths found in Section 26.2.5.
$$ \begin{aligned} \int_{C_1}\log z\,dz&=-2R\log R-i\pi R+2R\\ \int_{C_2}\log z\,dz&=R\log R-R-\varepsilon\log\varepsilon+\varepsilon+i\pi R-i\pi\varepsilon\\ \int_{C_3}\log z\,dz&=2\varepsilon\log\varepsilon+i\pi\varepsilon-2\varepsilon\\ \int_{C_4}\log z\,dz&=R\log R-R-\varepsilon\log\varepsilon+\varepsilon \end{aligned} $$As $R\to\infty$, we have $R\log R\to\infty$ and $i\pi R\to\infty$ (its absolute value grows), so $C_1$ alone diverges, and $C_2$ alone also diverges (because of the $R\log R$ and $i\pi R$ terms). However, if we extract just the coefficient of $R\log R$, it is $-2$ for $C_1$, $+1$ for $C_2$, and $+1$ for $C_4$, and $-2+1+1=0$, so these cancel. Similarly, the coefficients of the terms in $R$ that do not involve a logarithm are $+2$ for $C_1$, $-1$ for $C_2$, and $-1$ for $C_4$, and $2-1-1=0$. The coefficients of the $i\pi R$ terms are $-1$ for $C_1$ and $+1$ for $C_2$, and $-1+1=0$. Therefore, in $C_1+C_2+C_4$, all the terms involving $R$ (including the divergent ones) cancel neatly, and no part depending on $R$ remains.
On the other hand, as $\varepsilon\to0$, we have $\varepsilon\log\varepsilon\to0$ (this can be shown by writing $\varepsilon\log\varepsilon=\dfrac{\log\varepsilon}{1/\varepsilon}$ and using l'Hôpital's rule, or by setting $t=1/\varepsilon\to\infty$ and noting that $-\log t/t\to0$), $\varepsilon\to0$, and $i\pi\varepsilon\to0$, so all the terms containing $\varepsilon$ tend to $0$. In particular, the integral $2\varepsilon\log\varepsilon+i\pi\varepsilon-2\varepsilon$ over $C_3$ (the small arc) converges as a whole to $0$ as $\varepsilon\to0$—as we shrink the small arc more and more, its contribution to the integral disappears.
In conclusion, in the limit $R\to\infty,\ \varepsilon\to0$, the divergent terms contained in $C_1,C_2,C_4$ (the terms in $R\log R$, $R$, and $i\pi R$) cancel exactly even before the limit is taken, the terms containing $\varepsilon$ tend to $0$ in the limit, and $C_3$ also vanishes entirely, so the total remains exactly $0$ at every stage (both before and after taking the limit). This is merely a restatement, from the viewpoint of the limit, of the fact seen in Section 26.2.5 that “the total is exactly $0$ for any $0\lt\varepsilon\lt R$.”
Exercise 26.4: Cauchy's integral formula cannot be used for a function that is not holomorphic, namely $\bar z$
Solution
Setting $z=e^{i\theta}$ ($0\le\theta\le2\pi$), we have $\bar z=\overline{e^{i\theta}}=e^{-i\theta}$ (Chapter 21: $\overline{e^{i\theta}}=e^{-i\theta}$) and $dz=ie^{i\theta}d\theta$. Therefore
$$ \oint_{|z|=1}\bar z\,dz=\int_0^{2\pi}e^{-i\theta}\cdot ie^{i\theta}\,d\theta=\int_0^{2\pi}i\,d\theta=i\Big[\theta\Big]_0^{2\pi}=2\pi i $$(Since $e^{-i\theta}\cdot e^{i\theta}=e^{-i\theta+i\theta}=e^0=1$, the integrand is the constant $i$.)
Next, we confirm that $f(z)=\bar z$ is not holomorphic. Setting $z=x+iy$, we have $f(z)=\bar z=x-iy$, with real part $u(x,y)=x$ and imaginary part $v(x,y)=-y$. The Cauchy–Riemann equations (Chapter 24) require that $\pdiff{u}{x}=\pdiff{v}{y}$ and $\pdiff{u}{y}=-\pdiff{v}{x}$, but here $\pdiff{u}{x}=1$ and $\pdiff{v}{y}=-1$, and since $1\ne-1$, the first equation fails at every point. Therefore $f(z)=\bar z$ is not holomorphic at any point of the complex plane, and neither Cauchy's integral theorem of the previous chapter nor Cauchy's integral formula of this chapter can be applied, because the first assumption (that $f$ be holomorphic) is not satisfied.
Nevertheless, it is not a coincidence that the value of the integral came out to be exactly $2\pi i$. In general, let $D$ be the region enclosed by a simple closed curve $C$. Then $\bar z\,dz=(x-iy)(dx+i\,dy)=(x\,dx+y\,dy)+i(x\,dy-y\,dx)$, and applying Green's theorem (Section 26.1) to the real and imaginary parts separately, it is known that the integral of the real part, being of the form of an exact differential ($x\,dx+y\,dy=\dfrac12d(x^2+y^2)$), is $0$ along a closed curve, while the integral of the imaginary part is $\displaystyle\int_C(x\,dy-y\,dx)=2\times(\text{area of $D$})$. Therefore the formula $\displaystyle\oint_C\bar z\,dz=2i\times(\text{area})$ holds—a formula unrelated to holomorphy (it comes from Green's theorem alone). Since the area of the unit disk is $\pi$, we get $\oint_{|z|=1}\bar z\,dz=2i\pi=2\pi i$, which agrees exactly with the result of the direct computation. Note that the fact that “the numerical value of the answer looks the same as the answer given by Cauchy's integral formula ($2\pi i\cdot1$)” arises for a completely different reason (area, not holomorphy).
Exercise 26.5: Verification of Green's theorem ($f=x^2-y^2$, upper half-disk)
Solution
The arc part: Setting $x=r\cos\theta,\,y=r\sin\theta$ ($\theta:0\to\pi$), by the double-angle formula $\cos2\theta=\cos^2\theta-\sin^2\theta$ (high school mathematics) we have $f=x^2-y^2=r^2(\cos^2\theta-\sin^2\theta)=r^2\cos2\theta$. Since $dx=-r\sin\theta\,d\theta$,
$$ \int_{C_{\text{arc}}}f\,dx=\int_0^\pi r^2\cos2\theta\cdot(-r\sin\theta)\,d\theta=-r^3\int_0^\pi\sin\theta\cos2\theta\,d\theta $$Using the product-to-sum formula $\sin A\cos B=\dfrac12\big(\sin(A+B)+\sin(A-B)\big)$ (high school mathematics, with $A=\theta,\,B=2\theta$), we have $\sin\theta\cos2\theta=\dfrac12(\sin3\theta+\sin(-\theta))=\dfrac12(\sin3\theta-\sin\theta)$, so
$$ \int_0^\pi\sin\theta\cos2\theta\,d\theta=\frac12\int_0^\pi\sin3\theta\,d\theta-\frac12\int_0^\pi\sin\theta\,d\theta =\frac12\left[-\frac{\cos3\theta}{3}\right]_0^\pi-\frac12\Big[-\cos\theta\Big]_0^\pi $$We have $\left[-\dfrac{\cos3\theta}{3}\right]_0^\pi=-\dfrac{\cos3\pi}{3}-\left(-\dfrac{\cos0}{3}\right)=-\dfrac{-1}{3}+\dfrac13=\dfrac13+\dfrac13=\dfrac23$ ($\cos3\pi=\cos\pi=-1$). Also, $\Big[-\cos\theta\Big]_0^\pi=-(-1)-(-1)=2$. Hence
$$ \int_0^\pi\sin\theta\cos2\theta\,d\theta=\frac12\cdot\frac23-\frac12\cdot2=\frac13-1=-\frac23 $$Therefore $\displaystyle\int_{C_{\text{arc}}}f\,dx=-r^3\times\left(-\frac23\right)=\frac23r^3$. For the diameter part, on $y=0$ we have $f(x,0)=x^2-0^2=x^2$, which is exactly the same as the computation in Section 26.1.2, so $\displaystyle\int_{C_{\text{diam}}}f\,dx=\int_{-r}^r x^2\,dx=\dfrac23r^3$. Adding these up, the line integral over the boundary is
$$ \int_C f\,dx=\frac23r^3+\frac23r^3=\frac43r^3 $$Next, the double-integral side. We have $\pdiff{f}{y}=\pdiff{}{y}(x^2-y^2)=-2y$. Using polar coordinates $x=r'\cos\theta,\,y=r'\sin\theta$ and $dx\,dy=r'\,dr'\,d\theta$, we get
$$ \iint_D\pdiff{f}{y}\,dx\,dy=\int_0^\pi\int_0^r(-2y)\cdot r'\,dr'\,d\theta=\int_0^\pi\int_0^r(-2r'\sin\theta)\cdot r'\,dr'\,d\theta =-2\left(\int_0^r r'^2\,dr'\right)\left(\int_0^\pi\sin\theta\,d\theta\right) $$ $$ =-2\cdot\frac{r^3}{3}\cdot2=-\frac43r^3 $$Therefore $\displaystyle-\iint_D\pdiff{f}{y}\,dx\,dy=\frac43r^3$, which agrees with the left-hand side $\dfrac43r^3$ (Python check: verify/univmath/ch26_green_theorem.py). Note that, compared with the result for $f=x^2+y^2$ in Section 26.1.2 ($-\dfrac43r^3$), the sign is reversed and it becomes $+\dfrac43r^3$. This is because, although, as before, $f=x^2-y^2$ is unchanged under $y\to-y$ ($f\to f$; an even function), the sign of $y^2$ is reversed, so that $\pdiff{f}{y}=-2y$ (reversed from the $+2y$ of the case $x^2+y^2$), and this reversal is carried over directly to the sign of the double integral.
Exercise 26.6: The meaning of the mean value property
Solution
In Cauchy's integral formula $\displaystyle f(z)=\frac{1}{2\pi i}\oint_{\partial D}\frac{f(\zeta)}{\zeta-z}\,d\zeta$, we take the boundary $\partial D$ to be the circle itself, with center $z$ and radius $\rho$. A point on the circle can be parametrized as $\zeta=z+\rho e^{i\theta}$ ($\theta$ runs from $0$ to $2\pi$). Then $\zeta-z=\rho e^{i\theta}$ and $d\zeta=i\rho e^{i\theta}\,d\theta$ (we differentiated $\zeta$ with respect to $\theta$). Substituting these, we obtain
$$ f(z)=\frac{1}{2\pi i}\int_0^{2\pi}\frac{f(z+\rho e^{i\theta})}{\rho e^{i\theta}}\cdot i\rho e^{i\theta}\,d\theta $$The $\rho e^{i\theta}$ in the denominator and the $\rho e^{i\theta}$ in the numerator cancel exactly, leaving only $i$, so
$$ f(z)=\frac{1}{2\pi i}\int_0^{2\pi}f(z+\rho e^{i\theta})\cdot i\,d\theta=\frac{i}{2\pi i}\int_0^{2\pi}f(z+\rho e^{i\theta})\,d\theta=\frac{1}{2\pi}\int_0^{2\pi}f(z+\rho e^{i\theta})\,d\theta $$(using $i/i=1$). This is the mean value property. Put in terms that a high-school student can follow, it says: “If we keep measuring the values of $f$ while going once around the circle of radius $\rho$ centered at $z$, and average the measured values over the whole circuit, the average coincides exactly with the value $f(z)$ at the center point $z$.” For an ordinary (non-complex) function, there is no guarantee whatsoever that averaging the values here and there on a circle gives the value at the center—for example, if we average $f(x,y)=x$ (a function on the plane) over a circle centered at the origin, then by symmetry we indeed get $0=f(0,0)$, but that is only because this function happens to have a symmetry like that of an odd function. For holomorphic functions, on the other hand, this mean value property always holds, for any holomorphic function and for a circle of any radius. This expresses the fact that a holomorphic function is a special kind of function that is “very strongly bound by the information around it”—one cannot change its value at a single point arbitrarily.
← Back to Chapter 26, “Cauchy's Integral Formula”
Chapter 27 Orthogonality of Trigonometric Functions and Inner Products of Functions
Exercise 27.1: Computing an integral using the orthogonality formulas
Solution
Using the linearity of the integral (the integral of a sum is the sum of the integrals, and constant multiples can be taken outside), we expand the integrand.
$$ \int_{-\pi}^{\pi}\left(5\sin3x-2\cos7x+1\right)\sin3x\,dx =5\int_{-\pi}^{\pi}\sin3x\sin3x\,dx-2\int_{-\pi}^{\pi}\cos7x\sin3x\,dx+\int_{-\pi}^{\pi}\sin3x\,dx $$The first term has the form $\sin mx\sin nx$ with $m=n=3$ (both are positive integers, and they are equal), so $\displaystyle\int_{-\pi}^{\pi}\sin3x\sin3x\,dx=\pi$ (the case $m=n$ of Formula 27.5). The second term has the form $\cos mx\sin nx=\sin nx\cos mx$ (with $m=7,n=3$), so by Formula 27.3, $\displaystyle\int_{-\pi}^{\pi}\cos7x\sin3x\,dx=0$. The third term is the integral of a lone $\sin mx$ with $m=3\,(\neq0)$, so by Formula 27.1, $\displaystyle\int_{-\pi}^{\pi}\sin3x\,dx=0$. Therefore,
$$ 5\cdot\pi-2\cdot0+0=5\pi $$This is the answer (we verified, by expanding and integrating directly with SymPy, that the result agrees with $5\pi$: verify/univmath/ch27_examples.py).
Exercise 27.2: Does orthogonality also hold on the interval $[0,2\pi]$?
Solution
Carrying out the computation, we obtain $\displaystyle\int_0^{2\pi}\cos2x\cos3x\,dx=0$ (verified with SymPy; for reference, on the same interval $\displaystyle\int_0^{2\pi}\cos^22x\,dx=\pi$, which also agrees with the value on $[-\pi,\pi]$).
The reason it holds in general can be explained as follows. The function $\cos mx\cos nx$ ($m,n$ integers) can be written as products and sums of $\cos x,\cos2x,\dots$, and since $\sin x,\cos x$ both have period $2\pi$, $\cos mx\cos nx$ is itself a periodic function with period $2\pi$ (if $m,n$ are integers, then $\cos m(x+2\pi)=\cos(mx+2\pi m)=\cos mx$ and $\cos n(x+2\pi)=\cos nx$, so the product $\cos mx\cos nx$ is also invariant under $x\to x+2\pi$). In general, when a periodic function $h(x)$ with period $T$ is integrated over an interval of “length exactly one period ($T$),” the value does not depend on the position of the interval (where we start measuring) and is always the same—this is easy to accept if you picture the graph, since even if we shift the interval to the right by the period $T$, the shape of the waveform itself does not change at all, and the total of the “areas of the peaks and valleys” over one period does not change (rigorously, differentiating $\displaystyle\int_a^{a+T}h(x)\,dx$ with respect to $a$ gives $h(a+T)-h(a)=0$, which shows that the value of this integral is a constant independent of $a$). Both $[-\pi,\pi]$ and $[0,2\pi]$ are intervals of length $2\pi$ (exactly the same length as the period $2\pi$), so by this general fact the integral of $\cos mx\cos nx$ has the same value whether we take the interval to be $[-\pi,\pi]$ or $[0,2\pi]$. Therefore, as long as the interval of integration is an “interval of length $2\pi$,” the orthogonality formulas of this chapter (Formulas 27.1–27.5) hold wherever we take it, not only on $[-\pi,\pi]$.
Exercise 27.3: Inner products and norms of functions other than trigonometric functions
Solution
By the definition of the inner product (Definition 27.1),
$$ \langle f,g\rangle=\int_0^1e^x\cdot1\,dx=\Big[e^x\Big]_0^1=e-1\approx1.718 $$(We used the integration formula for the exponential function from Chapter 5, $\int e^x\,dx=e^x+C$.) By the definition of the norm (Definition 27.2),
$$ \|f\|=\sqrt{\int_0^1(e^x)^2\,dx}=\sqrt{\int_0^1e^{2x}\,dx}=\sqrt{\left[\frac12e^{2x}\right]_0^1}=\sqrt{\frac{e^2-1}{2}}\approx1.787,\qquad \|g\|=\sqrt{\int_0^11^2\,dx}=\sqrt{1}=1 $$Therefore $\|f\|\|g\|=\sqrt{\dfrac{e^2-1}{2}}\approx1.787$. Comparing this with $|\langle f,g\rangle|=e-1\approx1.718$, we have $1.718\le1.787$, so Schwarz's inequality (Theorem 27.1) $|\langle f,g\rangle|\le\|f\|\|g\|$ does indeed hold (verified with SymPy).
Exercise 27.4: Finding the norm from the coefficients of an orthogonal basis
Solution
The indices of $\cos x,\cos3x,\cos5x$ are all distinct positive integers, so by Formula 27.4 ($m\neq n$) they are mutually orthogonal, and by Formula 27.4 ($m=n$) we have $\|\cos x\|=\|\cos3x\|=\|\cos5x\|=\sqrt\pi$. When we expand the square of the norm according to the definition, all the cross terms (products of functions with different indices) integrate to $0$ by Formula 27.4 ($m\neq n$), and only the squared terms remain.
$$ \|y\|^2=\langle y,y\rangle=\int_{-\pi}^{\pi}(2\cos x+\cos3x-\cos5x)^2\,dx=2^2\int_{-\pi}^{\pi}\cos^2x\,dx+1^2\int_{-\pi}^{\pi}\cos^23x\,dx+(-1)^2\int_{-\pi}^{\pi}\cos^25x\,dx $$ $$ =2^2\cdot\pi+1^2\cdot\pi+(-1)^2\cdot\pi=(4+1+1)\pi=6\pi $$Hence $\|y\|=\sqrt{6\pi}$ (we verified with SymPy, by expanding and integrating $\displaystyle\int_{-\pi}^{\pi}(2\cos x+\cos3x-\cos5x)^2\,dx$ directly, that it agrees with $6\pi$). Using the general formula $\|y\|^2=\pi\sum_kc_k^2$ from Example 27.3 ($c_k$ being the coefficients $2,1,-1$) also immediately gives the same result, $\pi(2^2+1^2+(-1)^2)=6\pi$.
Exercise 27.5: An example where piecewise continuity fails
Solution
We examine the one-sided limits of the function in the problem at $x=0$.
$$ \lim_{x\to0+0}\frac1x=+\infty,\qquad\lim_{x\to0-0}\frac1x=-\infty $$(As $x$ approaches $0$ from positive values, $1/x$ becomes arbitrarily large, and when the approach is from negative values, it becomes arbitrarily small, that is, arbitrarily large in the negative direction. Verified with SymPy.) Neither one-sided limit exists as a finite value (they diverge to $\pm\infty$).
Checking Definition 27.3 once more, condition (ii) requires that “at each point of discontinuity, the left-hand limit and the right-hand limit both exist (as finite values).” At $x=0$, neither the left-hand limit nor the right-hand limit exists as a finite value (they diverge), so this condition is not satisfied. Therefore $f(x)=1/x\,(x\neq0),\ f(0)=0$ is not piecewise continuous on the interval $[-1,1]$. Whereas the functions up through Exercise 27.4 were all piecewise continuous (being trigonometric functions, exponential functions, or polynomials), a function of the type $1/x$ is a typical example of one that falls outside the framework of piecewise continuity, because its denominator becomes $0$ at the origin and the function diverges.
Exercise 27.6: Numerical check of the triangle inequality
Solution
By Example 27.2, $\|f\|=\dfrac{\sqrt6}{3}\approx0.8165$ and $\|g\|=\dfrac{\sqrt{10}}{5}\approx0.6325$. First we compute $\|f\|+\|g\|$:
$$ \|f\|+\|g\|=\frac{\sqrt6}{3}+\frac{\sqrt{10}}{5}\approx0.8165+0.6325=1.4490 $$Next we compute $\|f+g\|$ directly according to Definition 27.2. Since $(f+g)(x)=x+x^2$,
$$ \|f+g\|^2=\int_{-1}^1(x+x^2)^2\,dx=\int_{-1}^1\left(x^2+2x^3+x^4\right)dx $$Since $2x^3$ is an odd function, its integral over the symmetric interval $[-1,1]$ is $0$ (for the same reason as in the alternative solution to Formula 27.3). The remaining two terms are
$$ \int_{-1}^1x^2\,dx=\left[\frac{x^3}{3}\right]_{-1}^1=\frac13-\left(-\frac13\right)=\frac23,\qquad \int_{-1}^1x^4\,dx=\left[\frac{x^5}{5}\right]_{-1}^1=\frac15-\left(-\frac15\right)=\frac25 $$Therefore $\|f+g\|^2=\dfrac23+\dfrac25=\dfrac{10}{15}+\dfrac6{15}=\dfrac{16}{15}$, and hence
$$ \|f+g\|=\sqrt{\frac{16}{15}}=\frac{4}{\sqrt{15}}=\frac{4\sqrt{15}}{15}\approx1.0328 $$(We verified with SymPy, by direct integration, that the values agree.) Comparing $\|f+g\|\approx1.0328$ with $\|f\|+\|g\|\approx1.4490$, we have $1.0328\le1.4490$, so Theorem 27.2 (the triangle inequality) $\|f+g\|\le\|f\|+\|g\|$ does indeed hold. Note that equality ($\|f+g\|=\|f\|+\|g\|$) holds only when $f,g$ point in the same “direction” (one is a constant multiple of the other, the constant being $0$ or greater)—in this case $f(x)=x$ and $g(x)=x^2$ are not proportional, so the inequality holds as a genuinely strict inequality ($\lt$).
← Back to Chapter 27, “Orthogonality of Trigonometric Functions and Inner Products of Functions”
Chapter 28 Definition of Fourier Series and Worked Examples
Exercise 28.1: Computing a complex Fourier series
Solution
We find the complex Fourier series of the function obtained by extending $f(x)=e^x\ (-\pi \lt x\le\pi)$ with period 2π. By Theorem 28.4 ($L=\pi$),
$$ C_k=\frac{1}{2\pi}\int_{-\pi}^{\pi}e^x\,e^{-ikx}\,dx=\frac{1}{2\pi}\int_{-\pi}^{\pi}e^{(1-ik)x}\,dx $$(we combined the exponentials using the law of exponents: $e^x\cdot e^{-ikx}=e^{x-ikx}=e^{(1-ik)x}$). Since $1-ik\ne0$ ($k$ is an integer and $i$ is the imaginary unit, so $1-ik=0$ holds only when $k=-i$, which cannot happen for a real integer $k$), the antiderivative formula for the exponential function, $\int e^{cx}dx=\frac1ce^{cx}$ ($c=1-ik$ is a complex constant), can be used as it stands, and we obtain
$$ C_k=\frac{1}{2\pi}\left[\frac{1}{1-ik}e^{(1-ik)x}\right]_{-\pi}^{\pi} =\frac{1}{2\pi(1-ik)}\Bigl(e^{(1-ik)\pi}-e^{-(1-ik)\pi}\Bigr) $$Splitting the exponents into real and imaginary parts gives $e^{(1-ik)\pi}=e^{\pi}e^{-ik\pi}$ and $e^{-(1-ik)\pi}=e^{-\pi}e^{ik\pi}$. Here $k$ is an integer, so by Euler's formula $e^{\pm ik\pi}=\cos k\pi\pm i\sin k\pi=(-1)^k\pm i\cdot0=(-1)^k$ (since $\sin k\pi=0$, the value is the same for either sign). Therefore
$$ e^{(1-ik)\pi}-e^{-(1-ik)\pi}=(-1)^k e^{\pi}-(-1)^k e^{-\pi}=(-1)^k\bigl(e^{\pi}-e^{-\pi}\bigr)=2(-1)^k\sinh\pi $$(we used the hyperbolic sine, $\sinh\pi=\frac{e^\pi-e^{-\pi}}2$). Hence
$$ C_k=\frac{2(-1)^k\sinh\pi}{2\pi(1-ik)}=\frac{(-1)^k\sinh\pi}{\pi(1-ik)} $$Finally, as the hint directs, we make the denominator real. Multiplying the numerator and the denominator by $1+ik$ (the complex conjugate of $1-ik$) and using $(1-ik)(1+ik)=1-(ik)^2=1-i^2k^2=1+k^2$, we obtain
$$ C_k=\frac{(-1)^k\sinh\pi\,(1+ik)}{\pi(1-ik)(1+ik)}=\frac{(-1)^k(1+ik)\sinh\pi}{\pi(1+k^2)}\qquad(k\in\Z) $$This expression can be used as it stands, because even when we substitute $k=0$ the denominator does not become $0$ ($1+0^2=1$). Indeed, substituting $k=0$ directly gives $C_0=\dfrac{\sinh\pi}{\pi}$, and this agrees exactly with the value $C_0=\frac1{2\pi}\int_{-\pi}^\pi e^x\,dx=\frac1{2\pi}(e^\pi-e^{-\pi})=\frac{\sinh\pi}{\pi}$ obtained by substituting $k=0$ directly into the defining formula. Therefore, regardless of the sign of $k$, we have the single formula
$$ f(x)=\sum_{k=-\infty}^{\infty}\frac{(-1)^k(1+ik)\sinh\pi}{\pi(1+k^2)}\,e^{ikx} $$This is the answer (Python check: verify/univmath/ch28_explore4.py, ch28_explore5.py—we confirmed that $C_k$ obtained by direct integration with SymPy and the expression computed by hand above agree for all of $k=\pm1,\pm2,\pm3$. Numerically as well, for $k=1$ both agree with $C_1\approx-1.838-1.838i$).
Exercise 28.2: Fourier cosine series of period 2L
Solution
We find the Fourier cosine series of the function obtained by extending $f(x)=|x|\ (-3 \lt x\le3)$ with period 6 ($L=3$). Since $f(-x)=|-x|=|x|=f(x)$, $f$ is an even function, so by Theorem 28.3(I) we have $b_k=0$ from the outset, and only $\cos$ terms appear.
Computation of $a_0$. By Theorem 28.2,
$$ a_0=\frac1{2L}\int_{-L}^{L}f(x)\,dx=\frac16\int_{-3}^{3}|x|\,dx $$Since the integrand $|x|$ is an even function, we can write $\int_{-3}^3=2\int_0^3$ (we double the area under a graph that is symmetric about the vertical axis), and since $|x|=x$ for $x\ge0$,
$$ a_0=\frac16\cdot2\int_0^{3}x\,dx=\frac13\left[\frac{x^2}{2}\right]_0^{3}=\frac13\cdot\frac92=\frac32 $$Computation of $a_k\ (k\ge1)$. Similarly, the integrand $|x|\cos\frac{k\pi}{L}x$ is also an even function (even × even = even), so we can write $\int_{-3}^3=2\int_0^3$.
$$ a_k=\frac1L\int_{-L}^{L}f(x)\cos\frac{k\pi}{L}x\,dx=\frac13\cdot2\int_0^{3}x\cos\frac{k\pi}{3}x\,dx=\frac23\int_0^{3}x\cos\frac{k\pi}{3}x\,dx $$With $a=\dfrac{k\pi}{3}$, we use the general indefinite integral formula $\int x\cos ax\,dx=\frac1ax\sin ax+\frac1{a^2}\cos ax$, which was verified in the “Math Note” in Section 28.4.
$$ \int_0^{3}x\cos\frac{k\pi}{3}x\,dx=\left[\frac{3}{k\pi}x\sin\frac{k\pi}{3}x+\frac{9}{k^2\pi^2}\cos\frac{k\pi}{3}x\right]_0^{3} $$(we substituted $\frac1a=\frac3{k\pi}$ and $\frac1{a^2}=\frac9{k^2\pi^2}$). Substituting $x=3$ and using $\frac{k\pi}{3}\cdot3=k\pi$, we have $\sin k\pi=0$ and $\cos k\pi=(-1)^k$ ($k$ is an integer), so the first term vanishes and only the second term remains. At $x=0$ as well, the first term is $0$ because $x=0$, and in the second term $\cos0=1$. Therefore
$$ \int_0^{3}x\cos\frac{k\pi}{3}x\,dx=\left(0+\frac{9}{k^2\pi^2}(-1)^k\right)-\left(0+\frac{9}{k^2\pi^2}\right)=\frac{9}{k^2\pi^2}\bigl((-1)^k-1\bigr) $$Hence
$$ a_k=\frac23\cdot\frac{9}{k^2\pi^2}\bigl((-1)^k-1\bigr)=\frac{6\bigl((-1)^k-1\bigr)}{\pi^2k^2} $$When $k$ is even, $(-1)^k-1=0$, so $a_k=0$. When $k$ is odd, $(-1)^k-1=-2$, so $a_k=\dfrac{-12}{\pi^2k^2}$. Thus the Fourier cosine series is
$$ f(x)=\frac32+\sum_{k=1}^{\infty}\frac{6\bigl((-1)^k-1\bigr)}{\pi^2k^2}\cos\frac{k\pi}{3}x =\frac32-\frac{12}{\pi^2}\left(\cos\frac{\pi}{3}x+\frac19\cos\pi x+\frac1{25}\cos\frac{5\pi}{3}x+\cdots\right) $$(Python check: verify/univmath/ch28_explore4.py, ch28_explore5.py—we confirmed $a_0=3/2$ and $a_k=6\{(-1)^k-1\}/(\pi^2k^2)$ for $k=1,\ldots,4$. We can also verify that this formula is, in the form $a_0=L/2$ and $a_k=\frac{2L}{\pi^2}\cdot\frac{(-1)^k-1}{k^2}$, the generalization ($L=\pi\to L=3$) of the result $a_k=2\{(-1)^k-1\}/(\pi k^2)$ for the “triangle wave $|x|$ of period 2π” seen in Example 28.3 and Example 28.6: substituting $L=\pi$ gives $a_0=\pi/2$ and $a_k=2\{(-1)^k-1\}/(\pi k^2)$, which returns exactly to the result of Example 28.6.)
Exercise 28.3: Proof that only cosine terms appear in the Fourier series of an even function
Solution
Let $f(x)$ be an even function of period $2L$ ($f(-x)=f(x)$ for all $x$). What we want to show is the following:
$$ b_k=\frac1L\int_{-L}^{L}f(x)\sin\frac{k\pi}{L}x\,dx=0\qquad(\text{for all}\ k=1,2,\ldots) $$We split the interval of integration $[-L,L]$ into the two intervals $[-L,0]$ and $[0,L]$ (splitting of the interval of integration).
$$ \int_{-L}^{L}f(x)\sin\frac{k\pi}{L}x\,dx=\int_{-L}^{0}f(x)\sin\frac{k\pi}{L}x\,dx+\int_{0}^{L}f(x)\sin\frac{k\pi}{L}x\,dx $$In the first term on the right-hand side, we make the substitution $x=-u$ ($dx=-du$). When $x=-L$ we have $u=L$, and when $x=0$ we have $u=0$, so the interval of integration becomes $u:L\to0$.
$$ \int_{-L}^{0}f(x)\sin\frac{k\pi}{L}x\,dx=\int_{u=L}^{u=0}f(-u)\sin\!\left(-\frac{k\pi}{L}u\right)(-du) $$Now, since $\sin(-\theta)=-\sin\theta$ (the sine function is odd), we have $\sin\!\left(-\frac{k\pi}{L}u\right)=-\sin\frac{k\pi}{L}u$. This minus sign and the minus sign of the $(-du)$ in the preceding integral multiply together and cancel exactly, so
$$ \int_{u=L}^{u=0}f(-u)\left(-\sin\frac{k\pi}{L}u\right)(-du)=\int_{u=L}^{u=0}f(-u)\sin\frac{k\pi}{L}u\,du=-\int_{0}^{L}f(-u)\sin\frac{k\pi}{L}u\,du $$(the last equality uses the property of definite integrals that interchanging the upper and lower limits of integration reverses the sign, $\int_L^0=-\int_0^L$). Now, since $f$ is an even function, $f(-u)=f(u)$ holds for all $u$. Substituting this, we get
$$ \int_{-L}^{0}f(x)\sin\frac{k\pi}{L}x\,dx=-\int_{0}^{L}f(u)\sin\frac{k\pi}{L}u\,du $$The symbol $u$ for the variable of integration can be written as anything without changing the value, as long as the values at the endpoints of the interval are correct (a definite integral does not depend on the name of the variable), so we may rewrite $u$ as $x$. Therefore
$$ \int_{-L}^{0}f(x)\sin\frac{k\pi}{L}x\,dx=-\int_{0}^{L}f(x)\sin\frac{k\pi}{L}x\,dx $$Substituting this back into the original splitting formula,
$$ \int_{-L}^{L}f(x)\sin\frac{k\pi}{L}x\,dx=-\int_{0}^{L}f(x)\sin\frac{k\pi}{L}x\,dx+\int_{0}^{L}f(x)\sin\frac{k\pi}{L}x\,dx=0 $$Here the first and second terms on the right-hand side are exactly the same integral (differing only in sign), so they cancel exactly and the result is precisely $0$. Hence $b_k=\frac1L\cdot0=0$ holds for all $k=1,2,\ldots$. Therefore, the Fourier series of the even function $f(x)$ (Theorem 28.2) contains no $\sin$ terms at all and consists only of $\cos$ terms (and the constant term $a_0$); that is, it is the Fourier cosine series $f(x)=\sum_{k=0}^{\infty}a_k\cos\frac{k\pi}{L}x$ (Theorem 28.3(I)), and this has now been shown directly at the level of the integral computation.
(Note that the same argument cannot be used for $a_k$. When $f$ is even, $f(x)\cos\frac{k\pi}{L}x$ is “even × even = even,” so even if we make the same substitution as above, what comes out is $+\int_0^L(\cdots)$ rather than $-\int_0^L(\cdots)$, and the nonvanishing value $2\int_0^L f(x)\cos\frac{k\pi}{L}x\,dx$ remains—this is the reason why $a_k$ does not become $0$ in general. For the case of an odd function ($f(-x)=-f(x)$), if we make a similar substitution, then conversely we get $a_k=0$ and $b_k\ne0$; you can verify this yourself by following the same computation.)
Exercise 28.4: Numerical experiment on the Fourier series of the square wave (Gibbs phenomenon)
Solution
We compute with Python (numpy) the partial sums $S_N(x)=\sum_{k=1}^{N}\frac{1-(-1)^k}{2k}\sin kx$ of the Fourier sine series of the square wave $f(x)=-\pi/4\ (-\pi \lt x\le0),\ \pi/4\ (0 \lt x\le\pi)$ of Example 28.5 (verify/univmath/ch28_numeric.py).
(a) Convergence at the point of continuity $x=\pi/2$. Compared with $f(\pi/2)=\pi/4=0.785398\ldots$ (clear from the graph in Figure 28.4), the numerical results were as follows.
| $N$ | 5 | 20 | 100 | 1000 |
|---|---|---|---|---|
| $S_N(\pi/2)$ | 0.866667 | 0.760460 | 0.780399 | 0.784898 |
As $N$ increases, $S_N(\pi/2)$ approaches the target value $\pi/4\approx0.785398$ monotonically, which confirms numerically that at $x=\pi/2$ (a point where $f$ is continuous) the Fourier series indeed converges to $f(\pi/2)$.
(b) Overshoot near the point of discontinuity $x=0$ (Gibbs phenomenon). Examining the maximum value of $S_N(x)$ over the range $x\in(0,\pi)$ and the position where it occurs, we find
| $N$ | 10 | 50 | 200 | 1000 |
|---|---|---|---|---|
| Position of the maximum, $x$ | 0.3141 | 0.0628 | 0.0157 | 0.0031 |
| Maximum value $S_N$ | 0.9286 | 0.9261 | 0.9260 | 0.9260 |
| Ratio to the target value $\pi/4$ | 1.1823 | 1.1791 | 1.1790 | 1.1790 |
As this table shows, when $N$ is increased the position of the maximum approaches $x=0$ more and more closely (it tends to $0$ in inverse proportion to $N$), but the maximum value itself does not converge to $\pi/4$; it stays at about $1.179$ times $\pi/4$ ($\approx0.9260$). This “overshoot,” which does not disappear even as $N\to\infty$, is the Gibbs phenomenon.
The theoretical value of this ratio is known to be given by the quantity called the Gibbs constant, $\dfrac2\pi\operatorname{Si}(\pi)\approx1.178979744$ ($\operatorname{Si}$ is the sine integral function $\operatorname{Si}(x)=\int_0^x\frac{\sin t}{t}dt$). We also confirmed that the value $1.178979744\ldots$ computed with Python's scipy.special.sici and the ratio obtained in the numerical experiment (for $N=1000$, computed to more digits than the table shows, $1.178980$) agree very well. Measuring the size of the overshoot in units of the size of the jump (the jump of $f$, $\pi/4-(-\pi/4)=\pi/2$), we get $(0.9260-0.7854)/(\pi/2)\approx0.090$, that is, about 9% of the jump, which also agrees with the known value for the Gibbs phenomenon.
Exercise 28.5: Working backward from complex coefficients to real coefficients (checked with the sawtooth wave)
Solution
The complex Fourier coefficients of the sawtooth wave $f(x)=x/2\ (-4 \lt x \lt4)$ (period 8) found in Example 28.7 were $C_k=\dfrac{2i(-1)^k}{k\pi}\ (k\ne0)$. Using the formulas $a_k=C_k+C_{-k}$, $b_k=i(C_k-C_{-k})$ from the “Math Note” box (Section 28.3), we recompute the real Fourier coefficients.
First we find $C_{-k}$. Substituting $k\to-k$ into the expression for $C_k$, we get
$$ C_{-k}=\frac{2i(-1)^{-k}}{(-k)\pi}=-\frac{2i(-1)^{-k}}{k\pi} $$Here, noting that $(-1)^{-k}=\dfrac{1}{(-1)^k}=(-1)^k$ (since $(-1)^k$ is one of the two values $\pm1$, its reciprocal equals the original value itself), we obtain
$$ C_{-k}=-\frac{2i(-1)^k}{k\pi} $$Computation of $a_k$.
$$ a_k=C_k+C_{-k}=\frac{2i(-1)^k}{k\pi}+\left(-\frac{2i(-1)^k}{k\pi}\right)=0 $$This agrees exactly with $a_k=0$, which we knew from the start from Theorem 28.3(II) because $f(x)=x/2$ is an odd function (at the beginning of the solution of Example 28.7).
Computation of $b_k$.
$$ b_k=i\bigl(C_k-C_{-k}\bigr)=i\left(\frac{2i(-1)^k}{k\pi}-\left(-\frac{2i(-1)^k}{k\pi}\right)\right)=i\cdot\frac{4i(-1)^k}{k\pi}=\frac{4i^2(-1)^k}{k\pi} $$Using $i^2=-1$,
$$ b_k=\frac{-4(-1)^k}{k\pi}=\frac{4(-1)^{k+1}}{k\pi} $$(the last equality is due to $-(-1)^k=(-1)^{k+1}$). This agrees exactly, without a single sign discrepancy, with the result $a_k=0,\ b_k=\dfrac{4(-1)^{k+1}}{k\pi}$ obtained directly as the real Fourier series in the main text of Example 28.7. We have confirmed with concrete values that once the complex Fourier coefficients $C_k$ are known, the real coefficients $a_k,b_k$ can be recovered mechanically, without redoing the integrals, using only the transformation formulas of the “Math Note.”
Exercise 28.6: Fourier sine series by odd extension
Solution
Extend $f(x)=x(\pi-x)\ (0 \lt x \lt \pi)$ to the interval $(-\pi,0)$ so that $f(x)=-f(-x)$ there (an odd function), and regard it as a periodic function with period $2\pi$. Because this is an odd extension, Theorem 28.3(II) gives $a_k=0$ from the start, and we get the Fourier sine series $f(x)=\sum_{k=1}^{\infty}b_k\sin kx$. The coefficients are
$$ b_k=\frac1\pi\int_{-\pi}^{\pi}f(x)\sin kx\,dx=\frac2\pi\int_0^{\pi}x(\pi-x)\sin kx\,dx $$(The integrand $f(x)\sin kx$ is “odd × odd = even,” so we used $\int_{-\pi}^\pi=2\int_0^\pi$. Also, on the interval $(0,\pi)$ we may use the original, unextended $f(x)=x(\pi-x)$ as it is.) We expand the integrand and split the integral into two.
$$ \int_0^{\pi}x(\pi-x)\sin kx\,dx=\pi\int_0^{\pi}x\sin kx\,dx-\int_0^{\pi}x^2\sin kx\,dx $$First term: $\int_0^\pi x\sin kx\,dx$. By the same integration by parts as in Example 28.1 ($u=x,\ dv=\sin kx\,dx$, $v=-\frac1k\cos kx$),
$$ \int_0^{\pi}x\sin kx\,dx=\left[-\frac{x}{k}\cos kx\right]_0^{\pi}+\frac1k\int_0^{\pi}\cos kx\,dx=-\frac{\pi}{k}\cos k\pi+\frac1k\left[\frac1k\sin kx\right]_0^{\pi}=-\frac{\pi(-1)^k}{k}+0=-\frac{\pi(-1)^k}{k} $$Second term: $\int_0^\pi x^2\sin kx\,dx$. We use integration by parts twice (in the same pattern as the two-fold integration by parts in Example 28.3). First, setting $u=x^2,\ dv=\sin kx\,dx$ ($v=-\frac1k\cos kx$), we get
$$ \int_0^{\pi}x^2\sin kx\,dx=\left[-\frac{x^2}{k}\cos kx\right]_0^{\pi}+\frac2k\int_0^{\pi}x\cos kx\,dx $$The first term is $-\frac{\pi^2}{k}(-1)^k$ at $x=\pi$ and $0$ at $x=0$, so it equals $-\frac{\pi^2(-1)^k}{k}$. For the second term, $\int_0^\pi x\cos kx\,dx$, we use the indefinite integral formula $\int x\cos kx\,dx=\frac1kx\sin kx+\frac1{k^2}\cos kx$ from the “Math Note” in Section 28.4.
$$ \int_0^{\pi}x\cos kx\,dx=\left[\frac1kx\sin kx+\frac1{k^2}\cos kx\right]_0^{\pi}=\left(0+\frac{(-1)^k}{k^2}\right)-\left(0+\frac1{k^2}\right)=\frac{(-1)^k-1}{k^2} $$(Since $\sin k\pi=\sin0=0$, the term $\frac1kx\sin kx$ vanishes at both the upper and lower limits.) Substituting this, we obtain
$$ \int_0^{\pi}x^2\sin kx\,dx=-\frac{\pi^2(-1)^k}{k}+\frac2k\cdot\frac{(-1)^k-1}{k^2}=-\frac{\pi^2(-1)^k}{k}+\frac{2\bigl((-1)^k-1\bigr)}{k^3} $$Combining the two terms.
$$ \pi\int_0^{\pi}x\sin kx\,dx-\int_0^{\pi}x^2\sin kx\,dx =\pi\left(-\frac{\pi(-1)^k}{k}\right)-\left(-\frac{\pi^2(-1)^k}{k}+\frac{2\bigl((-1)^k-1\bigr)}{k^3}\right) $$ $$ =-\frac{\pi^2(-1)^k}{k}+\frac{\pi^2(-1)^k}{k}-\frac{2\bigl((-1)^k-1\bigr)}{k^3}=-\frac{2\bigl((-1)^k-1\bigr)}{k^3}=\frac{2\bigl(1-(-1)^k\bigr)}{k^3} $$(Note that the $\pi^2(-1)^k/k$ terms cancel each other exactly—this is no accident: it is because $x(\pi-x)$ has a shape symmetric about $x=\pi/2$, which makes it a function engineered so that the highest-order divergent term vanishes.) Therefore
$$ b_k=\frac2\pi\cdot\frac{2\bigl(1-(-1)^k\bigr)}{k^3}=\frac{4\bigl(1-(-1)^k\bigr)}{\pi k^3} $$When $k$ is even, $1-(-1)^k=0$, so $b_k=0$. When $k$ is odd, $1-(-1)^k=2$, so $b_k=\dfrac{8}{\pi k^3}$. Hence the Fourier sine series is
$$ f(x)=\sum_{k=1}^{\infty}\frac{4\bigl(1-(-1)^k\bigr)}{\pi k^3}\sin kx=\frac8\pi\left(\sin x+\frac1{27}\sin3x+\frac1{125}\sin5x+\cdots\right)=\frac8\pi\sum_{m=0}^{\infty}\frac{\sin(2m+1)x}{(2m+1)^3} $$(Python check: verify/univmath/ch28_explore4.py, ch28_explore5.py—verified that $b_k=4\{1-(-1)^k\}/(\pi k^3)$ for $k=1,\ldots,6$. The coefficients decay like $1/k^3$ because the function obtained by extending $x(\pi-x)$ as an odd function is itself continuous, and the discontinuity of its derivative is the cause of the jump—note that the coefficients decay even faster than for the square wave, which jumps at its discontinuities (Example 28.5; the coefficients decay like $1/k$), and for the triangle wave, which is continuous but whose derivative is discontinuous (Example 28.6; the coefficients decay like $1/k^2$).)
← Back to Chapter 28, “Definition of Fourier Series and Worked Examples”
Chapter 29 Convergence Theory of Fourier Series
Exercise 29.1: Comparing the Riemann–Lebesgue lemma with a direct computation
Solution
Prediction (from the Riemann–Lebesgue lemma). Since $f(x)=x^3$ is continuous on the closed interval $[-\pi,\pi]$, it is also piecewise continuous. Therefore part (I) of the Riemann–Lebesgue lemma (Theorem 29.1 of this chapter) applies directly, and we can predict that
$$ \lim_{n\to\infty}\int_{-\pi}^{\pi}x^3\sin(nx)\,dx=0 $$holds.
Direct computation. The integrand $x^3\sin(nx)$ is an odd function ($x^3$) × an odd function ($\sin nx$) = an even function, so we may write $\displaystyle\int_{-\pi}^{\pi}=2\int_0^{\pi}$. Hence the Fourier sine coefficient is
$$ b_n=\frac1\pi\int_{-\pi}^{\pi}x^3\sin(nx)\,dx=\frac2\pi\int_0^{\pi}x^3\sin(nx)\,dx $$We find $\displaystyle\int_0^\pi x^3\sin(nx)\,dx$ by integrating by parts three times. First, $\int x\sin(nx)\,dx=-\dfrac{x}{n}\cos nx+\dfrac1{n^2}\sin nx$ (the formula in the “Math Note” of Chapter 28). Next, using this together with one more integration by parts with $u=x^2,\ dv=\cos(nx)\,dx$, we obtain
$$ \int x^2\cos(nx)\,dx=\frac{x^2}{n}\sin nx-\frac2n\int x\sin(nx)\,dx=\frac{x^2}{n}\sin nx+\frac{2x}{n^2}\cos nx-\frac{2}{n^3}\sin nx $$(a computation of the same type as in Chapter 2, Section 29.2.3). Finally, setting $u=x^3,\ dv=\sin(nx)\,dx$ ($v=-\frac1n\cos nx$), we have
$$ \int x^3\sin(nx)\,dx=-\frac{x^3}{n}\cos nx+\frac3n\int x^2\cos(nx)\,dx $$Substituting the $\int x^2\cos(nx)\,dx$ found above into this, we obtain the antiderivative
$$ \int x^3\sin(nx)\,dx=-\frac{x^3}{n}\cos nx+\frac{3x^2}{n^2}\sin nx+\frac{6x}{n^3}\cos nx-\frac{6}{n^4}\sin nx $$We now evaluate this from $x=0$ to $x=\pi$. Since $n$ is an integer, $\sin(n\pi)=0$, and the two terms containing $\sin nx$ vanish at both the upper and lower limits. Applying $\cos(n\pi)=(-1)^n$ to the remaining $\cos nx$ terms, we get
$$ \int_0^{\pi}x^3\sin(nx)\,dx=\left(-\frac{\pi^3}{n}(-1)^n+\frac{6\pi}{n^3}(-1)^n\right)-0=(-1)^n\pi\cdot\frac{6-\pi^2n^2}{n^3} $$Therefore,
$$ b_n=\frac2\pi\cdot(-1)^n\pi\cdot\frac{6-\pi^2n^2}{n^3}=\frac{2(-1)^n\bigl(6-\pi^2n^2\bigr)}{n^3}=\frac{2(-1)^{n+1}\bigl(\pi^2n^2-6\bigr)}{n^3} $$Writing out a few concrete numerical values, we get $b_1=2\pi^2-12\approx7.739$, $b_2=\frac32-\pi^2\approx-8.370$, $b_3=\frac23\pi^2-\frac49\approx6.135$, $b_4\approx-4.747$, $b_5\approx3.852$ (Python check: verify/univmath/ch29_exercises.py—we computed $\int_{-\pi}^\pi x^3\sin(nx)\,dx=\pi b_n$ with SymPy and confirmed that it agrees with the closed form above).
Looking at the behavior as $n\to\infty$, we have $b_n=\dfrac{2(-1)^{n+1}\pi^2n^2}{n^3}-\dfrac{12(-1)^{n+1}}{n^3}=\dfrac{2(-1)^{n+1}\pi^2}{n}-\dfrac{12(-1)^{n+1}}{n^3}$, and the dominant term is $\dfrac{2\pi^2(-1)^{n+1}}{n}$ (its sign oscillates while its magnitude decreases on the order of $1/n$). Therefore the original integral satisfies $\displaystyle\int_{-\pi}^{\pi}x^3\sin(nx)\,dx=\pi b_n\sim\dfrac{2\pi^3(-1)^{n+1}}{n}\to0\ (n\to\infty)$, which does not contradict our initial prediction (convergence to $0$ by the Riemann–Lebesgue lemma). However, the rate of convergence remains only of order $1/n$—this is because, although $f(x)=x^3$ itself is continuous inside $(-\pi,\pi]$, extending it with period $2\pi$ produces a jump at $x=\pi$ ($=-\pi$), where $f(\pi)=\pi^3$ and $f(-\pi)=-\pi^3$ disagree (a discontinuity in the periodic boundary condition), and this is the same reason that the coefficients of $f(x)=x$ in Example 29.1 of this chapter (which likewise jumps at the endpoints) decay like $1/n$.
Exercise 29.2: A direct proof that the Dirichlet kernel is an even function
Solution
We want to show that $Q_n(-u)=Q_n(u)$. Substituting $u\to-u$ into the definition $Q_n(u)=\displaystyle\sum_{k=-n}^{n}e^{iku}$, we get
$$ Q_n(-u)=\sum_{k=-n}^{n}e^{ik(-u)}=\sum_{k=-n}^{n}e^{-iku} $$Now we replace the summation index $k$ of this sum by $j:=-k$. As $k$ runs from $-n$ to $n$, $j=-k$ also runs over exactly the same range $\{-n,-n+1,\ldots,n\}$, from $n$ down to $-n$ (in the opposite direction)—that is, even if we flip the sign, the set of indices being summed over does not change at all. Moreover, since $e^{-iku}=e^{-i(-j)u}=e^{iju}$, we can rewrite the sum as
$$ \sum_{k=-n}^{n}e^{-iku}=\sum_{j=-n}^{n}e^{iju} $$(This is a sum of finitely many terms, and we have merely relabeled the same terms with a different symbol, so rearranging the order of summation does not change the value.) If we rename the summation index on the right-hand side from $j$ back to $k$, it is exactly the definition of $Q_n(u)$. Therefore,
$$ Q_n(-u)=\sum_{j=-n}^{n}e^{iju}=Q_n(u) $$Thus the claim is proved (Python check: verify/univmath/ch29_exercises.py—for each of $n=1,3,7$, we confirmed numerically at five randomly chosen points $u$ that $Q_n(-u)=Q_n(u)$ holds).
Exercise 29.3: Fourier's theorem at a discontinuity of the sawtooth wave
Solution
The sawtooth wave is the function $f(x)=\dfrac{x}{2}\ (-4\lt x\lt4)$ extended with period 8. The left-hand limit at $x=4$ can be taken directly as $x\to4-$ from inside the domain $(-4,4)$, so
$$ f(4-0)=\lim_{x\to4-}\frac{x}{2}=\frac{4}{2}=2 $$On the other hand, to find the right-hand limit $f(4+0)$ we use periodicity. Since the period is 8, $f(x+8)=f(x)$ holds for all $x$; in particular $f(4+u)=f(4+u-8)=f(-4+u)$ (when $u$ is a small positive number). As $u\to0+$, $x=-4+u$ approaches $-4$ from inside the domain $(-4,4)$, so the expression $f(x)=x/2$ can be used as it stands, and we obtain
$$ f(4+0)=\lim_{u\to0+}f(4+u)=\lim_{u\to0+}f(-4+u)=\lim_{u\to0+}\frac{-4+u}{2}=-\frac{4}{2}=-2 $$Since $f(4-0)=2\ne-2=f(4+0)$, $x=4$ is a point of discontinuity. By Fourier's theorem (Theorem 29.2), the value of the Fourier series at this point is
$$ \frac{f(4+0)+f(4-0)}{2}=\frac{-2+2}{2}=0 $$(Direct check using partial sums: substituting $x=4$ into the real Fourier series $f(x)=\sum_{k=1}^\infty\frac{4(-1)^{k+1}}{k\pi}\sin\frac{k\pi}{4}x$ found in Example 28.7, we have $\sin\!\left(\frac{k\pi}{4}\cdot4\right)=\sin(k\pi)=0$ for every integer $k$, so the partial sum is already exactly $0$ at every finite stage $N$—Python check: using verify/univmath/ch29_exercises.py, we confirmed that the partial sum is exactly $0$ for each of $N=1,5,50$.)
Exercise 29.4: Determining the pointwise limit and testing for uniform convergence
Solution
(a) Pointwise limit. For $x=0$, $f_n(0)=n\cdot0\cdot e^0=0$ holds for all $n$. Fix $0\lt x\le1$ and consider $n\to\infty$. The exponential $e^{-nx^2}$ (since $x$ is a fixed positive number) approaches $0$ exponentially in $n$, and the speed of this decay overwhelmingly exceeds the growth of the factor $n$ in front (which grows only polynomially). Hence $n\,x\,e^{-nx^2}\to0$ (in keeping with the sense, learned in high school, that “an exponential function approaches $0$ faster than a polynomial does”; rigorously, setting $t=nx^2\to\infty$, one checks that $n\,e^{-nx^2}=\frac{t}{x}e^{-t}\to0$ ($te^{-t}\to0,\ t\to\infty$)). Therefore,
$$ f(x)=\lim_{n\to\infty}f_n(x)=0\qquad(\text{for all }x\in[0,1]\text{}) $$The limit function is identically $0$ and, moreover, continuous.
(b) Whether the convergence is uniform. The limit function $f(x)\equiv0$ is continuous, so the contrapositive of Theorem 29.3 (if the limit is discontinuous, the convergence is not uniform) cannot be used here—continuity of the limit does not guarantee uniform convergence, so we must evaluate the $\sup$ directly. Differentiating $f_n(x)=nxe^{-nx^2}$ with respect to $x$, we get
$$ f_n'(x)=n e^{-nx^2}+nx\cdot e^{-nx^2}\cdot(-2nx)=n e^{-nx^2}\bigl(1-2nx^2\bigr) $$and $f_n'(x)=0$ holds (since $e^{-nx^2}\ne0$) exactly when $1-2nx^2=0$, that is, when $x=x^*:=\dfrac{1}{\sqrt{2n}}$ (which does lie within the range $0\le x\le1$: if $n\ge1$, then $x^*\le1/\sqrt2\lt1$). Since $f_n'(x)\gt0$ for $x\lt x^*$ and $f_n'(x)\lt0$ for $x\gt x^*$, $x^*$ is the point that gives the maximum. The value there is
$$ f_n(x^*)=n\cdot\frac{1}{\sqrt{2n}}\cdot e^{-n\cdot\frac{1}{2n}}=\frac{n}{\sqrt{2n}}\cdot e^{-1/2}=\sqrt{\frac{n}{2}}\cdot\frac1{\sqrt e}=\sqrt{\frac{n}{2e}} $$Therefore,
$$ \sup_{0\le x\le1}\abs{f_n(x)-f(x)}=\sup_{0\le x\le1}f_n(x)=f_n(x^*)=\sqrt{\frac{n}{2e}}\ \xrightarrow[n\to\infty]{}\ \infty $$so this $\sup$ not only fails to converge to $0$ but even diverges as $n\to\infty$. In the definition of uniform convergence (Definition 29.2), for any $\varepsilon\gt0$, from some $N$ onward the inequality $\abs{f_n(x)-f(x)}\lt\varepsilon$ must hold for all $x$; but since the $\sup$ diverges, no matter which $N$ we take, there necessarily exists an $x$ (concretely, near $x^*=1/\sqrt{2n}$) with $n\gt N$ and $f_n(x)\ge\varepsilon$. Hence $f_n(x)=nxe^{-nx^2}$ does not converge uniformly on $[0,1]$ (here again we have obtained an example that converges pointwise but not uniformly). (Python check: verify/univmath/ch29_exercises.py, ch29_pointwise_uniform.py—for $n=1,5,20,100,10000$, we confirmed how the values $f_n(x^*)=\sqrt{n/(2e)}$ actually diverge.)
Exercise 29.5: Showing that convergence is not uniform by constructing a counterexample with the $\varepsilon$-$N$ argument
Solution
In Exercise 29.4(b) we showed that $\displaystyle\sup_{0\le x\le1}f_n(x)=\sqrt{\dfrac{n}{2e}}$ and that this diverges to infinity as $n\to\infty$. Using this, we concretely construct the negation of the definition of uniform convergence (Definition 29.2).
First, fix one $\varepsilon\gt0$ (let us take $\varepsilon=1$ here—since the $\sup$ diverges to infinity, the same argument works whichever positive number $\varepsilon$ we choose). Next, suppose that an arbitrary natural number $N$ is given. What we want to show is that “there exists $x\in[0,1]$ for which $n\gt N$ and $\abs{f_n(x)-f(x)}\ge\varepsilon$.”
Since $\sqrt{n/(2e)}$ is monotonically increasing in $n$ and diverges as $n\to\infty$, for $\sqrt{n/(2e)}\ge1$ to hold it suffices that $n\ge2e\approx5.437$ (in terms of integers, $n\ge6$ is enough). To leave a little margin, we therefore choose
$$ n:=\max\{N+1,\ 7\} $$(this way $n\gt N$, and also $n\ge7\gt2e$). For this $n$, if we take $x:=x^*=\dfrac{1}{\sqrt{2n}}$, then by the computation in Exercise 29.4(b)
$$ \abs{f_n(x)-f(x)}=f_n(x^*)-0=\sqrt{\frac{n}{2e}}\ge\sqrt{\frac{7}{2e}}\approx1.135\ge1=\varepsilon $$holds. (To give concrete numbers for $N=1,10,1000$: for $n=7,11,1001$ and $x^*\approx0.2673,0.2132,0.02235$ we get $f_n(x^*)\approx1.135,1.422,13.569$, and indeed every one of these is at least $\varepsilon=1$—Python check: verify/univmath/ch29_exercises.py.)
Thus, with $\varepsilon=1$ fixed, for every natural number $N$ we have actually found an $x\in[0,1]$ (namely $x=1/\sqrt{2n}$) for which $n\gt N$ and $\abs{f_n(x)-f(x)}\ge\varepsilon$. This is precisely the negation of Definition 29.2 of uniform convergence ($\exists\varepsilon\gt0$ s.t. $\forall N,\ \exists n\gt N,\ \exists x\in I$ s.t. $\abs{f_n(x)-f(x)}\ge\varepsilon$), and it constitutes a direct proof, based on the $\varepsilon$-$N$ argument, that $f_n(x)=nxe^{-nx^2}$ does not converge uniformly on $[0,1]$ (it is an argument of exactly the same type as the construction carried out for $f_n(x)=x^n$ in Example 29.6(b)-(ii)).
← Back to Chapter 29, “Convergence Theory of Fourier Series”
Chapter 30 The Fourier Transform
Exercise 30.1: The differentiation rule $\Four[f'(x)](k)=ik\,\Four[f(x)](k)$
Solution
General proof. We use integration by parts. Let $u=e^{-ikx}$ and $dv=f'(x)\,dx$; then $du=-ik\,e^{-ikx}\,dx$ and $v=f(x)$. By the integration by parts formula $\displaystyle\int u\,dv=[uv]-\int v\,du$,
$$ \int_{-\infty}^{\infty}f'(x)\,e^{-ikx}\,dx=\Bigl[f(x)\,e^{-ikx}\Bigr]_{-\infty}^{\infty}-\int_{-\infty}^{\infty}f(x)\,(-ik\,e^{-ikx})\,dx $$For the boundary term $\bigl[f(x)e^{-ikx}\bigr]_{-\infty}^{\infty}$ we have $\bigl|f(x)e^{-ikx}\bigr|=|f(x)|\times1=|f(x)|$ ($|e^{-ikx}|=1$ always holds), and by assumption $f(x)\to0$ as $x\to\pm\infty$, so the boundary term itself also tends to $0$. Therefore
$$ \int_{-\infty}^{\infty}f'(x)e^{-ikx}\,dx=0+ik\int_{-\infty}^{\infty}f(x)e^{-ikx}\,dx=ik\,\Four[f(x)](k) $$That is, we have shown that $\Four[f'(x)](k)=ik\,\Four[f(x)](k)$.
Concrete example: $f(x)=e^{-x^2}$ ($\alpha=1$). Here $f'(x)=-2x\,e^{-x^2}$. Let us compute the left-hand side directly. Completing the square in $-x^2-ikx$ (it suffices to follow the same procedure as in Section 30.4 of the main text with $\alpha=1$), we get $-x^2-ikx=-\left(x+i\dfrac{k}{2}\right)^2-\dfrac{k^2}{4}$, so
$$ \Four[f'(x)](k)=\int_{-\infty}^{\infty}(-2x)e^{-x^2-ikx}\,dx=-2e^{-\frac{k^2}{4}}\int_{-\infty}^{\infty}x\,e^{-\left(x+i\frac{k}{2}\right)^2}\,dx $$Substituting $u:=x+i\dfrac{k}{2}$ ($x=u-i\dfrac{k}{2}$, $du=dx$), we obtain
$$ \int_{-\infty}^{\infty}x\,e^{-\left(x+i\frac k2\right)^2}dx=\int_{-\infty}^{\infty}\left(u-i\frac k2\right)e^{-u^2}\,du=\int_{-\infty}^{\infty}u\,e^{-u^2}\,du-i\frac k2\int_{-\infty}^{\infty}e^{-u^2}\,du $$The integrand $u\,e^{-u^2}$ of the first term is an odd function (its sign reverses under $u\to-u$), so its integral over a symmetric range is $0$. The second term is exactly the Gaussian integral shown in the main text (the case $\alpha=1$), $\displaystyle\int_{-\infty}^{\infty}e^{-u^2}du=\sqrt\pi$. Hence
$$ \int_{-\infty}^{\infty}x\,e^{-\left(x+i\frac k2\right)^2}dx=0-i\frac k2\sqrt\pi=-\frac{ik\sqrt\pi}{2} $$Therefore
$$ \Four[f'(x)](k)=-2e^{-\frac{k^2}{4}}\times\left(-\frac{ik\sqrt\pi}{2}\right)=ik\sqrt\pi\,e^{-\frac{k^2}{4}} $$On the other hand, the right-hand side is $ik\,\Four[f(x)](k)=ik\times\sqrt\pi\,e^{-k^2/4}$ (obtained by substituting $\alpha=1$ into the general formula for the Fourier transform of a Gaussian function), and the two agree exactly (verified with SymPy as well: the difference between $F[f'](k)=i\sqrt\pi\,k\,e^{-k^2/4}$ and $ikF[f](k)=i\sqrt\pi\,k\,e^{-k^2/4}$ is identically $0$).
Exercise 30.2: Computing $\Four[x^2e^{-\alpha x^2}](k)$ by differentiation with respect to a parameter
Solution
We differentiate both sides of the general formula for the Fourier transform of a Gaussian function
$$ F(\alpha,k):=\Four[e^{-\alpha x^2}](k)=\sqrt{\frac{\pi}{\alpha}}\,e^{-\frac{k^2}{4\alpha}} $$partially with respect to the parameter $\alpha$, which is independent of the integration variable $x$. For the left-hand side, assuming that the order of integration and differentiation can be interchanged,
$$ \frac{\partial F}{\partial\alpha}=\frac{\partial}{\partial\alpha}\int_{-\infty}^{\infty}e^{-\alpha x^2}e^{-ikx}\,dx=\int_{-\infty}^{\infty}\frac{\partial}{\partial\alpha}\bigl(e^{-\alpha x^2}\bigr)e^{-ikx}\,dx=\int_{-\infty}^{\infty}(-x^2)e^{-\alpha x^2}e^{-ikx}\,dx=-\Four[x^2e^{-\alpha x^2}](k) $$(here $\dfrac{\partial}{\partial\alpha}e^{-\alpha x^2}=-x^2e^{-\alpha x^2}$). For the right-hand side, using the quotient rule and the chain rule,
$$ \frac{\partial F}{\partial\alpha}=\sqrt\pi\,\frac{\partial}{\partial\alpha}\Bigl(\alpha^{-1/2}e^{-\frac{k^2}{4\alpha}}\Bigr)=\sqrt\pi\left(-\frac12\alpha^{-3/2}e^{-\frac{k^2}{4\alpha}}+\alpha^{-1/2}e^{-\frac{k^2}{4\alpha}}\cdot\frac{k^2}{4\alpha^2}\right) $$(we used $\dfrac{\partial}{\partial\alpha}\Bigl(-\dfrac{k^2}{4\alpha}\Bigr)=\dfrac{k^2}{4\alpha^2}$). Factoring out the common factor $e^{-k^2/4\alpha}\alpha^{-3/2}$, we get
$$ \frac{\partial F}{\partial\alpha}=\sqrt\pi\,e^{-\frac{k^2}{4\alpha}}\,\alpha^{-3/2}\left(-\frac12+\frac{k^2}{4\alpha}\right)=\frac{\sqrt\pi\,(k^2-2\alpha)}{4\alpha^{5/2}}\,e^{-\frac{k^2}{4\alpha}} $$Therefore, since $\Four[x^2e^{-\alpha x^2}](k)=-\dfrac{\partial F}{\partial\alpha}$,
$$ \Four[x^2e^{-\alpha x^2}](k)=\frac{\sqrt\pi\,(2\alpha-k^2)}{4\alpha^{5/2}}\,e^{-\frac{k^2}{4\alpha}} $$This is the answer. The result of computing $\displaystyle\int_{-\infty}^{\infty}x^2e^{-\alpha x^2}e^{-ikx}\,dx$ directly (verified with SymPy) is exactly the same expression, and the difference is identically $0$. A numerical check ($\alpha=1,k=2$) has also confirmed that the expression obtained by differentiating with respect to the parameter and the one obtained by direct integration agree, both giving the same value.
Exercise 30.3: The shift theorem $\Four[f(x-a)](k)=e^{-ika}\Four[f(x)](k)$
Solution
General proof. Substituting $u:=x-a$ in the defining integral ($x=u+a$, $dx=du$, and the interval of integration, $x:-\infty\to\infty$, corresponds to $u:-\infty\to\infty$), we obtain
$$ \Four[f(x-a)](k)=\int_{-\infty}^{\infty}f(x-a)e^{-ikx}\,dx=\int_{-\infty}^{\infty}f(u)\,e^{-ik(u+a)}\,du=e^{-ika}\int_{-\infty}^{\infty}f(u)e^{-iku}\,du=e^{-ika}\,\Four[f(x)](k) $$(We split $e^{-ik(u+a)}=e^{-iku}e^{-ika}$ by the law of exponents and took the constant factor $e^{-ika}$, which depends only on $k$, outside the integral.) This proves the shift theorem.
Concrete example: $f(x)=e^{-\alpha|x|}$ shifted by $a$. It suffices to apply the general proof itself to $f(x)=e^{-\alpha|x|}$. By the computation above, the Fourier transform of $f(x-a)=e^{-\alpha|x-a|}$ is
$$ \Four[e^{-\alpha|x-a|}](k)=e^{-ika}\,\Four[e^{-\alpha|x|}](k)=e^{-ika}\cdot\frac{2\alpha}{\alpha^2+k^2} $$which agrees exactly with the prediction of the shift theorem (note that in this case the procedure of the proof of the shift theorem is itself a “direct computation” for the specific function $f(x)=e^{-\alpha|x|}$—because we have merely applied a relation that holds for a general $f$ to a particular $f$. A numerical check, too, has confirmed that the two sides agree when specific numerical values are substituted for $\alpha,a,k$).
Exercise 30.4: The scaling theorem $\Four[f(cx)](k)=\dfrac1c\,\Four[f(x)]\!\left(\dfrac kc\right)\ (c\gt0)$
Solution
General proof. Substitute $u:=cx$ ($x=u/c$, $dx=du/c$) in the defining integral. Since $c\gt0$, as $x:-\infty\to\infty$ we have $u:-\infty\to\infty$, so the direction is unchanged.
$$ \Four[f(cx)](k)=\int_{-\infty}^{\infty}f(cx)e^{-ikx}\,dx=\int_{-\infty}^{\infty}f(u)\,e^{-ik(u/c)}\,\frac{du}{c}=\frac1c\int_{-\infty}^{\infty}f(u)\,e^{-i(k/c)u}\,du=\frac1c\,\Four[f(x)]\!\left(\frac kc\right) $$This proves the scaling theorem.
Concrete example: $f(x)=e^{-x^2}$, $c=2$. Here $f(cx)=f(2x)=e^{-(2x)^2}=e^{-4x^2}$. For the left-hand side, substituting $\alpha=4$ directly into the general formula for the Fourier transform of a Gaussian function, we get
$$ \Four[e^{-4x^2}](k)=\sqrt{\frac{\pi}{4}}\,e^{-\frac{k^2}{16}}=\frac{\sqrt\pi}{2}\,e^{-\frac{k^2}{16}} $$For the right-hand side, applying the scaling theorem to $\Four[e^{-x^2}](k)=\sqrt\pi\,e^{-k^2/4}$ ($\alpha=1$), we get
$$ \frac1c\,\Four[e^{-x^2}]\!\left(\frac kc\right)=\frac12\times\sqrt\pi\,e^{-\frac{(k/2)^2}{4}}=\frac{\sqrt\pi}{2}\,e^{-\frac{k^2}{16}} $$so the left-hand and right-hand sides agree completely (numerical check: for $k=1.3$, both are $\fallingdotseq0.79739$, in agreement).
Exercise 30.5: The duality $\Four[xf(x)](k)=i\dfrac{d}{dk}\Four[f(x)](k)$ between “multiplication by $x$” and “differentiation with respect to $k$”
Solution
General proof. We differentiate $F(k)=\Four[f(x)](k)=\displaystyle\int_{-\infty}^{\infty}f(x)e^{-ikx}\,dx$ with respect to $k$, assuming that the order of integration and differentiation can be interchanged. Since $\dfrac{\partial}{\partial k}e^{-ikx}=-ix\,e^{-ikx}$,
$$ \frac{dF}{dk}=\int_{-\infty}^{\infty}f(x)\,(-ix)\,e^{-ikx}\,dx=-i\int_{-\infty}^{\infty}xf(x)e^{-ikx}\,dx=-i\,\Four[xf(x)](k) $$Multiplying both sides by $i$ and using $i\times(-i)=-i^2=1$, we obtain $i\dfrac{dF}{dk}=\Four[xf(x)](k)$. This is the formula to be shown. (Comparing with the differentiation rule $\Four[f'](k)=ik\Four[f](k)$ of Exercise 30.1, we see that the operation “multiply by $x$” and the operation “differentiate with respect to $k$,” and likewise the operation “differentiate” and the operation “multiply by $k$,” are dual to each other, with their roles interchanged.)
Concrete example: $f(x)=e^{-2|x|}$ ($\alpha=2$). First we compute the right-hand side. Since $F(k)=\Four[e^{-2|x|}](k)=\dfrac{2\times2}{2^2+k^2}=\dfrac{4}{4+k^2}$,
$$ i\frac{dF}{dk}=i\times4\times\frac{-2k}{(4+k^2)^2}=\frac{-8ik}{(4+k^2)^2} $$Next we compute the left-hand side $\Four[xe^{-2|x|}](k)$ directly, splitting the interval of integration into two, as we did for the two-sided exponential function in Section 30.5.
$$ \Four[xe^{-2|x|}](k)=\int_{-\infty}^{0}x\,e^{2x}e^{-ikx}\,dx+\int_{0}^{\infty}x\,e^{-2x}e^{-ikx}\,dx=\int_{-\infty}^{0}x\,e^{(2-ik)x}\,dx+\int_{0}^{\infty}x\,e^{-(2+ik)x}\,dx $$Here we use the formula $\displaystyle\int_0^{\infty}t\,e^{-ct}\,dt=\frac{1}{c^2}$, which holds for a complex constant $c$ such that the real part of $c$ is positive, $\operatorname{Re}(c)\gt0$ (by integration by parts with $u=t,\ dv=e^{-ct}dt$, $\displaystyle\int_0^\infty t e^{-ct}dt=\Bigl[-\frac{t}{c}e^{-ct}\Bigr]_0^\infty+\frac1c\int_0^\infty e^{-ct}dt=0+\frac1c\cdot\frac1c=\frac1{c^2}$; the boundary term tends to $0$ as $t\to\infty$ because $\operatorname{Re}(c)\gt0$). The second term can be used as it stands with $c=2+ik$ ($\operatorname{Re}(c)=2\gt0$):
$$ \int_{0}^{\infty}x\,e^{-(2+ik)x}\,dx=\frac{1}{(2+ik)^2} $$For the first term, substituting $x=-t$ ($t:0\to\infty$, $dx=-dt$), we obtain
$$ \int_{-\infty}^{0}x\,e^{(2-ik)x}\,dx=\int_{\infty}^{0}(-t)\,e^{-(2-ik)t}\,(-dt)=-\int_0^\infty t\,e^{-(2-ik)t}\,dt=-\frac{1}{(2-ik)^2} $$(we use the same formula with $c=2-ik$, $\operatorname{Re}(c)=2\gt0$; note also that the sign reversal occurs twice and a factor $-1$ is attached overall). Therefore,
$$ \Four[xe^{-2|x|}](k)=\frac{1}{(2+ik)^2}-\frac{1}{(2-ik)^2} $$We combine these over a common denominator. The denominator is $(2+ik)^2(2-ik)^2=\bigl[(2+ik)(2-ik)\bigr]^2=(4+k^2)^2$ (since $(2+ik)(2-ik)=4-(ik)^2=4+k^2$). The numerator is $(2-ik)^2-(2+ik)^2=(4-4ik-k^2)-(4+4ik-k^2)=-8ik$. Hence
$$ \Four[xe^{-2|x|}](k)=\frac{-8ik}{(4+k^2)^2} $$This agrees exactly with $i\dfrac{dF}{dk}=\dfrac{-8ik}{(4+k^2)^2}$, which we found for the right-hand side (verified with SymPy as well: the difference between $A-B:=\frac1{(2+ik)^2}-\frac1{(2-ik)^2}$ and $-8ik/(4+k^2)^2$ is identically $0$).
Exercise 30.6: Checking the parity theorem (the rectangular pulse with $a=0$)
Solution
Consider the rectangular pulse with $a=0$, $f(\alpha)=\dfrac{1}{2r}\ (-r\lt\alpha\lt r)$. First we check that it is an even function. As for $f(-\alpha)$, since $-r\lt\alpha\lt r\iff-r\lt-\alpha\lt r$ (we merely multiplied each side of the inequalities by $-1$, which reverses their direction, and then rearranged), $f(-\alpha)=\dfrac{1}{2r}=f(\alpha)$ holds exactly when $-\alpha$ also lies in the same interval $(-r,r)$, and outside the interval both are $0$. Therefore $f(-\alpha)=f(\alpha)$ for all $\alpha$; that is, $f$ is an even function.
By Example 30.2(a), its Fourier transform is given by
$$ F(k)=\Four[f(\alpha)](k)=e^{-ik\cdot0}\,\frac{\sin(kr)}{kr}=\frac{\sin(kr)}{kr} $$Here we have substituted $a=0$ into the general formula $\Four[f(\alpha)](k)=e^{-ika}\sin(kr)/(kr)$.
Check that it is real. Both $\sin(kr)$ and $kr$ are real when $k,r$ are real, and the imaginary unit $i$ appears nowhere. Hence $F(k)=\sin(kr)/(kr)$ is real-valued (as long as the denominator is not $0$).
Check that it is even. Under $k\to-k$ we have $\sin(-kr)=-\sin(kr)$ (the sine function is odd), and the denominator becomes $(-k)r=-kr$, so
$$ F(-k)=\frac{\sin(-kr)}{(-k)r}=\frac{-\sin(kr)}{-kr}=\frac{\sin(kr)}{kr}=F(k) $$Thus $F(-k)=F(k)$; that is, $F$ is also an even function.
From the above, we have directly confirmed that the Fourier transform $F(k)=\sin(kr)/(kr)$ of the even function $f(\alpha)$ is real and even. This agrees exactly with the prediction of Theorem 30.1(b) (if $f$ is a real-valued even function, then $F$ is real-valued and even), and means that we have been able to check, for a concrete rectangular pulse, a theorem that holds in general.
← Back to Chapter 30, “The Fourier Transform”
Chapter 31 Definition of the Laplace Transform and Basic Formulas
Exercise 31.1: Computing $\Lap[t^3]$ directly from the definition
Solution
Following the definition ($\Lap[f(t)]=\int_0^\infty f(t)e^{-st}dt$), we compute $\displaystyle\Lap[t^3]=\int_0^\infty t^3e^{-st}\,dt$ by repeating integration by parts three times. Let $u=-\frac1se^{-st}$ (an antiderivative of $e^{-st}$) and $v=t^3$ ($v'=3t^2$). Integrating by parts once gives
$$ \int_0^\infty t^3e^{-st}\,dt = \underbrace{\left[t^3\left(-\frac1se^{-st}\right)\right]_0^\infty}_{0} + \frac3s\int_0^\infty t^2e^{-st}\,dt $$(Why the boundary term is $0$: at $t=0$, $t^3=0$. As $t\to\infty$, for $s>0$ we have $t^3e^{-st}\to0$—the exponential decays faster than the polynomial grows.) Applying integration by parts once more to the remaining integral ($v=t^2,v'=2t$), we get
$$ \int_0^\infty t^2e^{-st}\,dt = \underbrace{\left[t^2\left(-\frac1se^{-st}\right)\right]_0^\infty}_{0} + \frac2s\int_0^\infty te^{-st}\,dt $$Applying integration by parts one more time ($v=t,v'=1$), we get
$$ \int_0^\infty te^{-st}\,dt = \underbrace{\left[t\left(-\frac1se^{-st}\right)\right]_0^\infty}_{0} + \frac1s\int_0^\infty e^{-st}\,dt = \frac1s\cdot\frac1s = \frac1{s^2} $$Substituting these results one after another from the bottom up, we obtain
$$ \int_0^\infty t^2e^{-st}\,dt = \frac2s\cdot\frac1{s^2} = \frac2{s^3},\qquad \int_0^\infty t^3e^{-st}\,dt = \frac3s\cdot\frac2{s^3} = \frac6{s^4} $$Therefore $\Lap[t^3]=\dfrac6{s^4}$ ($s>0$). This agrees with $3!/s^4=6/s^4$, obtained by substituting $n=3$ into Formula 31.3 ($\Lap[t^n]=n!/s^{n+1}$) (we have also verified that SymPy's improper integral gives the same value).
Exercise 31.2: Finding $\Lap[5e^{2t}-3t+7]$ by linearity
Solution
By linearity ($\Lap[c_1f+c_2g+c_3h]=c_1\Lap[f]+c_2\Lap[g]+c_3\Lap[h]$, which holds in the same way for three terms),
$$ \Lap[5e^{2t}-3t+7] = 5\Lap[e^{2t}] - 3\Lap[t] + 7\Lap[1] $$We substitute the entries of the table of basic transforms for each term: $\Lap[e^{2t}]=\dfrac1{s-2}$ (substituting $\omega=2$ into the formula $\Lap[e^{\omega t}]=1/(s-\omega)$, for $s>2$), $\Lap[t]=\dfrac1{s^2}$, and $\Lap[1]=\dfrac1s$. Therefore,
$$ \Lap[5e^{2t}-3t+7] = \frac5{s-2} - \frac3{s^2} + \frac7s\qquad(s>2) $$is the answer. The region of convergence is $s>2$ because, of the three terms, $\Lap[e^{2t}]$ imposes the most restrictive condition ($s>2$), and for the sum as a whole we must take the intersection of the conditions (we have also verified that SymPy's symbolic computation gives the same expression).
Exercise 31.3: Laplace transform of a function that switches from “1 first” to “0 later”
Solution
Let $g(t)$ denote the desired function: $g(t)=1$ ($0\le t\lt a$), $g(t)=0$ ($t\ge a$). Using the unit step function $u(t-a)$ (which is $0$ for $t\lt a$ and $1$ for $t\ge a$), we can write $g(t)=1-u(t-a)$—indeed, for $t\lt a$ we get $1-0=1$ and for $t\ge a$ we get $1-1=0$, which we can confirm agrees with the values of $g(t)$. Using linearity,
$$ \Lap[g(t)] = \Lap[1-u(t-a)] = \Lap[1] - \Lap[u(t-a)] $$Substituting the entry $\Lap[1]=\dfrac1s$ of the table of basic transforms and the formula $\Lap[u(t-a)]=\dfrac{e^{-as}}{s}$ ($a\ge0$), we obtain
$$ \Lap[g(t)] = \frac1s - \frac{e^{-as}}{s} = \frac{1-e^{-as}}{s}\qquad(s>0) $$which is the answer (verified with SymPy).
Exercise 31.4: Laplace transform of a sawtooth wave
Solution
We use the formula for the Laplace transform of a periodic function, $\Lap[f(t)]=\dfrac{F_0(s)}{1-e^{-sT}}$ ($F_0(s)=\int_0^Tf(t)e^{-st}dt$). First we find $F_0(s)=\displaystyle\int_0^T te^{-st}\,dt$. Integrating by parts with $u=-\frac1se^{-st}$ and $v=t$ ($v'=1$), we get
$$ \int_0^T te^{-st}\,dt = \left[t\left(-\frac1se^{-st}\right)\right]_0^T - \int_0^T\left(-\frac1se^{-st}\right)dt $$The boundary term is $-\dfrac Ts e^{-sT}$ at $t=T$ and $0$ at $t=0$, so $\left[\,\cdot\,\right]_0^T=-\dfrac Ts e^{-sT}-0=-\dfrac Ts e^{-sT}$. The remaining integral is $\displaystyle\int_0^T\frac1se^{-st}\,dt=\frac1s\left[-\frac1se^{-st}\right]_0^T=\frac1{s^2}\bigl(1-e^{-sT}\bigr)$, so
$$ F_0(s) = -\frac Ts e^{-sT} + \frac1{s^2}\bigl(1-e^{-sT}\bigr) = \frac1{s^2} - e^{-sT}\left(\frac Ts+\frac1{s^2}\right) = \frac{1-e^{-sT}(1+sT)}{s^2} $$Substituting this into the formula for periodic functions, we obtain
$$ \Lap[f(t)] = \frac{F_0(s)}{1-e^{-sT}} = \frac{1-e^{-sT}(1+sT)}{s^2\bigl(1-e^{-sT}\bigr)} $$which is the answer. Multiplying the numerator and the denominator by $e^{sT}$ to rearrange it into a form with positive exponents, we can also write it in the equivalent form $\dfrac{e^{sT}-1-sT}{s^2\bigl(e^{sT}-1\bigr)}$ (for $T=1,s=2$, we have verified that the value of this expression agrees to 30 decimal places with the value obtained by directly integrating the first 60 periods numerically and adding them up).
Exercise 31.5: Finding $\Lap[\delta(t-3)\cos2t]$ by the sifting property of the delta function
Solution
Substituting into Definition 31.1 gives $\displaystyle\Lap[\delta(t-3)\cos2t]=\int_0^\infty \cos2t\cdot e^{-st}\cdot\delta(t-3)\,dt$. Since $a=3\ge0$, extending the interval of integration to $(-\infty,\infty)$ does not change the value (because $\delta(t-3)=0$ for $t\lt0$). Letting $f(t)=\cos2t\cdot e^{-st}$ and applying the sifting property (Definition 31.3), we pick out the value at $t=3$.
$$ \Lap[\delta(t-3)\cos2t] = \int_{-\infty}^\infty \cos2t\cdot e^{-st}\cdot\delta(t-3)\,dt = \cos(2\cdot3)\cdot e^{-3s} = \cos6\cdot e^{-3s} $$is the answer ($\cos6$ is evaluated with the angle in radians, $\cos6\approx0.960$; verified with SymPy).
Exercise 31.6: Determining whether a function is of exponential order $\alpha$
Solution
(a) $f(t)=t^{10}$. The limit
$$ \lim_{t\to\infty}\frac{t^{10}}{e^t} = \lim_{t\to\infty}t^{10}e^{-t} = 0 $$holds (because the exponential function grows faster than a polynomial of any degree). Therefore there exists a sufficiently large $M$ (it suffices to take $M$ to be the maximum of $t^{10}e^{-t}$ over all $t\ge0$) such that $t^{10}\le Me^t$ holds. Hence $f(t)=t^{10}$ is a function of exponential order $1$.
(b) $f(t)=e^{t^3}$. Suppose it were of exponential order $\alpha$ ($\alpha$ finite). Then $|e^{t^3}|\le Me^{\alpha t}$, that is, $e^{t^3-\alpha t}\le M$, would have to hold for all $t\ge0$. But as $t\to\infty$, $t^3-\alpha t=t(t^2-\alpha)\to\infty$ (once $t$ becomes larger than $\sqrt\alpha$, $t^2-\alpha>0$ and $t(t^2-\alpha)$ grows without bound), so $e^{t^3-\alpha t}\to\infty$, and this inequality is violated no matter which $M$ we choose. Therefore $f(t)=e^{t^3}$ is not a function of exponential order $\alpha$ for any choice of $\alpha$.
Exercise 31.7: Expressing $\Lap[f''(t)]$ by using the derivative formula twice
Solution
Let $g(t):=f'(t)$ (we assume that $g$ is also continuous and of exponential order for $t\ge0$). Applying the derivative formula to $g$, we get
$$ \Lap[g'(t)] = s\Lap[g(t)] - g(0) $$Here $g'(t)=f''(t)$ and $g(0)=f'(0)$, and for $\Lap[g(t)]=\Lap[f'(t)]$ we can use the result $\Lap[f'(t)]=sF(s)-f(0)$ of applying the derivative formula once more (to $f$ itself). Substituting all of these, we obtain
$$ \Lap[f''(t)] = s\Lap[f'(t)] - f'(0) = s\bigl(sF(s)-f(0)\bigr) - f'(0) = s^2F(s) - sf(0) - f'(0) $$which is the general formula.
We check this with $f(t)=t^3$. We have $f(0)=0^3=0$, $f'(0)=0$ because $f'(t)=3t^2$, and $F(s)=\Lap[t^3]=\dfrac6{s^4}$ (the result of Exercise 31.1). Substituting into the general formula, we get
$$ \Lap[f''(t)] = s^2\cdot\frac6{s^4} - s\cdot0 - 0 = \frac6{s^2} $$On the other hand, if we take the Laplace transform of $f''(t)=\dfrac{d}{dt}(3t^2)=6t$ directly, Formula 31.2 ($\Lap[t]=1/s^2$) and linearity give $\Lap[6t]=6\Lap[t]=\dfrac6{s^2}$, which agrees exactly with the value found from the general formula (verified with SymPy; we also checked separately that the case $f(t)=\cos\omega t$—with $f(0)=1,f'(0)=0$—agrees in the same way).
← Back to Chapter 31, “Definition of the Laplace Transform and Basic Formulas”
Chapter 32 The Gamma Function, the Beta Function, and the Laplace Transform
Exercise 32.1: Find $\Gamma(7/2)$
Solution
We use the recurrence relation $\Gamma(\alpha+1)=\alpha\Gamma(\alpha)$ repeatedly until we reach $\Gamma(1/2)=\sqrt\pi$. Since $\dfrac72=\dfrac52+1$, substituting $\alpha=\dfrac52$ into the recurrence relation gives
$$ \Gamma\left(\frac72\right) = \frac52\,\Gamma\left(\frac52\right) $$As found in Example 32.3 of the main text, $\Gamma\!\left(\dfrac52\right)=\dfrac34\sqrt\pi$. (To be safe, here is the route: $\Gamma\!\left(\frac52\right)=\frac32\Gamma\!\left(\frac32\right)$ and $\Gamma\!\left(\frac32\right)=\frac12\Gamma\!\left(\frac12\right)=\frac12\sqrt\pi$, and therefore $\Gamma\!\left(\frac52\right)=\frac32\cdot\frac12\sqrt\pi=\frac34\sqrt\pi$.) Substituting this, we obtain
$$ \Gamma\left(\frac72\right) = \frac52\cdot\frac34\sqrt\pi = \frac{15}{8}\sqrt\pi $$Numerically, $\Gamma(7/2)=\dfrac{15}8\sqrt\pi\approx3.323351$ (verified with SymPy: gamma(Rational(7,2)) returns the same value $\frac{15\sqrt\pi}8$—verify/univmath/ch32_check.py). In general, the half-integer value $\Gamma\!\left(n+\frac12\right)$ always comes out as “a rational number $\times\sqrt\pi$”: each of the $n$ applications of the recurrence relation brings in one more factor of $2$ in the denominator and one more odd number in the numerator.
Exercise 32.2: Show that $\mathrm{erf}(x)+\mathrm{erfc}(x)=1$ using differentiation
Solution
Let $h(x)=\mathrm{erf}(x)+\mathrm{erfc}(x)$; we first find its derivative $h'(x)$.
Derivative of $\mathrm{erf}(x)$. By the fundamental theorem of calculus (Chapter 5), when the integral $\displaystyle\int_0^xe^{-u^2}du$ whose upper limit is the variable $x$ is differentiated with respect to $x$, we simply get the value $e^{-x^2}$ of the integrand with $u$ replaced by $x$. Therefore,
$$ \frac{d}{dx}\mathrm{erf}(x) = \frac2{\sqrt\pi}\cdot e^{-x^2} $$Derivative of $\mathrm{erfc}(x)$. The function $\mathrm{erfc}(x)=\dfrac2{\sqrt\pi}\displaystyle\int_x^{\infty}e^{-u^2}du$ is an integral whose lower limit is the variable $x$. To convert it from this form, with the constant $\infty$ as the upper limit and a variable lower limit, into the familiar form with a variable upper limit and a constant lower limit, it suffices to reverse the interval of integration and change the sign.
$$ \int_x^{\infty}e^{-u^2}\,du = \int_0^{\infty}e^{-u^2}\,du - \int_0^{x}e^{-u^2}\,du $$(The right-hand side is just what we get by transposing a term in the equation that splits the integral from $0$ to $\infty$ into the integrals from $0$ to $x$ and from $x$ to $\infty$.) The first term on the right, $\displaystyle\int_0^{\infty}e^{-u^2}du=\dfrac{\sqrt\pi}2$, is a constant independent of $x$, so it vanishes when differentiated with respect to $x$. The second term has the same form as the one we differentiated for $\mathrm{erf}$, so
$$ \frac{d}{dx}\int_x^{\infty}e^{-u^2}\,du = 0 - e^{-x^2} = -e^{-x^2} $$Therefore,
$$ \frac{d}{dx}\mathrm{erfc}(x) = \frac2{\sqrt\pi}\cdot\left(-e^{-x^2}\right) = -\frac2{\sqrt\pi}e^{-x^2} $$Adding the two.
$$ h'(x) = \frac{d}{dx}\mathrm{erf}(x)+\frac{d}{dx}\mathrm{erfc}(x) = \frac2{\sqrt\pi}e^{-x^2}-\frac2{\sqrt\pi}e^{-x^2} = 0 $$A function whose derivative is identically $0$ for all $x$ is a constant function. (This is a corollary of the mean value theorem: if $h$ were not constant, there would be two distinct points $a\ne b$ with $h(a)\ne h(b)$, and then, by the mean value theorem, there would exist a point somewhere between them at which $h'(c)=\dfrac{h(b)-h(a)}{b-a}\ne0$, contradicting $h'\equiv0$.) Therefore, $h(x)=\mathrm{erf}(x)+\mathrm{erfc}(x)$ equals some constant $C$.
The value of the constant $C$ may be evaluated at any $x$, so we choose $x=0$, which is easy to compute. We have $\mathrm{erf}(0)=\dfrac2{\sqrt\pi}\displaystyle\int_0^0e^{-u^2}du=\dfrac2{\sqrt\pi}\cdot0=0$ (because the interval of integration has width $0$). Also, as shown in Example 32.1(a) of the main text, $\mathrm{erfc}(0)=1$. Therefore,
$$ C = h(0) = \mathrm{erf}(0)+\mathrm{erfc}(0) = 0+1 = 1 $$Hence $\mathrm{erf}(x)+\mathrm{erfc}(x)=1$ for every real number $x$. (In the main text we showed this at one stroke by splitting the interval of integration; here we have reached exactly the same conclusion by a different route, “the derivative is $0$ ⟹ the function is constant.” Both proofs are, in essence, the flip side of the fact that the error function and the complementary error function split the same Gaussian integral between them into exactly two parts.)
Exercise 32.3: Compute $\Lap[t^3]$ from the gamma function formula
Solution
Substituting $\alpha=3$ (an integer) into the general formula for the Laplace transform in terms of the gamma function, $\Lap[t^{\alpha}]=\dfrac{\Gamma(\alpha+1)}{s^{\alpha+1}}$, we obtain
$$ \Lap[t^3] = \frac{\Gamma(3+1)}{s^{3+1}} = \frac{\Gamma(4)}{s^4} $$Substituting $n=3$ into the formula $\Gamma(n+1)=n!$ gives $\Gamma(4)=\Gamma(3+1)=3!=3\times2\times1=6$. Therefore,
$$ \Lap[t^3] = \frac6{s^4} $$On the other hand, substituting $n=3$ directly into the formula $\Lap[t^n]=\dfrac{n!}{s^{n+1}}$ of Chapter 31 gives $\Lap[t^3]=\dfrac{3!}{s^4}=\dfrac6{s^4}$, which agrees exactly with the computation via the gamma function (verified with SymPy: laplace_transform(t**3,t,s) gives the same result—verify/univmath/ch32_check.py). When $n$ is an integer, the gamma function formula merely requires reading $\Gamma(n+1)$ as $n!$, and it reduces directly to the formula of Chapter 31; this has been confirmed here as well.
Exercise 32.4: Find the relative errors of the simple and precise versions of Stirling's formula for $n=5$
Solution
The true value is $5!=120$.
Simple version. Substituting $n=5$ into $n^ne^{-n}$, we have $5^5=3125$ and $e^{-5}\approx0.00673794700$, so
$$ 5^5e^{-5} \approx 3125\times0.00673794700 \approx 21.0561 $$The relative error with respect to the true value is
$$ \frac{|120-21.0561|}{120} = \frac{98.9439}{120} \approx 0.8245 = 82.45\% $$Precise version. We substitute $n=5$ into $\sqrt{2\pi n}\,n^ne^{-n}$. Since $2\pi\times5=10\pi\approx31.4159$ and $\sqrt{31.4159}\approx5.60499$,
$$ \sqrt{2\pi\cdot5}\times21.0561 \approx 5.60499\times21.0561 \approx 118.019 $$The relative error with respect to the true value is
$$ \frac{|120-118.019|}{120} = \frac{1.981}{120} \approx 0.01651 = 1.65\% $$(Verified with Python—verify/univmath/ch32_check.py.) Compared with the relative errors in Example 32.6 ($n=10$; simple version $87.49\%$, precise version $0.83\%$), the errors for the smaller $n$, that is, $n=5$, are somewhat larger for both the simple and the precise versions—this is consistent with what we saw in Figure 32.5, namely that the error of the precise version decreases monotonically as $n$ grows (whereas that of the simple version, conversely, increases).
Exercise 32.5: Prove that $B(m,n)=B(n,m)$
Solution
In the definition $B(m,n)=\displaystyle\int_0^1x^{m-1}(1-x)^{n-1}dx$, we make the substitution $x=1-u$ (so that $dx=-du$). For the limits of integration, $x=0$ gives $u=1-0=1$ and $x=1$ gives $u=1-1=0$, so $u$ runs from $1$ to $0$ (the direction is reversed).
$$ B(m,n) = \int_{x=0}^{x=1}x^{m-1}(1-x)^{n-1}\,dx = \int_{u=1}^{u=0}(1-u)^{m-1}\cdot u^{n-1}\,(-du) $$(Substituting $x=1-u$ gives $x^{m-1}=(1-u)^{m-1}$, and from $1-x=1-(1-u)=u$ we get $(1-x)^{n-1}=u^{n-1}$.) Interchanging the upper and lower limits of the integral reverses the sign once more, by the property $\displaystyle\int_1^0(\cdots)=-\int_0^1(\cdots)$ of definite integrals. Therefore, the sign reversal from $(-du)$ and the sign reversal from interchanging the upper and lower limits, two minus signs in total, exactly cancel each other, and we obtain
$$ B(m,n) = \int_0^1 (1-u)^{m-1}u^{n-1}\,du = \int_0^1 u^{n-1}(1-u)^{m-1}\,du $$(We have merely changed the order of the factors in the product.) Now, rewriting the integration variable $u$ as $x$ does not change the value of a definite integral (a fact that we also used in the exercises of Chapter 28: a definite integral does not depend on the name of the variable). Therefore,
$$ B(m,n) = \int_0^1 x^{n-1}(1-x)^{m-1}\,dx $$The right-hand side is exactly the defining expression with the roles of $m$ and $n$ interchanged, that is, $B(n,m)$ itself. Hence
$$ B(m,n) = B(n,m) $$holds for all $m,n\gt0$ (what we intuitively expected in Section 32.4.2 of the main text from the symmetry in Figure 32.6 has now been rigorously proved here by substitution). Numerically as well, for example, for $(m,n)=(2,3)$ we have $B(2,3)=\frac1{12}$ (Example 32.7 of the main text), and for $(m,n)=(3,2)$ we have $B(3,2)=\int_0^1x^2(1-x)\,dx=\left[\frac{x^3}3-\frac{x^4}4\right]_0^1=\frac13-\frac14=\frac1{12}$, so we can confirm that the two indeed agree (also verified with SymPy for several pairs $(m,n)$—verify/univmath/ch32_check.py).
Exercise 32.6: Compute $B(1,n)$ directly from the definition
Solution
Substituting $m=1$ into the definition gives $x^{m-1}=x^0=1$, so the factor involving $x$ disappears from the integrand.
$$ B(1,n) = \int_0^1 x^{1-1}(1-x)^{n-1}\,dx = \int_0^1(1-x)^{n-1}\,dx $$We use the substitution $v=1-x$ ($dv=-dx$). Since $v=1$ when $x=0$ and $v=0$ when $x=1$,
$$ \int_0^1(1-x)^{n-1}\,dx = \int_1^0 v^{n-1}\,(-dv) = \int_0^1 v^{n-1}\,dv = \left[\frac{v^n}n\right]_0^1 = \frac1n-0 = \frac1n $$Therefore, $B(1,n)=\dfrac1n$.
We compare this with the value computed from the theorem of the main text ($B(m,n)=\Gamma(m)\Gamma(n)/\Gamma(m+n)$). Since $\Gamma(1)=1$ (Formula 32.2) and $\Gamma(n+1)=n!$ (Formula 32.5),
$$ B(1,n) = \frac{\Gamma(1)\Gamma(n)}{\Gamma(1+n)} = \frac{1\times(n-1)!}{n!} = \frac{(n-1)!}{n\times(n-1)!} = \frac1n $$(We used $\Gamma(n)=(n-1)!$ and $\Gamma(n+1)=n!=n\times(n-1)!$.) The two agree exactly (verified with SymPy: $B(1,4)=1/4$ for $n=4$ by direct integration—verify/univmath/ch32_check.py). $B(1,n)$ is the particularly simple case “$m=1$” of the beta function, and as such both the direct computation from the definition and the computation via the gamma function can be carried out with equal ease.
← Back to Chapter 32, “The Gamma Function, the Beta Function, and the Laplace Transform”
Chapter 33 Basic Solution Methods for First-Order Ordinary Differential Equations
Exercise 33.1: Separable equation
Solution
The differential equation is $\dfrac{\dd y}{\dd x}=\dfrac{x^2}{y^2}$ ($y\neq0$). The right-hand side is the product of “a function of $x$ alone, $x^2$” and “a function of $y$ alone, $1/y^2$,” so the equation is separable. Multiplying both sides by $y^2$ gives
$$ y^2\,\dd y=x^2\,\dd x $$Applying $\displaystyle\int$ to both sides gives
$$ \int y^2\,\dd y=\int x^2\,\dd x \quad\Longrightarrow\quad \frac{y^3}{3}=\frac{x^3}{3}+C_1 $$Multiplying both sides by 3 and letting $3C_1=C$, we obtain
$$ y^3=x^3+C $$This is the general solution (solving for $y$ gives $y=\sqrt[3]{x^3+C}$). Check: differentiating $y=(x^3+C)^{1/3}$ with respect to $x$ gives $\diff yx=\dfrac13(x^3+C)^{-2/3}\cdot3x^2=\dfrac{x^2}{(x^3+C)^{2/3}}=\dfrac{x^2}{y^2}$. Indeed, the original equation is satisfied.
Exercise 33.2: Homogeneous-type equation
Solution
The differential equation is $\diff yx=\dfrac{x^2+y^2}{xy}$ ($x\gt0,\ y\gt0$). Dividing the numerator and denominator of the right-hand side by $x^2$ gives
$$ \frac{x^2+y^2}{xy}=\frac{1+(y/x)^2}{y/x} $$so the right-hand side is a function of $y/x$ alone (a homogeneous-type equation). Letting $t=y/x$, that is, $y=xt$, we have $\diff yx=xt'+t$ (the product rule), and the equation becomes
$$ xt'+t=\frac{1+t^2}{t} $$Subtracting $t$ from the right-hand side gives $\dfrac{1+t^2}{t}-t=\dfrac{1+t^2-t^2}{t}=\dfrac1t$, so
$$ x\diff tx=\frac1t \quad\Longrightarrow\quad t\,\dd t=\frac1x\,\dd x $$Applying $\displaystyle\int$ to both sides gives
$$ \int t\,\dd t=\int\frac1x\,\dd x \quad\Longrightarrow\quad \frac{t^2}{2}=\ln x+C_1\quad(x\gt0) $$Multiplying both sides by 2 and letting $2C_1=C$, we obtain $t^2=2\ln x+C$. Substituting back $t=y/x$ gives
$$ \left(\frac yx\right)^{\!2}=2\ln x+C \quad\Longrightarrow\quad y^2=x^2(2\ln x+C) $$This is the general solution. Check: differentiating both sides of $F(x,y)=y^2-x^2(2\ln x+C)=0$ with respect to $x$ (regarding $y$ as a function of $x$) gives $2y\diff yx-2x(2\ln x+C)-x^2\cdot\dfrac2x=0$, that is, $2y\diff yx=2x(2\ln x+C)+2x=2x\left(2\ln x+C+1\right)$. On the curve we have $2\ln x+C=y^2/x^2$, so $2y\diff yx=2x\left(\dfrac{y^2}{x^2}+1\right)=\dfrac{2(x^2+y^2)}{x}$. Dividing both sides by $2y$ gives $\diff yx=\dfrac{x^2+y^2}{xy}$, which indeed agrees with the original equation (verified with SymPy).
Exercise 33.3: The $f(ax+by+c)$ type
Solution
The differential equation is $\diff yx=\cos(x+y)$. This is the case $a=1,b=1,c=0$, so let $t=x+y$. Then $\diff tx=1+\diff yx$, and since $\diff yx=\cos(x+y)=\cos t$, we have
$$ \diff tx=1+\cos t $$We reduce this to a separable equation. Using the half-angle formula $1+\cos t=2\cos^2\dfrac t2$ (from high school mathematics; a rearrangement of the double-angle formula $\cos t=2\cos^2\frac t2-1$), we obtain
$$ \frac{1}{2\cos^2(t/2)}\,\dd t=\dd x \quad\Longrightarrow\quad \frac12\sec^2\!\left(\frac t2\right)\dd t=\dd x $$Applying $\displaystyle\int$ to both sides, and using $\displaystyle\int\sec^2u\,\dd u=\tan u+C$ (Chapter 3; the inverse operation of differentiating the tangent function) with $u=t/2$, we get
$$ \frac12\int\sec^2\!\left(\frac t2\right)\dd t=\int\dd x \quad\Longrightarrow\quad \frac12\cdot2\tan\!\left(\frac t2\right)=x+C \quad\Longrightarrow\quad \tan\!\left(\frac t2\right)=x+C $$Substituting back $t=x+y$ gives
$$ \tan\!\left(\frac{x+y}{2}\right)=x+C $$This is the general solution. Check: differentiating both sides of $\Phi(x,y)=\tan\!\left(\dfrac{x+y}2\right)-x-C=0$ with respect to $x$ gives $\sec^2\!\left(\dfrac{x+y}2\right)\cdot\dfrac{1+y'}{2}-1=0$, that is, $y'=\dfrac{2}{\sec^2\left(\frac{x+y}2\right)}-1=2\cos^2\!\left(\dfrac{x+y}2\right)-1=\cos(x+y)$ (we used the double-angle formula $\cos\theta=2\cos^2\frac\theta2-1$ with $\theta=x+y$). This indeed agrees with the original equation.
Exercise 33.4: First-order linear differential equation
Solution
The differential equation is $\diff yx-y\tan x=\sin x$ ($-\frac\pi2\lt x\lt\frac\pi2$), a first-order linear differential equation with $p(x)=-\tan x$ and $g(x)=\sin x$. Since $\cos x\gt0$ for $-\frac\pi2\lt x\lt\frac\pi2$,
$$ \int p(x)\,\dd x=\int(-\tan x)\,\dd x=\ln(\cos x) $$(the formula $\displaystyle\int\tan x\,\dd x=-\ln|\cos x|$ is from Chapter 5). Hence $e^{-\int p\,\dd x}=e^{-\ln(\cos x)}=\dfrac1{\cos x}=\sec x$ and $e^{\int p\,\dd x}=e^{\ln(\cos x)}=\cos x$. Substituting into the general-solution formula (Formula 33.2 of this chapter) gives
$$ y=\sec x\left\{\int\sin x\cdot\cos x\,\dd x+C\right\} $$For the integral on the right-hand side, we use integration by substitution with $u=\sin x$, $\dd u=\cos x\,\dd x$ (covered in high school mathematics), which gives $\displaystyle\int\sin x\cos x\,\dd x=\int u\,\dd u=\dfrac{u^2}{2}=\dfrac{\sin^2x}2$. Hence,
$$ y=\sec x\left\{\frac{\sin^2x}2+C\right\}=\frac12\sin^2x\sec x+C\sec x=\frac12\sin x\cdot\frac{\sin x}{\cos x}+C\sec x=\frac12\sin x\tan x+C\sec x $$This is the general solution. Check: differentiating $y=\dfrac12\sin x\tan x+C\sec x$ with the product rule gives $y'=\dfrac12\left(\cos x\tan x+\sin x\sec^2x\right)+C\sec x\tan x=\dfrac12\left(\sin x+\sin x\sec^2x\right)+C\sec x\tan x$. On the other hand, $y\tan x+\sin x=\dfrac12\sin x\tan^2x+C\sec x\tan x+\sin x$. Computing the difference of the two, we get $\dfrac12\sin x\sec^2x-\dfrac12\sin x\tan^2x+\dfrac12\sin x-\sin x=\dfrac12\sin x(\sec^2x-\tan^2x)-\dfrac12\sin x=\dfrac12\sin x\cdot1-\dfrac12\sin x=0$ (we used $\sec^2x-\tan^2x=1$). Hence $y'=y\tan x+\sin x$, that is, $y'-y\tan x=\sin x$ holds (verified with SymPy).
Exercise 33.5: Bernoulli's differential equation
Solution
The differential equation is $x\diff yx+y=y^2\ln x$ ($x\gt0$). Dividing both sides by $x$ gives
$$ \diff yx+\frac1x\,y=\frac{\ln x}{x}\,y^2 $$so this is Bernoulli's differential equation with $p(x)=\dfrac1x$, $g(x)=\dfrac{\ln x}x$, and $n=2$. Let $u=y^{1-n}=y^{-1}$. Following the procedure of Formula 33.3 of this chapter, and setting $P(x)=(1-n)p(x)=(-1)\cdot\dfrac1x=-\dfrac1x$ and $Q(x)=(1-n)g(x)=(-1)\cdot\dfrac{\ln x}x=-\dfrac{\ln x}x$, we obtain the first-order linear differential equation for $u$
$$ u'-\frac1x\,u=-\frac{\ln x}{x} $$We use Formula 33.2. Since $\displaystyle\int\left(-\frac1x\right)\dd x=-\ln x$ ($x\gt0$), we have $e^{-\int P\,\dd x}=e^{\ln x}=x$ and $e^{\int P\,\dd x}=e^{-\ln x}=\dfrac1x$. Hence,
$$ u=x\left\{\int\left(-\frac{\ln x}{x}\right)\cdot\frac1x\,\dd x+C\right\}=x\left\{-\int\frac{\ln x}{x^2}\,\dd x+C\right\} $$We compute the integral on the right-hand side by integration by parts. Letting $f=\ln x$ and $\dd G=x^{-2}\dd x$, we have $\dd f=\dfrac1x\dd x$ and $G=-\dfrac1x$, so
$$ \int\frac{\ln x}{x^2}\,\dd x=\ln x\cdot\left(-\frac1x\right)-\int\left(-\frac1x\right)\cdot\frac1x\,\dd x=-\frac{\ln x}x+\int\frac1{x^2}\,\dd x=-\frac{\ln x}x-\frac1x+C_1 $$Therefore $-\displaystyle\int\frac{\ln x}{x^2}\dd x=\dfrac{\ln x}x+\dfrac1x-C_1$, and substituting this into the above gives
$$ u=x\left\{\frac{\ln x}x+\frac1x+C\right\}=\ln x+1+Cx $$(we have renamed $-C_1+C$ as the arbitrary constant $C$). Since $u=y^{-1}=1/y$,
$$ y=\frac{1}{\ln x+1+Cx} $$This is the general solution (besides this, $y\equiv0$ is also a solution). Check: letting $u=\ln x+1+Cx$, we have $y=1/u$ and $\diff yx=-\dfrac{u'}{u^2}$. Since $u'=\dfrac1x+C$, we get $\diff yx=-\dfrac{1/x+C}{u^2}$. On the other hand,
$$ -\frac1x\,y+\frac{\ln x}xy^2=\frac1{u^2}\left(-\frac ux+\frac{\ln x}x\right)=\frac1{u^2}\cdot\frac{-(\ln x+1+Cx)+\ln x}{x}=\frac1{u^2}\cdot\frac{-1-Cx}{x}=-\frac{1/x+C}{u^2} $$Thus $\diff yx=-\dfrac1xy+\dfrac{\ln x}xy^2$, that is, $x\diff yx+y=y^2\ln x$, holds (verified with SymPy).
Exercise 33.6: Riccati's differential equation
Solution
The differential equation is $\diff yx-y^2+2xy-(x^2+1)=0$. Matching it to the form $y'+P(x)y^2+Q(x)y+R(x)=0$ of the definition (Definition 33.9 of this chapter), we have $P(x)=-1,\ Q(x)=2x,\ R(x)=-(x^2+1)$. First we confirm that $y_1=x$ is a particular solution. Since $y_1'=1$ and $y_1^2=x^2$,
$$ y_1'+Py_1^2+Qy_1+R=1+(-1)x^2+2x\cdot x-(x^2+1)=1-x^2+2x^2-x^2-1=(1-1)+(-x^2+2x^2-x^2)=0 $$Indeed, it is a particular solution. Next we compute $A(x)=2P(x)y_1(x)+Q(x)$.
$$ A(x)=2\cdot(-1)\cdot x+2x=-2x+2x=0 $$Since $A(x)\equiv0$, Formula 33.4 of this chapter simplifies. From $\displaystyle\int A\,\dd x=0$ we get $e^{\int A\dd x}=e^{-\int A\dd x}=1$, so
$$ y=y_1+\left[1\cdot\left\{\int P(x)\cdot1\,\dd x+C_1\right\}\right]^{-1}=x+\left\{\int(-1)\,\dd x+C_1\right\}^{-1}=x+(-x+C_1)^{-1} $$Since $-x+C_1=-(x-C_1)$, we have $(-x+C_1)^{-1}=-\dfrac1{x-C_1}$. Rewriting $C_1$ as $C$,
$$ y=x-\frac1{x-C} $$This is the general solution ($C$ is an arbitrary constant. Renaming $-C$ as $C$ again, it can also be written as $y=x-\dfrac1{x+C}$). Check: letting $y=x-\dfrac1{x-C}$, we have $y'=1+\dfrac1{(x-C)^2}$. On the other hand,
$$ y^2-2xy+(x^2+1)=\left(x-\frac1{x-C}\right)^{\!2}-2x\left(x-\frac1{x-C}\right)+(x^2+1) $$Expanding this, we get $x^2-\dfrac{2x}{x-C}+\dfrac1{(x-C)^2}-2x^2+\dfrac{2x}{x-C}+x^2+1=\dfrac1{(x-C)^2}+1$. Hence,
$$ y'-\bigl\{y^2-2xy+(x^2+1)\bigr\}=\left(1+\frac1{(x-C)^2}\right)-\left(\frac1{(x-C)^2}+1\right)=0 $$that is, $y'-y^2+2xy-(x^2+1)=0$ holds (verified with SymPy).
← Back to Chapter 33, “Basic Solution Methods for First-Order Ordinary Differential Equations”
Chapter 34 Exact Differential Equations, Integrating Factors, and Singular Solutions
Exercise 34.1: Family of orthogonal curves for $x^2+y^2=2Cx$
Solution
Differentiating both sides of the family of curves $x^2+y^2=2Cx$ with respect to $x$ gives
$$ 2x+2yy'=2C $$Dividing both sides by $2$ gives $x+yy'=C$. We eliminate $C$ by substituting this into the original equation $x^2+y^2=2Cx$. Since the original equation gives $C=\dfrac{x^2+y^2}{2x}$,
$$ x+yy'=\frac{x^2+y^2}{2x}\qquad\Longrightarrow\qquad yy'=\frac{x^2+y^2}{2x}-x=\frac{x^2+y^2-2x^2}{2x}=\frac{y^2-x^2}{2x} $$ $$ \therefore\ y'=\frac{y^2-x^2}{2xy} $$This is the differential equation satisfied by the family of curves $x^2+y^2=2Cx$. To find the family of orthogonal curves, we replace $y'$ with $-1/y'$.
$$ -\frac1{y'}=\frac{y^2-x^2}{2xy}\qquad\Longrightarrow\qquad \frac{dy}{dx}=\frac{2xy}{x^2-y^2} $$Dividing the numerator and the denominator of the right-hand side by $x^2$ gives $\dfrac{2(y/x)}{1-(y/x)^2}$, an expression in $y/x$ alone—that is, the equation is of homogeneous type (Chapter 33 of the main text). Letting $v=y/x$ ($y=vx$), we have $\dfrac{dy}{dx}=v+x\dfrac{dv}{dx}$, so
$$ v+x\frac{dv}{dx}=\frac{2v}{1-v^2}\qquad\Longrightarrow\qquad x\frac{dv}{dx}=\frac{2v}{1-v^2}-v=\frac{2v-v(1-v^2)}{1-v^2}=\frac{v+v^3}{1-v^2}=\frac{v(1+v^2)}{1-v^2} $$Separating variables, we obtain
$$ \frac{1-v^2}{v(1+v^2)}\,dv=\frac{dx}{x} $$We decompose the left-hand side into partial fractions. Setting $\dfrac{1-v^2}{v(1+v^2)}=\dfrac{A}{v}+\dfrac{Bv+D}{1+v^2}$ and putting everything over a common denominator, we get $1-v^2=A(1+v^2)+(Bv+D)v$. Comparing the coefficients of $v^0$ gives $A=1$; comparing the coefficients of $v^2$ gives $A+B=-1$, so $B=-2$; and comparing the coefficients of $v^1$ gives $D=0$. Hence,
$$ \frac{1-v^2}{v(1+v^2)}=\frac1v-\frac{2v}{1+v^2} $$(The same decomposition was also verified with SymPy's apart—verify/univmath/ch34_check.py.) Integrating both sides gives
(Since the numerator of $\dfrac{2v}{1+v^2}$ is the derivative of the denominator, its integral is $\ln(1+v^2)$.) Combining the left-hand side by the properties of logarithms gives $\ln\left|\dfrac{v}{1+v^2}\right|=\ln|x|+K_0$, and exponentiating both sides gives
$$ \frac{v}{1+v^2}=Kx\qquad(K=\pm e^{K_0}) $$Substituting back $v=y/x$, we obtain
$$ \frac{y/x}{1+y^2/x^2}=Kx\qquad\Longrightarrow\qquad \frac{xy}{x^2+y^2}=Kx\qquad\Longrightarrow\qquad \frac{y}{x^2+y^2}=K\quad(x\neq0\ \text{since we divided by}\ x\ \text{on both sides}) $$Therefore $x^2+y^2=\dfrac{y}{K}$. Rewriting $\dfrac1K$ as $2K'$ (a constant), the family of orthogonal curves we seek is
$$ x^2+y^2=2K'y $$Here $K'$ is an arbitrary constant. Whereas the original family of curves $x^2+y^2=2Cx$ was “the family of circles with centers on the $x$-axis that are tangent to the $y$-axis at the origin,” the family of orthogonal curves $x^2+y^2=2K'y$ is “the family of circles with centers on the $y$-axis that are tangent to the $x$-axis at the origin”—the roles of $x$ and $y$ have been exactly interchanged, a beautiful symmetry. (We verified with SymPy, by implicit differentiation, that $x^2+y^2=2K'y$ indeed satisfies $dy/dx=2xy/(x^2-y^2)$—verify/univmath/ch34_check.py.)
Exercise 34.2: Exact differential equation $(2xy+y^2+1)dx+(x^2+2xy)dy=0$
Solution
Let $P=2xy+y^2+1$ and $Q=x^2+2xy$.
$$ P_y=2x+2y,\qquad Q_x=2x+2y $$Since $P_y=Q_x$ holds, the equation is an exact differential equation. We solve it by the undetermined-function method. Integrating $P$ with respect to $x$ (regarding $y$ as a constant) gives
$$ f(x,y)=\int(2xy+y^2+1)\,dx+g(y)=x^2y+xy^2+x+g(y) $$(The integral of $2xy$ is $x^2y$, the integral of $y^2$ (treated as a constant) is $xy^2$, and the integral of $1$ is $x$.) Differentiating this partially with respect to $y$ gives
$$ f_y=x^2+2xy+g'(y) $$This must equal $Q=x^2+2xy$, so $g'(y)=0$; that is, $g(y)$ is a constant (we may take it to be $0$). Therefore the general solution is
$$ x^2y+xy^2+x=C $$As a check, differentiating $f=x^2y+xy^2+x$ partially with respect to $x$ gives $f_x=2xy+y^2+1=P$, and differentiating partially with respect to $y$ gives $f_y=x^2+2xy=Q$; both agree (verified with SymPy—verify/univmath/ch34_check.py).
Exercise 34.3: Integrating factor for $y\,dx+(2x+y^3)dy=0$
Solution
Letting $P=y$ and $Q=2x+y^3$, we have
$$ P_y=1,\qquad Q_x=2 $$Since $P_y\neq Q_x$, the equation is not exact as it stands. So, to try an integrating factor of the form $\mu(x)$, we compute $\dfrac{P_y-Q_x}{Q}=\dfrac{1-2}{2x+y^3}=\dfrac{-1}{2x+y^3}$, but this is not a function of $x$ alone ($y$ remains). We therefore try the form $\mu(y)$.
$$ h(y)=\frac{P_y-Q_x}{P}=\frac{1-2}{y}=-\frac1y $$This time $x$ has disappeared, and we have a function of $y$ alone. Hence an integrating factor of the form $\mu(y)$ exists, and by the formula $\mu=e^{-\int h(y)\,dy}$ in the main text,
$$ \mu=e^{-\int\left(-\frac1y\right)dy}=e^{\int\frac1y\,dy}=e^{\ln|y|}=|y| $$(If we work in the range $y>0$, then $\mu=y$.) Multiplying both sides by $\mu=y$ gives
$$ y^2\,dx+(2xy+y^4)\,dy=0 $$Indeed, $\dfrac{\partial}{\partial y}(y^2)=2y$ and $\dfrac{\partial}{\partial x}(2xy+y^4)=2y$, so $P_y=Q_x$ has been restored (verified with SymPy). Solving by the undetermined-function method, we integrate $\mu P=y^2$ with respect to $x$ to get
$$ f(x,y)=xy^2+g(y) $$Differentiating partially with respect to $y$ gives $f_y=2xy+g'(y)$, which must equal $\mu Q=2xy+y^4$, so $g'(y)=y^4$ and hence $g(y)=\dfrac{y^5}5$. Therefore the general solution is
$$ xy^2+\frac{y^5}5=C $$Multiplying both sides by $5$ to clear the fraction, we can also write it as $5xy^2+y^5=C'$ ($C'=5C$). As a check, differentiating $f=xy^2+y^5/5$ gives $f_x=y^2=\mu P$ and $f_y=2xy+y^4=\mu Q$; both agree (verified with SymPy—verify/univmath/ch34_check.py).
Exercise 34.4: Clairaut's differential equation $y=xy'-\dfrac14(y')^2$
Solution
Let $p=y'$ and $f(p)=-\dfrac14p^2$. Following the procedure in the main text, we substitute into $y=Cx+f(C)$ to find that the general solution is
$$ y=Cx-\frac14C^2 $$Next we find the singular solution. Since $f'(p)=-\dfrac12p$, the equation $x+f'(p)=0$ becomes
$$ x-\frac12p=0\qquad\Longrightarrow\qquad p=2x $$Substituting this into $y=xp-\dfrac14p^2$ gives
$$ y=x(2x)-\frac14(2x)^2=2x^2-\frac14\cdot4x^2=2x^2-x^2=x^2 $$Therefore the singular solution is
$$ y=x^2 $$which is a parabola. Let us use the discriminant to confirm that this parabola is tangent to all of the lines $y=Cx-\dfrac14C^2$ of the general solution. The $x$-coordinates of the intersection points of a line and the parabola are the solutions of the equation obtained by substituting $y=Cx-\dfrac14C^2$ into $y=x^2$,
$$ x^2=Cx-\frac14C^2\qquad\Longrightarrow\qquad x^2-Cx+\frac14C^2=0 $$that is, of a quadratic equation in $x$. The left-hand side has exactly the form of the perfect square $\left(x-\dfrac{C}2\right)^2=x^2-Cx+\dfrac{C^2}4$, so the discriminant is
$$ D=(-C)^2-4\cdot1\cdot\frac{C^2}4=C^2-C^2=0 $$A discriminant of $0$ means that the line $y=Cx-\frac14C^2$ and the parabola $y=x^2$ have exactly one point in common, a repeated root at $x=\dfrac{C}2$—that is, they are tangent. Since this holds for every $C$, the parabola $y=x^2$ is indeed an envelope tangent to all of the lines of the general solution (we verified with SymPy that substituting $p=2x$ into $x-p/2=0$ gives $0$, and that the discriminant is identically $0$—verify/univmath/ch34_check2.py).
Exercise 34.5: Lagrange's differential equation $y=x(y'+1)+(y')^2$
Solution
Let $p=y'$, $f(p)=p+1$, and $g(p)=p^2$ (the condition $f(p)\neq p$ is satisfied). Then $f'(p)=1$, $g'(p)=2p$, and $p-f(p)=p-(p+1)=-1$. Hence,
$$ P_0(p)=-\frac{f'(p)}{p-f(p)}=-\frac{1}{-1}=1,\qquad Q_0(p)=\frac{g'(p)}{p-f(p)}=\frac{2p}{-1}=-2p $$The reduced equation in the main text was $\dfrac{dx}{dp}+P_0(p)x=Q_0(p)$, so here we have
$$ \frac{dx}{dp}+x=-2p $$which is a first-order linear differential equation for $x=x(p)$. The integrating factor is $e^{\int1\,dp}=e^p$, so multiplying both sides by $e^p$ gives
$$ \frac{d}{dp}\big(xe^p\big)=e^p\frac{dx}{dp}+xe^p=-2pe^p $$We integrate the right-hand side with respect to $p$. Since $\displaystyle\int pe^p\,dp=pe^p-e^p$ (by integration by parts: with $u=p,\ dv=e^p dp$, we have $\int u\,dv=uv-\int v\,du=pe^p-\int e^p dp=pe^p-e^p$),
$$ \int(-2p)e^p\,dp=-2(pe^p-e^p)=-2pe^p+2e^p $$Therefore,
$$ xe^p=-2pe^p+2e^p+C\qquad\therefore\ x=-2p+2+Ce^{-p} $$We substitute this into $y=x(p+1)+p^2$.
$$ y=\big(-2p+2+Ce^{-p}\big)(p+1)+p^2 $$First we compute $(-2p+2)(p+1)=-2p^2-2p+2p+2=-2p^2+2$, and adding the remaining terms gives
$$ y=(-2p^2+2)+C(p+1)e^{-p}+p^2=-p^2+2+C(p+1)e^{-p} $$Therefore the general solution can be expressed, using the parameter $p$, as
$$ x=-2p+2+Ce^{-p},\qquad y=-p^2+2+C(p+1)e^{-p} $$(We verified with SymPy that $dy/dp=p\cdot dx/dp$ indeed holds, and that in the numerical examples $p=0.5,1.0,2.0$ the derivative $\frac{dy}{dx}$ (computed by numerical differentiation) agrees exactly with $p$—verify/univmath/ch34_check3_lagrange_fix.py.)
Exercise 34.6: Numerical computation with the logistic equation
Solution
We substitute the carrying capacity $N_\infty=10000$, $k_0=0.3$, and the initial population $N(0)=100$ into the solution formula for the logistic equation in the main text,
$$ N(t)=\frac{N_\infty}{1+\left(\dfrac{N_\infty}{N_0}-1\right)e^{-k_0t}} $$Since $\dfrac{N_\infty}{N_0}-1=\dfrac{10000}{100}-1=100-1=99$, we obtain
$$ N(t)=\frac{10000}{1+99e^{-0.3t}} $$(1) We substitute $t=5$. Since $e^{-0.3\times5}=e^{-1.5}\approx0.223130$,
$$ N(5)=\frac{10000}{1+99\times0.223130}\approx\frac{10000}{1+22.0899}\approx\frac{10000}{23.0899}\approx433.1 $$That is, at $t=5$ the population is about $433$ individuals.
(2) We find $t$ such that $N(t)=9000$.
$$ 9000=\frac{10000}{1+99e^{-0.3t}}\qquad\Longrightarrow\qquad 1+99e^{-0.3t}=\frac{10000}{9000}=\frac{10}9 $$ $$ 99e^{-0.3t}=\frac{10}9-1=\frac19\qquad\Longrightarrow\qquad e^{-0.3t}=\frac1{9\times99}=\frac1{891}\approx0.0011223 $$Taking the natural logarithm of both sides gives $-0.3t=\ln\!\left(\dfrac1{891}\right)=-\ln(891)\approx-6.7923$, so
$$ t=\frac{6.7923}{0.3}\approx22.64 $$That is, the population reaches $9000$ at $t\approx22.64$ (the unit of time depends on how the original problem is set up). (Verified numerically with Python: $N(5)=433.090\cdots$; the value $t=22.641\cdots$ is the one for which $N(t)=9000$; and putting this back into the formula, we indeed get $N(22.641\cdots)=9000.0$—verify/univmath/ch34_final_verify.py.)
← Back to Chapter 34, “Exact Differential Equations, Integrating Factors, and Singular Solutions”
Chapter 35 Fundamentals of Second-Order Linear Homogeneous Differential Equations
Exercise 35.1: The case $D=0$ (repeated root)
Solution
The coefficients of $y''+6y'+9y=0$ are $a=6,b=9$, so the characteristic equation is
$$ \lambda^2+6\lambda+9=0 $$The left-hand side factors as $(\lambda+3)^2$ (since $\lambda^2+6\lambda+9=\lambda^2+2\cdot3\cdot\lambda+3^2$ has exactly the form of the perfect-square formula already covered in high school), so
$$ (\lambda+3)^2=0 \qquad\therefore\ \lambda_0=-3\ (\text{repeated root}) $$Checking with the discriminant, we find $D=6^2-4\times9=36-36=0$, so this is indeed case [ii] of Section 35.5 (repeated root). By Formula 35.2 (Section 35.5.2), the general solution is
$$ Y=C_1e^{-3x}+C_2xe^{-3x} $$As a check, let us verify this by direct substitution. For $y_1=e^{-3x}$ we have $y_1'=-3e^{-3x}$ and $y_1''=9e^{-3x}$, so $y_1''+6y_1'+9y_1=9e^{-3x}+6\times(-3e^{-3x})+9e^{-3x}=(9-18+9)e^{-3x}=0$. For $y_2=xe^{-3x}$, the product rule gives $y_2'=e^{-3x}+x\times(-3)e^{-3x}=(1-3x)e^{-3x}$ and $y_2''=-3e^{-3x}+(1-3x)\times(-3)e^{-3x}=(-3-3+9x)e^{-3x}=(9x-6)e^{-3x}$, so
$$ y_2''+6y_2'+9y_2=(9x-6)e^{-3x}+6(1-3x)e^{-3x}+9xe^{-3x}=\bigl\{(9x-6)+(6-18x)+9x\bigr\}e^{-3x}=0\cdot e^{-3x}=0 $$Thus both functions are confirmed to be solutions (the coefficient of $x e^{-3x}$ simplifies to $9-18+9=0$, and the coefficient of $e^{-3x}$ simplifies to $-6+6=0$). Hence the general solution is $Y=C_1e^{-3x}+C_2xe^{-3x}=(C_1+C_2x)e^{-3x}$ (verified with SymPy).
Exercise 35.2: The case $D\lt0$ (complex roots)
Solution
The coefficients of $y''-2y'+10y=0$ are $a=-2,b=10$, so the characteristic equation is
$$ \lambda^2-2\lambda+10=0 $$The discriminant is $D=(-2)^2-4\times10=4-40=-36\lt0$, so this is case [iii] of Section 35.5 (complex roots). By the quadratic formula,
$$ \lambda=\frac{2\pm\sqrt{-36}}{2}=\frac{2\pm6i}{2}=1\pm3i $$so $\alpha=1,\beta=3$. By Formula 35.3 (Section 35.5.3), the general solution is
$$ Y=e^{x}(C_1\cos3x+C_2\sin3x) $$As a check, substitute $y=e^{x}\cos3x$ directly. By the product rule,
$$ y'=e^{x}\cos3x-3e^{x}\sin3x,\qquad y''=(e^{x}\cos3x-3e^{x}\sin3x)-3(e^{x}\sin3x+3e^{x}\cos3x)=(e^x\cos3x-9e^x\cos3x)+(-3e^x\sin3x-3e^x\sin3x)=-8e^x\cos3x-6e^x\sin3x $$(We differentiated the first derivative once more with the product rule and collected the terms in $\cos3x,\sin3x$ separately.) Therefore,
$$ y''-2y'+10y=(-8e^x\cos3x-6e^x\sin3x)-2(e^x\cos3x-3e^x\sin3x)+10e^x\cos3x=(-8-2+10)e^x\cos3x+(-6+6)e^x\sin3x=0 $$so it is indeed a solution. In the same way, one can confirm that $y=e^{x}\sin3x$ also gives 0 (both were verified with SymPy). Hence the general solution is $Y=e^{x}(C_1\cos3x+C_2\sin3x)$.
Exercise 35.3: The equation of simple harmonic motion
Solution
The coefficients of $y''+\omega^2y=0$ ($\omega>0$) are $a=0,b=\omega^2$, so the characteristic equation is
$$ \lambda^2+\omega^2=0 \qquad\therefore\ \lambda^2=-\omega^2 $$The discriminant is $D=0^2-4\omega^2=-4\omega^2$, and since $\omega>0$ (hence $\omega^2>0$) we have $D\lt0$, so this is case [iii] of Section 35.5 (complex roots). Solving $\lambda^2=-\omega^2$ gives $\lambda=\pm\sqrt{-\omega^2}=\pm\omega i$, so $\alpha=0,\beta=\omega$ (comparing with the form $\lambda=\alpha\pm\beta i$, the real part is $0$ and the imaginary part is $\pm\omega$). By Formula 35.3, the general solution is
$$ Y=e^{0\cdot x}(C_1\cos\omega x+C_2\sin\omega x)=C_1\cos\omega x+C_2\sin\omega x $$(since $e^{0\cdot x}=1$, that factor disappears). This is a generalization of Example 35.9 (the special case $\omega=2$).
Regarding the physical meaning, as stated in the “Why?” at the end of Section 35.5.3, in the general solution $e^{\alpha x}(C_1\cos\beta x+C_2\sin\beta x)$ the quantity $\alpha$ expresses the degree to which the amplitude increases or decreases (damping and amplification), and $\beta$ expresses the speed of oscillation (the angular frequency). In this problem $\alpha=0$, so $e^{\alpha x}=e^{0}=1$, and the coefficient that represents the amplitude does not change at all—that is, even as time passes (if we reinterpret the variable $x$ as the time $t$), the amplitude neither grows nor shrinks, and the oscillation continues with constant magnitude. This corresponds to an idealized situation in which no effect that removes energy, such as friction or air resistance, acts at all, and it agrees with the statement made in the discussion of the physical meaning in Section 35.5.3 that “$\alpha=0$ corresponds to the ideal, frictionless ‘simple harmonic motion.’”
Exercise 35.4: The Wronskian of three solutions
Solution
By the definition of the hyperbolic functions (Chapter 2, Section 2.5, Definition 2.2), $\cosh x=\dfrac{e^x+e^{-x}}{2}$. Differentiating this twice gives
$$ (\cosh x)'=\frac{e^x-e^{-x}}{2}=\sinh x,\qquad (\cosh x)''=\frac{e^x+e^{-x}}{2}=\cosh x $$(We used the fact that each time $e^{-x}$ is differentiated, the chain rule flips the sign.) Hence for $y_3=\cosh x$ we get $y_3''-y_3=\cosh x-\cosh x=0$, so $y_3$ is a solution of $y''-y=0$. That $y_1=e^x,y_2=e^{-x}$ are solutions was already shown in the check of Example 35.1 in this chapter (main text, Section 35.1.2). Therefore $y_1,y_2,y_3$ are all solutions of $y''-y=0$.
Next, we compute the $3\times3$ Wronskian (see the proof of Theorem 35.3).
$$ y_1=e^x,\ y_1'=e^x,\ y_1''=e^x,\qquad y_2=e^{-x},\ y_2'=-e^{-x},\ y_2''=e^{-x},\qquad y_3=\cosh x,\ y_3'=\sinh x,\ y_3''=\cosh x $$ $$ W(y_1,y_2,y_3)= \begin{vmatrix} e^x & e^{-x} & \cosh x\\ e^x & -e^{-x} & \sinh x\\ e^x & e^{-x} & \cosh x \end{vmatrix} $$If we notice that the first and third rows of this determinant are exactly the same (both are $(e^x,\,e^{-x},\,\cosh x)$), we can see that it is 0 without computing anything (a property of determinants—a determinant with two identical rows is 0. This can also be derived from property (ii) in Section 8.5 of Chapter 8, “interchanging two rows reverses the sign”: interchanging two identical rows should not change the determinant, yet by that property the sign must flip, so $W=-W$, that is, $W=0$). Computing it explicitly by the cofactor expansion of Section 8.4 of Chapter 8 also gives
$$ W(y_1,y_2,y_3)=0 $$(verified with SymPy).
This result is a concrete instance of Theorem 35.3 (a second-order linear homogeneous differential equation has exactly two linearly independent solutions, and no collection of three or more solutions can be linearly independent). In the proof of Theorem 35.3, using the fact that $y_1,y_2,y_3$ are solutions of the same equation ①, we showed by an elementary row operation on the determinant (adding constant multiples of the other rows to the third row) that the third row becomes all zeros—this is a general argument that holds for any three solutions. The present problem is a concrete instance of that general argument; moreover, since $y_3=\cosh x=\frac12y_1+\frac12y_2$ is already written as a linear combination of $y_1,y_2$ (that is, $y_1,y_2,y_3$ are linearly dependent from the start), the same conclusion is also obtained from the viewpoint of the columns of the determinant (if some column can be written as a linear combination of the other columns, the determinant is 0; Section 8.5 of Chapter 8). Both viewpoints agree in showing that $y_1,y_2,y_3$ cannot have “three independent directions.”
Exercise 35.5: Directly checking linear dependence
Solution
The definition of linear independence (the beginning of Section 35.2) was this: “When the only pair of constants for which $C_1y_1+C_2y_2=0$ (identically zero for all $x$) is $C_1=C_2=0$, the functions are said to be linearly independent.” For $y_1=x,\ y_2=3x$, the relation $y_2=3y_1$ holds. So take $C_1=-3,\ C_2=1$ (a pair that is not $0$); then
$$ C_1y_1+C_2y_2=(-3)\times x+1\times(3x)=-3x+3x=0 $$which is identically 0 for all $x$. Since this holds for a pair other than $C_1=C_2=0$, by the definition $y_1,y_2$ are immediately seen to be linearly dependent.
Next we compute the Wronskian. Since $y_1'=1,\ y_2'=3$,
$$ W(y_1,y_2)=\begin{vmatrix}x & 3x\\ 1 & 3\end{vmatrix}=x\times3-3x\times1=3x-3x=0 $$(the same procedure as in Example 35.3). Definition 35.2 asserts only that “if $W\neq0$, then the solutions are linearly independent,” so we cannot immediately conclude linear dependence from this result alone; but, as directly verified above, they are in fact linearly dependent, and the result $W=0$ is not in the least inconsistent with this fact (for linearly dependent solutions, it is generally known that the Wronskian is identically 0, as mentioned in the Math Note at the end of Section 35.2—Abel's formula. The present problem is a concrete example of this as well). (Verified with SymPy.)
Exercise 35.6: An initial value problem using Theorem 35.1
Solution
(a) The right-hand side of $y''-y=6$ is the constant $6$, so, as in Example 35.4, we guess that a particular solution $y_0$ is also a constant. Setting $y_0=k$ (a constant), we have $y_0'=0,\ y_0''=0$, so substituting into the equation gives
$$ y_0''-y_0=0-k=-k $$For this to equal $6$ we need $-k=6$, that is, $k=-6$. Hence $y_0=-6$ is one particular solution. As shown in Example 35.1 (Section 35.1.2), the general solution of the corresponding homogeneous equation $y''-y=0$ was $Y=C_1e^x+C_2e^{-x}$. By Theorem 35.1 ($y=y_0+Y$), the required general solution is
$$ y=y_0+Y=-6+C_1e^x+C_2e^{-x} $$Cross-check: since $y'=C_1e^x-C_2e^{-x}$ and $y''=C_1e^x+C_2e^{-x}$, we get $y''-y=(C_1e^x+C_2e^{-x})-(-6+C_1e^x+C_2e^{-x})=6$, so it indeed satisfies $y''-y=6$.
(b) Apply the initial conditions to the general solution in (a). First, using $y(0)=4$,
$$ y(0)=-6+C_1e^{0}+C_2e^{0}=-6+C_1+C_2=4 \qquad\therefore\ C_1+C_2=10 \quad\cdots(\ast) $$Next, using $y'(0)=0$ in $y'=C_1e^x-C_2e^{-x}$,
$$ y'(0)=C_1e^{0}-C_2e^{0}=C_1-C_2=0 \qquad\therefore\ C_1=C_2 \quad\cdots(\ast\ast) $$Solving $(\ast)$ and $(\ast\ast)$ simultaneously, we substitute $C_1=C_2$ into $(\ast)$ to get $2C_1=10$, so $C_1=C_2=5$. Therefore the solution of this initial value problem is
$$ y=-6+5e^x+5e^{-x} $$Using the definition of the hyperbolic functions (Chapter 2, Section 2.5) $\cosh x=\dfrac{e^x+e^{-x}}{2}$, we can combine the terms as $5e^x+5e^{-x}=10\times\dfrac{e^x+e^{-x}}{2}=10\cosh x$, so the solution can also be written in the form
$$ y=-6+10\cosh x $$(we verified that this agrees with the result of solving the initial value problem with SymPy's $\texttt{dsolve}$).
← Back to Chapter 35, “Fundamentals of Second-Order Linear Homogeneous Differential Equations”
Chapter 36 Second-Order Linear Nonhomogeneous Differential Equations and Euler's Equation
Exercise 36.1: Variation of parameters when resonance occurs ($y''+4y=8\sin(2x)$)
Solution
The characteristic equation of the homogeneous equation $y''+4y=0$ is $\lambda^2+4=0$, so $\lambda=\pm2i$ ($\alpha=0,\beta=2$), and hence the fundamental solutions are $y_1=\cos(2x),\ y_2=\sin(2x)$. The Wronskian is
$$ W(y_1,y_2)=y_1y_2'-y_2y_1'=\cos(2x)\cdot2\cos(2x)-\sin(2x)\cdot\big(-2\sin(2x)\big)=2\cos^2(2x)+2\sin^2(2x)=2 $$(Since it is not $0$, they are indeed linearly independent.) Using $R(x)=8\sin(2x)$, we compute the $C_1'(x),C_2'(x)$ of Formula 36.1.
$$ C_1'(x)=-\frac{y_2R(x)}{W}=-\frac{\sin(2x)\cdot8\sin(2x)}{2}=-4\sin^2(2x)=-4\cdot\frac{1-\cos(4x)}{2}=-2+2\cos(4x) $$(We used the half-angle formula $\sin^2\theta=\dfrac{1-\cos2\theta}{2}$ with $\theta=2x$.) Integrating, we obtain
$$ C_1(x)=\int\big(-2+2\cos(4x)\big)\dd x=-2x+\frac12\sin(4x) $$Next,
$$ C_2'(x)=\frac{y_1R(x)}{W}=\frac{\cos(2x)\cdot8\sin(2x)}{2}=4\sin(2x)\cos(2x)=2\sin(4x) $$(We used the double-angle formula $\sin(4x)=2\sin(2x)\cos(2x)$.) Integrating, we obtain
$$ C_2(x)=\int2\sin(4x)\,\dd x=-\frac12\cos(4x) $$Substituting into Formula 36.1 (the variation-of-parameters formula), we get
$$ y_0=C_1(x)y_1+C_2(x)y_2=\left(-2x+\frac12\sin(4x)\right)\cos(2x)-\frac12\cos(4x)\sin(2x) $$ $$ =-2x\cos(2x)+\frac12\big(\sin(4x)\cos(2x)-\cos(4x)\sin(2x)\big)=-2x\cos(2x)+\frac12\sin(4x-2x)=-2x\cos(2x)+\frac12\sin(2x) $$(We used the addition formula in reverse, $\sin A\cos B-\cos A\sin B=\sin(A-B)$, with $A=4x,B=2x$.) The term $\dfrac12\sin(2x)$ that appears at the end is a constant multiple of the fundamental solution $y_2=\sin(2x)$ of the homogeneous equation, so it can be absorbed into the arbitrary constant $C_2$ of the general solution. Therefore we may adopt $y_0=-2x\cos(2x)$ as a particular solution. Checking by direct substitution, for $y_p=-2x\cos(2x)$ we have
$$ y_p'=-2\cos(2x)+4x\sin(2x), \qquad y_p''=8\sin(2x)+8x\cos(2x) $$ $$ y_p''+4y_p=8\sin(2x)+8x\cos(2x)+4\cdot(-2x\cos(2x))=8\sin(2x)+8x\cos(2x)-8x\cos(2x)=8\sin(2x) $$This indeed agrees with the right-hand side $8\sin(2x)$. Therefore the general solution is
$$ y=-2x\cos(2x)+C_1\cos(2x)+C_2\sin(2x) $$(Verified with SymPy.) The term with an extra factor of $x$ appears in the particular solution because the angular frequency of the external force $8\sin(2x)$ happens to coincide exactly with the angular frequency of the original free oscillation ($\omega=2$) (resonance). In this case the amplitude grows without bound as time passes—this is the same mathematical mechanism as the phenomenon in which a swing's amplitude grows larger and larger when you keep pushing it at just the right timing.
Exercise 36.2: Reduction of order ($xy''-(x+1)y'+y=x^2e^x$, with only $y_1=e^x$ known)
Solution
Dividing both sides by $x$ ($\neq0$) to put the equation into the form $y''+P(x)y'+Q(x)y=R(x)$ that we have been working with in this chapter, we obtain
$$ y''-\left(1+\frac1x\right)y'+\frac1xy=xe^x, \qquad P(x)=-\left(1+\frac1x\right),\ \ Q(x)=\frac1x,\ \ R(x)=xe^x $$Since $y_1=e^x$ ($y_1'=e^x$), computing the coefficients in Theorem 36.1 gives
$$ A(x)=\frac{2y_1'}{y_1}+P(x)=2+\left(-1-\frac1x\right)=1-\frac1x=\frac{x-1}{x}, \qquad B(x)=\frac{R(x)}{y_1}=\frac{xe^x}{e^x}=x $$Letting $p=u'$, the equation for $u$ becomes the first-order linear equation
$$ p'+\left(1-\frac1x\right)p=x $$The integrating factor is $\mu(x)=e^{\int(1-\frac1x)\dd x}=e^{x-\ln x}=\dfrac{e^x}{x}$ (Chapter 33). Multiplying both sides by $\mu(x)$, we get
$$ \left(p\cdot\frac{e^x}{x}\right)'=x\cdot\frac{e^x}{x}=e^x $$Integrating both sides, we get $p\cdot\dfrac{e^x}{x}=e^x+C_1$, that is,
$$ p(x)=u'(x)=\left(e^x+C_1\right)\cdot\frac{x}{e^x}=x+C_1xe^{-x} $$Integrating once more with respect to $x$ and using $\displaystyle\int x\,\dd x=\frac{x^2}2$ and $\displaystyle\int xe^{-x}\dd x=-(x+1)e^{-x}$ (integration by parts), we get
$$ u(x)=\frac{x^2}2-C_1(x+1)e^{-x}+C_2 $$Substituting this into $y=u(x)y_1=u(x)e^x$, we obtain
$$ y=\left(\frac{x^2}2-C_1(x+1)e^{-x}+C_2\right)e^x=\frac{x^2}2e^x-C_1(x+1)+C_2e^x $$Renaming the constants as $C_1\to-C_2,\ C_2\to C_1$, the general solution is
$$ y=\frac{x^2}2e^x+C_1e^x+C_2(x+1) $$As a check, substituting the particular solution $y_p=\dfrac{x^2}2e^x$ directly into the equation, we have $y_p'=xe^x+\dfrac{x^2}2e^x$ and $y_p''=e^x+2xe^x+\dfrac{x^2}2e^x$, so
$$ xy_p''-(x+1)y_p'+y_p=x\left(e^x+2xe^x+\frac{x^2}2e^x\right)-(x+1)\left(xe^x+\frac{x^2}2e^x\right)+\frac{x^2}2e^x $$Simplifying (verified with SymPy), this becomes $x^2e^x$, which indeed agrees with the right-hand side. Also, substituting $y_2=x+1$ into the homogeneous equation $xy''-(x+1)y'+y=0$, we have $y_2'=1,\ y_2''=0$, so $x\cdot0-(x+1)\cdot1+(x+1)=0$, and hence it is indeed another fundamental solution (together with $y_1=e^x$, the entire general solution of the nonhomogeneous equation has been found starting from just one fundamental solution).
Exercise 36.3: Euler's equation, distinct real roots ($x^2y''+7xy'+8y=0$)
Solution
Here $a=7,\ b=8$. By Formula 36.2, the characteristic equation is
$$ \lambda^2+(7-1)\lambda+8=\lambda^2+6\lambda+8=(\lambda+2)(\lambda+4)=0 $$Hence $\lambda=-2,-4$ (distinct real roots). Therefore the general solution is
$$ y=C_1x^{-2}+C_2x^{-4} $$(Substituting each of $x^{-2},x^{-4}$ into the equation gives $0$; verified with SymPy.)
Exercise 36.4: Euler's equation, a repeated root and an initial value problem ($x^2y''-3xy'+4y=0$)
Solution
Here $a=-3,\ b=4$. The characteristic equation is
$$ \lambda^2+(-3-1)\lambda+4=\lambda^2-4\lambda+4=(\lambda-2)^2=0 $$This gives the repeated root $\lambda_0=2$. By Theorem 36.2, the general solution is
$$ y=C_1x^2+C_2x^2\ln x $$We now apply the initial conditions. We have $y'(x)=2C_1x+C_2(2x\ln x+x)$ (product rule: $\dfrac{\dd}{\dd x}(x^2\ln x)=2x\ln x+x^2\cdot\frac1x=2x\ln x+x$). Substituting $x=1$ (note that $\ln1=0$), we get
$$ y(1)=C_1\cdot1+C_2\cdot1\cdot0=C_1=1 \quad\Longrightarrow\quad C_1=1 $$ $$ y'(1)=2C_1\cdot1+C_2(2\cdot1\cdot0+1)=2C_1+C_2=2+C_2=1 \quad\Longrightarrow\quad C_2=-1 $$Therefore the required solution is
$$ y=x^2-x^2\ln x=x^2(1-\ln x) $$As a check, $y(1)=1\cdot(1-0)=1$, and from $y'(x)=2x(1-\ln x)+x^2\cdot\left(-\frac1x\right)=2x-2x\ln x-x=x-2x\ln x$ we get $y'(1)=1-0=1$, so both initial conditions are satisfied. We have also verified that this agrees with the result of solving this initial value problem directly with SymPy's $\mathrm{dsolve}$.
Exercise 36.5: Euler's equation, complex roots ($x^2y''+xy'+4y=0$)
Solution
Here $a=1,\ b=4$. The characteristic equation is
$$ \lambda^2+(1-1)\lambda+4=\lambda^2+4=0 $$Hence $\lambda=\pm2i$ ($\alpha=0,\ \beta=2$). By Theorem 36.3, the general solution is
$$ y=C_1\cos(2\ln x)+C_2\sin(2\ln x) $$(Since $x^\alpha=x^0=1$, no coefficient appears in front. Substituting each of $\cos(2\ln x),\sin(2\ln x)$ into the equation gives $0$; verified with SymPy.)
Exercise 36.6: Finding a fundamental solution directly for a variable-coefficient equation (condition (I))
Solution
Here $P(x)=x$, $Q(x)=-\left(\dfrac2{x^2}+2\right)$. We compute the expression $\lambda(\lambda-1)+\lambda xP(x)+x^2Q(x)$ in condition (I) of Theorem 36.4.
$$ \lambda xP(x)=\lambda x\cdot x=\lambda x^2, \qquad x^2Q(x)=x^2\cdot\left(-\frac2{x^2}-2\right)=-2-2x^2 $$Substituting these, we get
$$ \lambda(\lambda-1)+\lambda x^2+(-2-2x^2)=(\lambda^2-\lambda-2)+x^2(\lambda-2) $$For this to be identically $0$ regardless of $x$, the coefficient of $x^2$ and the constant term must each be $0$.
$$ \lambda-2=0 \qquad \text{and} \qquad \lambda^2-\lambda-2=0 $$The first equation gives $\lambda=2$. Substituting this into the second equation gives $2^2-2-2=4-2-2=0$, which is indeed satisfied, so there is no contradiction. Therefore $\lambda=2$ is a constant satisfying condition (I), and by Theorem 36.4, $y=x^2$ is one of the fundamental solutions of this equation.
Checking by direct substitution, for $y=x^2$ we have $y'=2x,\ y''=2$, so
$$ y''+xy'-\left(\frac2{x^2}+2\right)y=2+x\cdot2x-\left(\frac2{x^2}+2\right)x^2=2+2x^2-2-2x^2=0 $$Thus the equation is indeed satisfied (also verified with SymPy; the other fundamental solution can be found by applying the reduction-of-order method of Section 36.2 to $y_1=x^2$).
Exercise 36.7: An initial value problem for simple harmonic motion ($m=2,\ k=8$)
Solution
We have $\omega=\sqrt{k/m}=\sqrt{8/2}=\sqrt4=2$. By Theorem 36.6, the solution has the form $x(t)=A\cos(2t-\theta_0)$. Since $\dot x(t)=-2A\sin(2t-\theta_0)$,
$$ x(0)=A\cos(-\theta_0)=A\cos\theta_0=0, \qquad \dot x(0)=-2A\sin(-\theta_0)=2A\sin\theta_0=2 $$From the first equation $A\cos\theta_0=0$ we get, since $A\neq0$, $\cos\theta_0=0$, that is, either $\theta_0=\dfrac\pi2$ or $\theta_0=-\dfrac\pi2$ (which is the same angle as $\dfrac{3\pi}2$). The second equation gives $A\sin\theta_0=1$. If we agree that the amplitude is positive ($A\gt0$), then we need $\sin\theta_0=1/A\gt0$, so $\sin\theta_0\gt0$; hence $\theta_0=\dfrac\pi2$ is determined (for which $\sin\theta_0=1$), and $A\sin\theta_0=A=1$ (if $\theta_0=-\dfrac\pi2$, then $\sin\theta_0=-1$, and $A\sin\theta_0=1$ cannot be satisfied with $A\gt0$). Therefore $A=1,\ \theta_0=\dfrac\pi2$, and
$$ x(t)=\cos\left(2t-\frac\pi2\right)=\cos(2t)\cos\frac\pi2+\sin(2t)\sin\frac\pi2=\sin(2t) $$(We used the addition formula and $\cos\frac\pi2=0,\sin\frac\pi2=1$.) As a check, $x(0)=\sin0=0$, and from $\dot x(t)=2\cos(2t)$ we get $\dot x(0)=2\cos0=2$, so both initial conditions are satisfied. We have also verified that this agrees with the result of solving the initial value problem directly with SymPy's $\mathrm{dsolve}$.
Chapter 37 Higher-Order Linear Differential Equations
Exercise 37.1: Four distinct real roots ($y''''-5y''+4y=0$)
Solution
The characteristic equation is $\lambda^4-5\lambda^2+4=0$. Letting $\mu=\lambda^2$, we get $\mu^2-5\mu+4=0$. We look for two numbers whose sum is $5$ and whose product is $4$, and find $1,4$, so this factors as $(\mu-1)(\mu-4)=0$. Substituting back $\mu=\lambda^2$, we have
$$ (\lambda^2-1)(\lambda^2-4)=0 $$Factoring further gives $(\lambda-1)(\lambda+1)(\lambda-2)(\lambda+2)=0$, so we obtain $\lambda=1,-1,2,-2$, that is, four distinct real roots. By Theorem 37.3, the general solution is
$$ y=C_1e^{x}+C_2e^{-x}+C_3e^{2x}+C_4e^{-2x} $$As a check, substitute $y'=C_1e^x-C_2e^{-x}+2C_3e^{2x}-2C_4e^{-2x}$, $y''=C_1e^x+C_2e^{-x}+4C_3e^{2x}+4C_4e^{-2x}$, and $y''''=C_1e^x+C_2e^{-x}+16C_3e^{2x}+16C_4e^{-2x}$ into the left-hand side $y''''-5y''+4y$ of the original equation. The coefficient of $e^x$ is $1-5+4=0$, the coefficient of $e^{-x}$ is likewise $1-5+4=0$, the coefficient of $e^{2x}$ is $16-20+4=0$, and the coefficient of $e^{-2x}$ is likewise $16-20+4=0$, so the expression is indeed identically $0$ (verified with SymPy).
Exercise 37.2: Triple root ($y'''-3y''+3y'-y=0$)
Solution
The characteristic equation is $\lambda^3-3\lambda^2+3\lambda-1=0$. Its coefficients $1,-3,3,-1$ coincide exactly with the binomial coefficients ${}_3\mathrm{C}_0,{}_3\mathrm{C}_1,{}_3\mathrm{C}_2,{}_3\mathrm{C}_3=1,3,3,1$ with alternating signs attached. Indeed, by the binomial theorem (already learned in high school),
$$ (\lambda-1)^3=\lambda^3-3\lambda^2\cdot1+3\lambda\cdot1^2-1^3=\lambda^3-3\lambda^2+3\lambda-1 $$so the characteristic equation can be rewritten as
$$ (\lambda-1)^3=0 $$Hence $\lambda=1$ is a triple root ($k=3$). By Theorem 37.4, the fundamental solutions corresponding to $\lambda_0=1$ are the three functions $e^x,xe^x,x^2e^x$ (exactly matching the order 3 of the equation), and the general solution is
$$ y=(C_1+C_2x+C_3x^2)e^x $$As a check, we substitute $y=x^2e^x$ directly. By the product rule, $y'=(2x+x^2)e^x,\ y''=(2+4x+x^2)e^x,\ y'''=(6+6x+x^2)e^x$, so
$$ y'''-3y''+3y'-y=\big[(6+6x+x^2)-3(2+4x+x^2)+3(2x+x^2)-x^2\big]e^x $$Collecting the terms inside the brackets by degree, we find that the coefficient of $x^2$ is $1-3+3-1=0$, the coefficient of $x^1$ is $6-12+6-0=0$, and the constant term is $6-6+0-0=0$, so the whole expression is $0$ (the same holds for $e^x,xe^x$; verified with SymPy).
Exercise 37.3: Comparison with the second-order Euler equation ($x^2y''-3xy'+4y=0$)
Solution
This is the Euler equation with $n=2$, so we apply Formula 37.2 of Section 37.5 (the characteristic equation in terms of falling factorials) to the case $n=2$. Letting $y=x^\lambda$, we have $y'=\lambda x^{\lambda-1}$ and $y''=\lambda(\lambda-1)x^{\lambda-2}$, so substituting into the equation gives
$$ x^2\cdot\lambda(\lambda-1)x^{\lambda-2}-3x\cdot\lambda x^{\lambda-1}+4x^\lambda=\big[\lambda(\lambda-1)-3\lambda+4\big]x^\lambda=0 $$Dividing by $x^\lambda\neq0$ ($x\gt0$), we obtain the characteristic equation
$$ \lambda(\lambda-1)-3\lambda+4=\lambda^2-\lambda-3\lambda+4=\lambda^2-4\lambda+4=(\lambda-2)^2=0 $$This has the double root $\lambda=2$. By the rule of Section 37.5.3 (for a repeated root of an Euler equation, the solution is multiplied by powers of $\ln x$ instead of powers of $x$), the general solution is
$$ y=(C_1+C_2\ln x)\,x^2 $$This result coincides exactly with what we get by substituting $\lambda_0=2$ into Theorem 36.2 in Chapter 36, Section 36.4 (the formula $y=C_1x^{\lambda_0}+C_2x^{\lambda_0}\ln x$ for the repeated-root case of the second-order Euler equation)—we have confirmed that specializing the general $n$th-order method learned in this chapter to $n=2$ reproduces the result for the second-order case exactly. As a check, we substitute $y=x^2\ln x$ directly. Since $y'=2x\ln x+x,\ y''=2\ln x+2+1=2\ln x+3$,
$$ x^2(2\ln x+3)-3x(2x\ln x+x)+4x^2\ln x=(2x^2\ln x+3x^2)-(6x^2\ln x+3x^2)+4x^2\ln x=(2-6+4)x^2\ln x+(3-3)x^2=0 $$so it indeed satisfies the equation (the same holds for $x^2$; verified with SymPy).
Exercise 37.4: Wronskian of monomials ($W(1,x,x^2,x^3)$)
Solution
Following Definition 37.3, we form the $4\times4$ Wronskian. Each column consists of one of the functions $1,x,x^2,x^3$ together with its derivatives (of orders 0 through 3).
$$ W(1,x,x^2,x^3)= \begin{vmatrix} 1 & x & x^2 & x^3\\ 0 & 1 & 2x & 3x^2\\ 0 & 0 & 2 & 6x\\ 0 & 0 & 0 & 6 \end{vmatrix} $$(In the first column, $1$, all the derivatives are $0$ (those of order 1 and higher); in the second column, $x$ has first derivative $1$, and the derivatives of order 2 and higher are $0$; in the third column, $x^2$ has first derivative $2x$ and second derivative $2$, and the derivatives of order 3 and higher are $0$; in the fourth column, $x^3$ has first derivative $3x^2$, second derivative $6x$, and third derivative $6$.) This matrix is exactly an upper triangular matrix (all entries below the diagonal are $0$). The determinant of an upper triangular matrix equals the product of its diagonal entries (Chapter 8), so
$$ W(1,x,x^2,x^3)=1\times1\times2\times6=12 $$This value does not contain $x$; it is a constant (since it is not $0$, $1,x,x^2,x^3$ are linearly independent for every $x$). Furthermore, the diagonal entries $1,1,2,6$ are equal to $0!,1!,2!,3!$, respectively ($0!=1,\ 1!=1,\ 2!=1\times2=2,\ 3!=1\times2\times3=6$). Therefore
$$ W(1,x,x^2,x^3)=0!\cdot1!\cdot2!\cdot3!=1\cdot1\cdot2\cdot6=12 $$In general, if we compute the Wronskian of $1,x,x^2,\ldots,x^{n-1}$ in the same way, the $(j-1)$th derivative in the $j$th column ($y_j=x^{j-1}$, $j=1,\ldots,n$) is $(j-1)!$, and all derivatives of higher order are $0$. So again we get an upper triangular matrix, and $W(1,x,\ldots,x^{n-1})=0!\,1!\,2!\cdots(n-1)!$ (a product of factorials) is a constant (for the case $n=4$, a direct computation with SymPy confirmed that the value agrees with $12$).
Exercise 37.5: A sixth-order equation with both complex and real repeated roots
Solution
The characteristic equation $p(\lambda)=(\lambda^2+1)^2(\lambda-2)^2=0$ is already given in factored form. From $\lambda^2+1=0$ we get $\lambda=\pm i$, and since this factor is squared, each is a double root. Also, $\lambda-2=0$ gives $\lambda=2$, and since this factor is squared as well, it is a double root. The multiplicities add up to $2+2+2=6$, which matches exactly the order 6 of the equation.
We apply Theorem 37.4 to each root. From $\lambda=2$ (double, real) we get the two functions $e^{2x},xe^{2x}$. From $\lambda=\pm i$ (each double, a complex pair, $\alpha=0,\beta=1$) we first get $\cos x,\sin x$, obtained, just as in the case of simple roots, by converting to real form with Euler's formula; because the roots are double, these are each also multiplied by $x$, which adds $x\cos x,x\sin x$, so we obtain the four functions $\cos x,\sin x,x\cos x,x\sin x$ (we have merely applied, with $k=2$, the rule seen in Illustration 37.4 of Section 37.4, “for a repeated complex root, the functions multiplied by $x^j$ ($j=0,\ldots,k-1$) become fundamental solutions”). The total is $2+4=6$ functions, matching the order 6, and the general solution is
$$ y=(C_1+C_2x)\cos x+(C_3+C_4x)\sin x+(C_5+C_6x)e^{2x} $$As a check, expanding $p(\lambda)$ gives
$$ p(\lambda)=\lambda^6-4\lambda^5+6\lambda^4-8\lambda^3+9\lambda^2-4\lambda+4 $$so the original equation is $y^{(6)}-4y^{(5)}+6y''''-8y'''+9y''-4y'+4y=0$. We have verified with SymPy that substituting each of the six fundamental solutions $\cos x,\sin x,x\cos x,x\sin x,e^{2x},xe^{2x}$ of the general solution found above into this equation gives $0$ in every case.
Exercise 37.6 (application to materials science): Deflection of a beam under a uniformly distributed load
Solution
The right-hand side of the equation $EI\,y''''(x)=w_0$ ($w_0,E,I$ are constants) is a constant independent of $x$, so without even bringing up a test for exact differential equations as in Section 37.1, we see at once that each time we integrate both sides once with respect to $x$, the order of the derivative goes down by one. We divide both sides by $EI$ (a constant, $\neq0$) and then integrate four times with respect to $x$, in succession.
$$ y''''=\frac{w_0}{EI} \ \Longrightarrow\ y'''=\frac{w_0}{EI}x+A \ \Longrightarrow\ y''=\frac{w_0}{2EI}x^2+Ax+B $$ $$ \Longrightarrow\ y'=\frac{w_0}{6EI}x^3+\frac{A}{2}x^2+Bx+C \ \Longrightarrow\ y=\frac{w_0}{24EI}x^4+\frac{A}{6}x^3+\frac{B}{2}x^2+Cx+D $$($A,B,C,D$ are integration constants. Since the equation is of fourth order, exactly four arbitrary constants appear—this can be understood naturally from the fact, stated in Section 37.2, that “the general solution of an $n$th-order homogeneous equation has $n$ arbitrary constants,” together with writing the solution of the nonhomogeneous equation as a sum with a particular solution: the part $\dfrac{w_0}{24EI}x^4$ is a particular solution for the right-hand side $w_0/EI$, and the remaining part $\dfrac{A}{6}x^3+\dfrac{B}{2}x^2+Cx+D$ is the general solution of the homogeneous equation $y''''=0$.) Now we apply the boundary conditions. First, $y(0)=0$:
$$ y(0)=D=0 \quad\therefore\ D=0 $$Next, $y''(0)=0$:
$$ y''(0)=B=0 \quad\therefore\ B=0 $$Using $B=D=0$, we have $y(x)=\dfrac{w_0}{24EI}x^4+\dfrac{A}{6}x^3+Cx$ and $y''(x)=\dfrac{w_0}{2EI}x^2+Ax$. We apply the remaining two boundary conditions $y(L)=0,\ y''(L)=0$.
$$ y''(L)=\frac{w_0}{2EI}L^2+AL=0 \quad\therefore\ A=-\frac{w_0L}{2EI} $$ $$ y(L)=\frac{w_0}{24EI}L^4+\frac{A}{6}L^3+CL=0 $$Substituting $A=-\dfrac{w_0L}{2EI}$, we obtain
$$ \frac{w_0}{24EI}L^4-\frac{w_0L}{12EI}L^3+CL=\frac{w_0L^4}{24EI}-\frac{w_0L^4}{12EI}+CL=-\frac{w_0L^4}{24EI}+CL=0 $$(We used $\dfrac1{24}-\dfrac1{12}=\dfrac1{24}-\dfrac2{24}=-\dfrac1{24}$.) Hence $CL=\dfrac{w_0L^4}{24EI}$, that is, $C=\dfrac{w_0L^3}{24EI}$. Summing up,
$$ y(x)=\frac{w_0}{24EI}x^4-\frac{w_0L}{12EI}x^3+\frac{w_0L^3}{24EI}x=\frac{w_0}{24EI}\big(x^4-2Lx^3+L^3x\big)=\frac{w_0\,x\big(L^3-2Lx^2+x^3\big)}{24EI} $$Now we compute the deflection at the midpoint, $x=L/2$. Since $x^4=\dfrac{L^4}{16}$, $Lx^3=L\cdot\dfrac{L^3}{8}=\dfrac{L^4}{8}$, and $L^3x=\dfrac{L^4}{2}$,
$$ y\!\left(\frac L2\right)=\frac{w_0}{24EI}\left(\frac{L^4}{16}-2\cdot\frac{L^4}{8}+\frac{L^4}{2}\right)=\frac{w_0}{24EI}\cdot L^4\left(\frac1{16}-\frac14+\frac12\right)=\frac{w_0}{24EI}\cdot L^4\cdot\frac{1-4+8}{16}=\frac{w_0L^4}{24EI}\cdot\frac5{16} $$(Bringing to a common denominator: $\dfrac1{16}-\dfrac4{16}+\dfrac8{16}=\dfrac5{16}$.) Therefore
$$ y\!\left(\frac L2\right)=\frac{5w_0L^4}{384EI} $$which agrees exactly with the formula $\dfrac{5w_0L^4}{384EI}$ known in mechanics of materials as “the formula for the deflection of a simply supported beam under a uniformly distributed load” (we verified with SymPy, by solving the boundary value problem directly, that the same result is obtained). The sign obtained, $y(L/2)\gt0$ when $w_0,E,I,L$ are all positive, corresponds to the magnitude of the deflection when $y$ is defined to be positive in the same direction as the load (downward).
← Back to Chapter 37, “Higher-Order Linear Differential Equations”
Chapter 38 The Operator Method
Exercise 38.1: Substitution formula for exponential functions (non-resonance)
Solution
The equation $y'-5y=e^{2x}$ has the form $\Phi(D)y=f(x)$ with $\Phi(D)=D-5$ (that is, $\Phi(z)=z-5$) and $f(x)=e^{2x}$ ($\alpha=2$). First we check that the exponent $\alpha=2$ of the forcing term does not coincide with the root ($\lambda=5$) of the characteristic equation $\Phi(\lambda)=\lambda-5=0$. Indeed,
$$ \Phi(2) = 2-5 = -3 \neq 0 $$so no resonance occurs, and Formula 38.2 can be used as it stands. All we need to do is “replace $D$ in $\Phi(D)$ by $\alpha=2$ and divide,” so
$$ Y = \frac{1}{\Phi(D)}\big[e^{2x}\big] = \frac{1}{\Phi(2)}e^{2x} = \frac{1}{-3}e^{2x} = -\frac13 e^{2x} $$is a particular solution. To check, we substitute $Y=-\dfrac13e^{2x}$ directly into the equation. Since $Y'=-\dfrac23e^{2x}$,
$$ Y'-5Y = -\frac23e^{2x} - 5\cdot\left(-\frac13e^{2x}\right) = -\frac23e^{2x}+\frac53e^{2x} = \frac33e^{2x} = e^{2x} $$and so $y'-5y=e^{2x}$ is indeed satisfied.
Exercise 38.2: Resonance for an exponential function (double root)
Solution
Factoring $\Phi(D)=D^2-6D+9$ gives $\Phi(D)=(D-3)^2$ ($\Phi(z)=z^2-6z+9=(z-3)^2$). The forcing term is $e^{3x}$ ($\alpha=3$), and checking the characteristic equation $\Phi(\lambda)=(\lambda-3)^2=0$ shows that $\lambda=3$ is a double root and, moreover, coincides exactly with the exponent $\alpha=3$ of the forcing term. That is,
$$ \Phi(3) = (3-3)^2 = 0 $$so the condition $\Phi(\alpha)\neq0$ of Formula 38.2 fails, and this is resonance. We therefore apply Formula 38.4 to the form $\Phi(D)=(D-\alpha)^n$ (with $\alpha=3$, $n=2$), which gives
$$ Y = \frac{1}{(D-3)^2}\big[e^{3x}\big] = \frac{x^2}{2!}e^{3x} = \frac{x^2}{2}e^{3x} $$as a particular solution. To check, we compute the first and second derivatives of $Y=\dfrac{x^2}{2}e^{3x}$ with the product rule.
$$ Y' = xe^{3x} + \frac{x^2}{2}\cdot3e^{3x} = e^{3x}\left(x+\frac32x^2\right) $$ $$ Y'' = 3e^{3x}\left(x+\frac32x^2\right) + e^{3x}(1+3x) = e^{3x}\left(3x+\frac92x^2+1+3x\right) = e^{3x}\left(\frac92x^2+6x+1\right) $$(The first term comes from differentiating $e^{3x}$, which multiplies it by three, and the second term comes from differentiating the contents of the parentheses, $x+\frac32x^2$, to get $1+3x$; this is the product rule.) Using these,
$$ Y''-6Y'+9Y = e^{3x}\left[\left(\frac92x^2+6x+1\right) - 6\left(x+\frac32x^2\right) + 9\cdot\frac12x^2\right] $$Collecting the coefficient of $x^2$ inside the brackets gives $\dfrac92-9+\dfrac92=0$, collecting the coefficient of $x$ gives $6-6=0$, and only the constant term $1$ remains, so
$$ Y''-6Y'+9Y = e^{3x}\cdot1 = e^{3x} $$and so $y''-6y'+9y=e^{3x}$ is indeed satisfied.
Exercise 38.3: Combining the shift theorem and resonance
Solution
We have $\Phi(D)=D^2-2D+1=(D-1)^2$, and the forcing term $f(x)=x^2e^{x}$ has the form “exponential function $e^{x}$” × “polynomial $x^2$.” So we use the shift theorem (Formula 38.3) with $\alpha=1$ and $g(x)=x^2$. First we compute $\Phi(D+1)$: replacing $D$ by $D+1$ gives
$$ \Phi(D+1) = \big((D+1)-1\big)^2 = D^2 $$(the $-1$ and $+1$ cancel exactly). Therefore
$$ \frac{1}{(D-1)^2}\big[x^2e^{x}\big] = e^{x}\cdot\frac{1}{D^2}\big[x^2\big] $$All that remains is to compute $\dfrac{1}{D^2}[x^2]$, that is, to integrate $x^2$ twice ($D^{-n}$ of Definition 38.1, with the constants of integration taken to be 0).
$$ \int x^2\,dx = \frac{x^3}{3},\qquad \int\frac{x^3}{3}\,dx = \frac{x^4}{12} $$so $\dfrac{1}{D^2}[x^2]=\dfrac{x^4}{12}$, and the particular solution we seek is
$$ Y = \frac{x^4}{12}e^{x} $$To check, we compute the derivatives of $Y=\dfrac{x^4}{12}e^{x}$ with the product rule.
$$ Y' = \frac{4x^3}{12}e^x + \frac{x^4}{12}e^x = e^x\left(\frac{x^3}{3}+\frac{x^4}{12}\right) $$ $$ Y'' = e^x\left(\frac{x^3}{3}+\frac{x^4}{12}\right) + e^x\left(x^2+\frac{x^3}{3}\right) = e^x\left(\frac{x^4}{12}+\frac{2x^3}{3}+x^2\right) $$(In the second equality, differentiating $e^x$ leaves the first parenthesis as it is, and differentiating the contents of $\left(\frac{x^3}{3}+\frac{x^4}{12}\right)$ adds one more term, $\left(x^2+\frac{x^3}{3}\right)$.) Using these,
$$ Y''-2Y'+Y = e^x\left[\left(\frac{x^4}{12}+\frac{2x^3}{3}+x^2\right) - 2\left(\frac{x^3}{3}+\frac{x^4}{12}\right) + \frac{x^4}{12}\right] $$Inside the brackets, the coefficient of $x^4$ is $\frac{1}{12}-\frac{2}{12}+\frac{1}{12}=0$ and the coefficient of $x^3$ is $\frac23-\frac23=0$; only the coefficient of $x^2$ remains, equal to $1$, so
$$ Y''-2Y'+Y = e^x\cdot x^2 = x^2e^x $$and so $y''-2y'+y=x^2e^x$ is indeed satisfied.
Exercise 38.4: Substitution formula for trigonometric functions (non-resonance)
Solution
We have $\Phi(D^2)=D^2+9$ (that is, $\Phi(z)=z+9$), and the forcing term is $\cos2x$ (the angular frequency of the external force is $\alpha=2$). Checking the condition $\Phi(-\alpha^2)\neq0$ of Formula 38.5,
$$ \Phi(-\alpha^2) = \Phi(-4) = -4+9 = 5 \neq 0 $$so no resonance occurs, and Formula 38.5 can be used. All we need to do is “replace $D^2$ in $\Phi(D^2)$ by $-\alpha^2=-4$ and divide,” so
$$ Y = \frac{1}{\Phi(D^2)}\cos2x = \frac{1}{\Phi(-4)}\cos2x = \frac15\cos2x $$is a particular solution. To check, we substitute $Y=\dfrac15\cos2x$ into the equation. Since $Y''=-4\cdot\dfrac15\cos2x=-\dfrac45\cos2x$,
$$ Y''+9Y = -\frac45\cos2x + 9\cdot\frac15\cos2x = \left(-\frac45+\frac95\right)\cos2x = \cos2x $$and so $y''+9y=\cos2x$ is indeed satisfied.
Exercise 38.5: Resonance for trigonometric functions
Solution
We have $\Phi(D^2)=D^2+4$ (that is, $\Phi(z)=z+4$), and the forcing term is $\sin2x$ (the angular frequency of the external force is $\alpha=2$). Checking the condition of Formula 38.5,
$$ \Phi(-\alpha^2) = \Phi(-4) = -4+4 = 0 $$so the condition $\Phi(-\alpha^2)\neq0$ fails—this is the trigonometric version of resonance, in which the natural angular frequency ($\sqrt4=2$) of the system described by the equation itself coincides exactly with the angular frequency ($2$) of the external force. Hence Formula 38.5 cannot be used, and we use the resonance formula, Formula 38.6, with $\alpha=2$.
$$ Y = \frac{1}{D^2+4}\sin2x = -\frac{x}{2\cdot2}\cos2x = -\frac{x}{4}\cos2x $$is a particular solution. To check, we compute the derivatives of $Y=-\dfrac{x}{4}\cos2x$ with the product rule.
$$ Y' = -\frac14\cos2x - \frac{x}{4}\cdot(-2\sin2x) = -\frac14\cos2x+\frac{x}{2}\sin2x $$ $$ Y'' = \frac12\sin2x + \frac12\sin2x + \frac{x}{2}\cdot2\cos2x = \sin2x + x\cos2x $$(Differentiating the first term $-\frac14\cos2x$ gives $\frac12\sin2x$, and differentiating the second term $\frac{x}{2}\sin2x$ with the product rule gives $\frac12\sin2x+x\cos2x$; together they give $\sin2x+x\cos2x$.) Using these,
$$ Y''+4Y = \big(\sin2x+x\cos2x\big) + 4\left(-\frac{x}{4}\cos2x\right) = \sin2x + x\cos2x - x\cos2x = \sin2x $$and so $y''+4y=\sin2x$ is indeed satisfied.
On the amplitude of the solution: the amplitude of the particular solution $Y=-\dfrac{x}{4}\cos2x$ (the height of its envelope) is $\left|\dfrac{x}{4}\right|$, which grows without bound as $x\to\infty$. Because the angular frequency of the external force coincides exactly with the natural angular frequency of the system itself, resonance occurs, and the amplitude keeps increasing in proportion to the time $x$ while the solution oscillates (the same mechanism as the phenomenon we saw in Section 38.8 and Figure 38.2).
Exercise 38.6: Commutativity of operators with constant coefficients (proof problem)
Solution
Let $\Phi_1(D)=\displaystyle\sum_{i=0}^{m}a_iD^i$ and $\Phi_2(D)=\displaystyle\sum_{j=0}^{n}b_jD^j$. First we compute $\Phi_1(D)\big[\Phi_2(D)f(x)\big]$. Since $\Phi_2(D)f(x)=\displaystyle\sum_{j=0}^n b_jD^jf(x)$ is a sum of finitely many terms, linearity (Theorem 38.1; that is, if we use repeatedly the property that $D$ preserves sums and constant multiples, it extends directly from a sum of two terms to sums and constant multiples of finitely many terms) gives
$$ \Phi_1(D)\Big[\sum_{j=0}^n b_jD^jf(x)\Big] = \sum_{i=0}^m a_iD^i\Big[\sum_{j=0}^n b_jD^jf(x)\Big] = \sum_{i=0}^m\sum_{j=0}^n a_ib_j\,D^i\big[D^jf(x)\big] $$(We distributed the outer sum $\sum_i a_iD^i[\cdots]$ inside, and then distributed the inner sum $\sum_j b_jD^jf(x)$ term by term, again by linearity. Since $a_i,b_j$ are both constants, they may be taken outside $D^i$.) Now, using Theorem 38.1 ($D^i[D^jf(x)]=D^{i+j}[f(x)]$: different powers of $D$ commute with one another), we get
$$ \Phi_1(D)\big[\Phi_2(D)f(x)\big] = \sum_{i=0}^m\sum_{j=0}^n a_ib_j\,D^{i+j}\big[f(x)\big] $$Carrying out exactly the same computation for $\Phi_2(D)\big[\Phi_1(D)f(x)\big]$ (with the roles of the indices $i,j$ interchanged), we obtain
$$ \Phi_2(D)\big[\Phi_1(D)f(x)\big] = \sum_{j=0}^n\sum_{i=0}^m b_ja_i\,D^{j+i}\big[f(x)\big] $$Now compare the double sums $\displaystyle\sum_{i=0}^m\sum_{j=0}^n a_ib_jD^{i+j}[f(x)]$ and $\displaystyle\sum_{j=0}^n\sum_{i=0}^m b_ja_iD^{j+i}[f(x)]$. Both are “sums over all combinations of $i=0,\dots,m$ and $j=0,\dots,n$”; the range over which we add (the range over which $i,j$ vary) is exactly the same, and the content of each term also agrees completely, because $a_ib_j=b_ja_i$ (products of real numbers commute) and $i+j=j+i$ (sums of integers commute). Changing the order of summation (whether we sum over $i$ first or over $j$ first) does not change the result of a sum of finitely many real numbers, so
$$ \sum_{i=0}^m\sum_{j=0}^n a_ib_j\,D^{i+j}\big[f(x)\big] = \sum_{j=0}^n\sum_{i=0}^m b_ja_i\,D^{j+i}\big[f(x)\big] $$holds. Combining the above,
$$ \Phi_1(D)\big[\Phi_2(D)f(x)\big] = \Phi_2(D)\big[\Phi_1(D)f(x)\big] $$has been shown.
∎
Check with a concrete example. We check numerically in the concrete case $\Phi_1(D)=D^2+3$, $\Phi_2(D)=D^3-2D$, $f(x)=\sin2x+x^3$. Using Python (SymPy), we computed the result of first computing $\Phi_2(D)f(x)=D^3[f]-2D[f]$ and then applying $\Phi_1(D)$, and the result of first computing $\Phi_1(D)f(x)=D^2[f]+3f$ and then applying $\Phi_2(D)$; we expanded both and confirmed that they agree (see the verification script). This provides supporting evidence, from a concrete example, for the correctness of the general proof.
Exercise 38.7: Basic computation with the inverse operator $D^{-1}$
Solution
By Definition 38.1, $\dfrac1D[y]=\displaystyle\int y\,dx$ (with the constant of integration taken to be 0). Integrating the polynomial $3x^2-2x+1$ term by term gives
$$ \frac{1}{D}\big[3x^2-2x+1\big] = \int(3x^2-2x+1)\,dx = 3\cdot\frac{x^3}{3} - 2\cdot\frac{x^2}{2} + x = x^3-x^2+x $$(with the constant of integration taken to be 0). Hence the answer is $x^3-x^2+x$. To confirm it, we differentiate this answer with $D$, which gives
$$ D\big[x^3-x^2+x\big] = 3x^2-2x+1 $$and we indeed recover the original $3x^2-2x+1$. This computation also confirms that $D$ and $D^{-1}$ ($=1/D$) are inverse operations of each other.
← Back to Chapter 38, “The Operator Method”
Chapter 39 The Power Series Method and Frobenius Theory
Exercise 39.1: Radius of convergence of $\cos x$
Solution
The Maclaurin expansion of $\cos x$ is
$$ \cos x = \sum_{k=0}^{\infty}\frac{(-1)^k}{(2k)!}x^{2k} = 1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!}+\cdots $$Here all coefficients of odd degree are $0$, and the coefficient of the even-degree term $x^{2k}$ is $a_{2k}=\dfrac{(-1)^k}{(2k)!}$. In its basic form, d'Alembert's ratio test considers the ratio of the coefficients of adjacent degrees, but in order to follow only the coefficients that are not $0$, we regard $x^2$ as a single variable and compute the ratio of $a_{2k}$ to $a_{2k+2}$, the “adjacent coefficients that are not $0$.”
$$ \left|\frac{a_{2k}}{a_{2k+2}}\right| = \left|\frac{(-1)^k/(2k)!}{(-1)^{k+1}/(2k+2)!}\right| = \frac{(2k+2)!}{(2k)!} = (2k+1)(2k+2) $$(Since $(2k+2)!=(2k+2)(2k+1)\cdot(2k)!$, the factor $(2k)!$ cancels and gives this form.) As $k\to\infty$, this value
$$ \lim_{k\to\infty}(2k+1)(2k+2) = \infty $$grows without bound. Therefore the radius of convergence is $R=\infty$; that is, the Maclaurin expansion of $\cos x$ converges for every real number $x$ (in agreement with the conclusion stated in Section 39.2.1 of this chapter). (Verified with SymPy that $(2k+1)(2k+2)\to\infty$.)
Exercise 39.2: Series solution of $y''-xy'-y=0$
Solution
Writing the equation in the form of Eq. ①, we have $P(x)=-x,\ Q(x)=-1$, and both are polynomials (analytic in a special sense), hence analytic at every real number. In particular, $x=0$ is an ordinary point, so the solution has the form $y=\displaystyle\sum_{k=0}^{\infty}a_kx^k$. Differentiating term by term, we obtain
$$ y'=\sum_{k=1}^{\infty}ka_kx^{k-1},\qquad y''=\sum_{k=2}^{\infty}k(k-1)a_kx^{k-2} $$Shifting the index of the sum for $y''$ by $k\to k+2$ (replacing $k$ by $k+2$ in $k(k-1)a_kx^{k-2}$ makes the lower limit of the sum start from $k=0$ and turns $x^{k-2}$ into $x^k$), we can rewrite it as
$$ y''=\sum_{k=0}^{\infty}(k+2)(k+1)a_{k+2}x^{k} $$On the other hand, $xy'=x\displaystyle\sum_{k=1}^{\infty}ka_kx^{k-1}=\sum_{k=1}^{\infty}ka_kx^{k}$, and since the $k=0$ term of this sum is $0\cdot a_0x^0=0$, the value does not change if we rewrite the lower limit as $k=0$. Also, $y$ is already $\displaystyle\sum_{k=0}^{\infty}a_kx^k$ as it stands. Substituting these into the equation $y''-xy'-y=0$, we obtain
$$ \sum_{k=0}^{\infty}(k+2)(k+1)a_{k+2}x^{k} - \sum_{k=0}^{\infty}ka_kx^{k} - \sum_{k=0}^{\infty}a_kx^{k} = 0 \ \Longrightarrow\ \sum_{k=0}^{\infty}\bigl\{(k+2)(k+1)a_{k+2}-(k+1)a_k\bigr\}x^{k}=0 $$(we combined $-ka_k-a_k=-(k+1)a_k$). This is an identity in $x$, so the coefficient of each power must itself be $0$. Dividing both sides by $k+1\neq0$ (which is automatic since $k\ge0$), we obtain the recurrence relation
$$ a_{k+2}=\frac{a_k}{k+2} \qquad (k=0,1,2,\ldots) $$Taking $a_0=1,a_1=0$, all the odd-degree coefficients are $0$ because they start from $a_1=0$, and the even-degree coefficients are determined as
$$ a_2=\frac{a_0}{2}=\frac12,\qquad a_4=\frac{a_2}{4}=\frac18,\qquad a_6=\frac{a_4}{6}=\frac1{48} $$Therefore, the terms through $x^6$ are
$$ y=1+\frac{x^2}{2}+\frac{x^4}{8}+\frac{x^6}{48}+\cdots $$(Verified with SymPy, by substituting the series directly into the equation, that the recurrence relation $a_{k+2}=a_k/(k+2)$ holds and that the four terms above are correct.)
Exercise 39.3: Classifying a Bessel-type equation of half-integer order
Solution
In the form of Eq. ①, we have $P(x)=\dfrac1x,\ Q(x)=1-\dfrac1{4x^2}$. Since $P(x)=1/x$ is not defined at $x=0$ (the denominator is $0$), it is not analytic there, and $x=0$ is a singular point. So we examine $xP(x),x^2Q(x)$.
$$ xP(x)=x\cdot\frac1x=1,\qquad x^2Q(x)=x^2\left(1-\frac1{4x^2}\right)=x^2-\frac14 $$Here $xP(x)=1$ is a constant function and $x^2Q(x)=x^2-\dfrac14$ is a polynomial, and both are analytic at $x=0$. Therefore $x=0$ is a regular singular point. Reading off the coefficients of the Maclaurin expansions, we have $a_0=1$ (all the other $a_i=0$), and since $x^2Q(x)=-\dfrac14+0\cdot x+1\cdot x^2$, we have $b_0=-\dfrac14$. The indicial equation is
$$ \lambda(\lambda-1)+a_0\lambda+b_0=\lambda(\lambda-1)+\lambda-\frac14=\lambda^2-\frac14=0 $$and we obtain $\lambda=\pm\dfrac12$. (This equation in fact coincides with the case $n=1/2$ of Bessel's differential equation, which we study from the next chapter onward, and it is known that the half-integer exponents $\lambda=\pm1/2$ appear. We verified with SymPy that these are the roots of the indicial equation.)
Exercise 39.4: Complex roots of the indicial equation
Solution
For $P(x)=\dfrac1x,\ Q(x)=\dfrac1{x^2}$, we have $xP(x)=1,\ x^2Q(x)=1$ (both are constant functions), so $a_0=1,b_0=1$. Substituting into the indicial equation $\lambda^2+(a_0-1)\lambda+b_0=0$ (Section 39.4.1 of this chapter), we obtain
$$ \lambda^2+(a_0-1)\lambda+b_0=\lambda^2+(1-1)\lambda+1=\lambda^2+1=0 $$and solving this gives
$$ \lambda^2=-1 \ \Longrightarrow\ \lambda=\pm i $$(where $i$ is the imaginary unit). Thus the roots of the indicial equation are not necessarily real; they can also be complex numbers. In this case, we need to redefine complex powers by means of the logarithm, as in $x^{\pm i}=e^{\pm i\ln x}$ ($x\gt0$), and use Euler's formula to rewrite the solutions as real-valued fundamental solutions (the detailed treatment of this is based on the same idea as the procedure for complex roots of Euler's differential equation in Chapter 36—$x^{i\beta}=e^{i\beta\ln x}=\cos(\beta\ln x)+i\sin(\beta\ln x)$—but because it goes beyond the framework of Frobenius theory, we do not go into it any further in this book). (Verified with SymPy that the roots of $\lambda^2+1=0$ are $\pm i$.)
Exercise 39.5: Re-verifying the error in $\log(1+x)$
Solution
Let $f(x)=\log(1+x)$. We differentiate it successively.
$$ f'(x)=(1+x)^{-1},\qquad f''(x)=-(1+x)^{-2},\qquad f'''(x)=2(1+x)^{-3},\qquad f^{(4)}(x)=-6(1+x)^{-4} $$(Each time we differentiate $f'$, the exponent goes down by one and the corresponding coefficient is multiplied in front—$f''=-1\cdot(1+x)^{-2}$, $f'''=-1\cdot(-2)(1+x)^{-3}=2(1+x)^{-3}$, $f^{(4)}=2\cdot(-3)(1+x)^{-4}=-6(1+x)^{-4}$, and so on.) Substituting $x=0$, we get
$$ f^{(4)}(0)=-6\cdot1^{-4}=-6 $$By the formula for the coefficients of the Maclaurin expansion, $a_k=f^{(k)}(0)/k!$ (Section 39.2 of this chapter), we obtain
$$ a_4=\frac{f^{(4)}(0)}{4!}=\frac{-6}{24}=-\frac14 $$Therefore the correct fourth term (the $x^4$ term) of the expansion of $\log(1+x)$ is $a_4x^4=-\dfrac14x^4$, and as stated in the Caution box (box warn) in Section 39.2.1 of this chapter, we have confirmed, also by direct computation from the fourth derivative, that the “$+\dfrac{x^4}4$” in the original notes is a sign error made in writing. (Verified with SymPy that $f^{(4)}(0)=-6$.)
Exercise 39.6: What if $\lambda_1-\lambda_2$ were not an integer?
Solution
Keeping $P(x)=\dfrac3x$ as it is and changing the other coefficient to $Q(x)=-\dfrac2{x^2}$, we get $xP(x)=3$ (unchanged) and $x^2Q(x)=x^2\left(-\dfrac2{x^2}\right)=-2$, so $a_0=3,\ b_0=-2$. The indicial equation is
$$ \lambda^2+(a_0-1)\lambda+b_0=\lambda^2+2\lambda-2=0 $$and by the quadratic formula we obtain
$$ \lambda=\frac{-2\pm\sqrt{4+8}}{2}=\frac{-2\pm2\sqrt3}{2}=-1\pm\sqrt3 $$That is, $\lambda_1=-1+\sqrt3\approx0.73,\ \lambda_2=-1-\sqrt3\approx-2.73$, and the difference is
$$ \lambda_1-\lambda_2=2\sqrt3\approx3.46 $$which is not an integer. Therefore this falls under case (i) of Theorem 39.1 of this chapter. In Example 39.8, because $\lambda_1-\lambda_2=4$ (an integer), the recurrence relation built from the smaller root $\lambda_2$ ran into “resonance” at $k=4$ (the expression in the braces became exactly $0$), so we could not find $y_2$ as a plain series, and we had to rely on the method for the case where one fundamental solution is already known ($y_2=u(x)y_1$, reduction of order).
However, when the difference is not an integer, as in the present case, this resonance never occurs. This is because the coefficient $\{(\lambda_2+k)(\lambda_2+k-1)+a_0(\lambda_2+k)+b_0\}$ of the recurrence relation built from $\lambda_2$ becomes $0$ only when $\lambda_2+k$ coincides with the other root $\lambda_1$ of the indicial equation, that is, only when $k=\lambda_1-\lambda_2$. In the present case, $\lambda_1-\lambda_2=2\sqrt3$ is not an integer, so for no positive integer $k$ can $\lambda_2+k=\lambda_1$ ever hold. Therefore, whichever of $\lambda_1,\lambda_2$ we start from, the recurrence relation can be solved all the way without a hitch, and we obtain the two independent Frobenius series
$$ y_1=x^{\lambda_1}\sum_{k=0}^{\infty}a_kx^k=x^{-1+\sqrt3},\qquad y_2=x^{\lambda_2}\sum_{k=0}^{\infty}b_kx^k=x^{-1-\sqrt3} $$as they stand (the present equation is of Euler type, with all coefficients other than $a_0,b_0$ equal to $0$, so, just as in Example 39.5, the series terminates with its leading term alone, and $y_1=x^{-1+\sqrt3},\ y_2=x^{-1-\sqrt3}$ themselves serve as fundamental solutions). In other words, the extra effort of “relying on reduction of order” that was needed in Example 39.8 is unnecessary, and Theorem 39.1(i) of Section 39.4 can be applied as it stands. (Verified with SymPy that the coefficient of the recurrence relation on the $\lambda=-1-\sqrt3$ side does not become $0$ for any of $k=1,\ldots,5$; that is, resonance does not occur.)
← Back to Chapter 39, “The Power Series Method and Frobenius Theory”
Chapter 40 Legendre's Differential Equation and Legendre Polynomials
Exercise 40.1: Deriving $P_2(x)$ by solving the case $n=2$ with the series method
Solution
Recall the recurrence relation for the coefficients of Legendre's differential equation, written in a form that works for both even and odd $k$:
$$ a_{k+2}=-\frac{(n-k)(n+k+1)}{(k+1)(k+2)}a_k\qquad(k=0,1,2,\ldots) $$Substitute $n=2$ and $a_0=1$, and compute in the order $k=0,2,4,\ldots$.
$k=0$: $a_2=-\dfrac{(2-0)(2+1)}{1\cdot2}a_0=-\dfrac{2\cdot3}{2}\cdot1=-3$.
$k=2$: $a_4=-\dfrac{(2-2)(2+3)}{3\cdot4}a_2=-\dfrac{0\cdot5}{12}\cdot(-3)=0$ (this is the moment when the numerator factor $(n-k)=(2-2)=0$ appears). Therefore $a_4=a_6=\cdots=0$ as well; all the later coefficients likewise become $0$.
It follows that $U_2(x)=a_0+a_2x^2+a_4x^4+\cdots=1-3x^2$ (a polynomial of degree 2 that ends at $x^2$).
Next, following the definition, we normalize by the value at $x=1$.
$$ U_2(1)=1-3\cdot1^2=1-3=-2 $$Therefore we obtain
$$ P_2(x)=\frac{U_2(x)}{U_2(1)}=\frac{1-3x^2}{-2}=\frac{3x^2-1}{2}=\frac12(3x^2-1) $$Indeed, $P_2(x)=\dfrac12(3x^2-1)$, as the exercise states. (That $P_2(1)=\frac12(3-1)=1$ is also evidence that the normalization was carried out correctly. We recomputed $U_2(x)$ from the recurrence relation with SymPy and verified that the results agree.)
Exercise 40.2: Computing $P_4(x)$ from Rodrigues's formula
Solution
Recall Rodrigues's formula:
$$ P_n(x)=\frac{1}{2^n n!}\diff{^n}{x^n}(x^2-1)^n $$For $n=4$, first expand $(x^2-1)^4$ with the binomial theorem (using $\binom40=1,\binom41=4,\binom42=6,\binom43=4,\binom44=1$).
$$ (x^2-1)^4=x^8-4x^6+6x^4-4x^2+1 $$Differentiate this four times in succession, one differentiation at a time. It suffices to differentiate each term according to $x^m\to mx^{m-1}$ (the power rule for differentiation).
First differentiation:
$$ \diff{}{x}(x^2-1)^4=8x^7-24x^5+24x^3-8x $$Second differentiation (we differentiate the result of the first differentiation once more, term by term):
$$ \diff{^2}{x^2}(x^2-1)^4=56x^6-120x^4+72x^2-8 $$Third differentiation:
$$ \diff{^3}{x^3}(x^2-1)^4=336x^5-480x^3+144x $$Fourth differentiation:
$$ \diff{^4}{x^4}(x^2-1)^4=1680x^4-1440x^2+144 $$In the computation so far, the coefficient of each term has always been just multiplied by the “current degree” while the degree is “lowered by one,” and this is repeated four times (for example, the $x^8$ term goes $8x^7\to56x^6\to336x^5\to1680x^4$, and its coefficient changes as $8\to8\cdot7=56\to56\cdot6=336\to336\cdot5=1680$).
Finally, divide by $2^4\cdot4!=16\cdot24=384$.
$$ P_4(x)=\frac{1680x^4-1440x^2+144}{384} $$Reduce the fractions one term at a time. The greatest common divisor of $1680$ and $384$ is $48$, so $1680/384=35/8$. The greatest common divisor of $1440$ and $384$ is $96$, so $1440/384=15/4=30/8$. The greatest common divisor of $144$ and $384$ is $48$, so $144/384=3/8$. Therefore
$$ P_4(x)=\frac{35}{8}x^4-\frac{30}{8}x^2+\frac{3}{8}=\frac18(35x^4-30x^2+3) $$and this indeed agrees exactly with $P_4(x)=\dfrac18(35x^4-30x^2+3)$, which we obtained in Example 40.7 by normalizing $U_4(x)$. We have confirmed that two completely different methods of computation (the series method with normalization, and Rodrigues's formula) arrive at the same answer. (We computed the fourth derivative of $(x^2-1)^4$ directly with SymPy and verified that the results agree.)
Exercise 40.3: Checking that $V_7(x)$ terminates as a polynomial for $n=7$ (odd)
Solution
Substitute $n=7$ and $a_1=1$ into the recurrence relation $a_{k+2}=-\dfrac{(n-k)(n+k+1)}{(k+1)(k+2)}a_k$ in the order $k=1,3,5,7$.
$k=1$: $a_3=-\dfrac{(7-1)(7+2)}{2\cdot3}a_1=-\dfrac{6\cdot9}{6}\cdot1=-9$.
$k=3$: $a_5=-\dfrac{(7-3)(7+4)}{4\cdot5}a_3=-\dfrac{4\cdot11}{20}\cdot(-9)=\dfrac{44}{20}\cdot9=\dfrac{11}{5}\cdot9=\dfrac{99}{5}$.
$k=5$: $a_7=-\dfrac{(7-5)(7+6)}{6\cdot7}a_5=-\dfrac{2\cdot13}{42}\cdot\dfrac{99}{5}=-\dfrac{13}{21}\cdot\dfrac{99}{5}=-\dfrac{1287}{105}=-\dfrac{429}{35}$ (we reduced $1287$ and $105$ by their greatest common divisor $3$).
$k=7$: $a_9=-\dfrac{(7-7)(7+8)}{8\cdot9}a_7=-\dfrac{0\cdot15}{72}a_7=0$. We have arrived exactly at $k=n=7$, and the numerator factor $(n-k)=(7-7)=0$ appears, so $a_9=0$. Since the recurrence relation merely builds $a_{k+2}$ as a constant multiple of $a_k$, the subsequent coefficients $a_{11},a_{13},\ldots$ all remain $0$ as well, being constant multiples of $a_9=0$.
It follows that
$$ V_7(x)=x-9x^3+\frac{99}{5}x^5-\frac{429}{35}x^7 $$is a polynomial of degree 7 that ends at the $x^7$ term. This is indeed the result that Theorem 40.4 asserts: when $n=7$ (odd), $V_n(x)$ becomes a polynomial, while $U_n(x)$ remains an infinite series. (Since $k=n=7$ appeared in the odd-indexed sequence $k=1,3,5,7,\ldots$, it is the odd-indexed sequence, that is, the $V_n(x)$ side, that stops.) (We recomputed the coefficients from the recurrence relation with SymPy, and we also substituted $V_7(x)$ directly into Legendre's differential equation $(1-x^2)y''-2xy'+56y=0$ ($n(n+1)=7\cdot8=56$) and verified that it becomes identically $0$.)
Exercise 40.4: Checking orthogonality in a concrete case ($m=1$, $n=2$)
Solution
Use $P_1(x)=x$ and $P_2(x)=\dfrac12(3x^2-1)$; form the product first, and then integrate.
$$ P_1(x)P_2(x)=x\cdot\frac12(3x^2-1)=\frac12(3x^3-x) $$Integrate this over the interval $[-1,1]$. Applying the integration formula for power functions, $\displaystyle\int x^m\,dx=\dfrac{x^{m+1}}{m+1}$ ($m\neq-1$), to each term, we get
$$ \int_{-1}^{1}P_1(x)P_2(x)\,dx=\frac12\int_{-1}^{1}(3x^3-x)\,dx=\frac12\left[\frac{3x^4}{4}-\frac{x^2}{2}\right]_{-1}^{1} $$Substitute $x=1$ and $x=-1$ into the brackets. Since $x^4$ and $x^2$ are both even powers, they take the same value at $x=1$ and at $x=-1$.
$$ \left.\left(\frac{3x^4}{4}-\frac{x^2}{2}\right)\right|_{x=1}=\frac34-\frac12=\frac14,\qquad \left.\left(\frac{3x^4}{4}-\frac{x^2}{2}\right)\right|_{x=-1}=\frac34-\frac12=\frac14 $$Therefore
$$ \int_{-1}^{1}P_1(x)P_2(x)\,dx=\frac12\left(\frac14-\frac14\right)=\frac12\cdot0=0 $$and we have indeed verified that the integral equals $0$, as Theorem 40.6 states. (Seen from another viewpoint, $P_1(x)P_2(x)=\frac12(3x^3-x)$ consists only of odd-degree terms and is therefore an odd function (a function satisfying $f(-x)=-f(x)$), and the integral of an odd function over a symmetric interval such as $[-1,1]$ is always $0$, a fact learned in high school; from this fact the same conclusion follows immediately. We integrated directly with SymPy and verified that the results agree.)
Exercise 40.5: Checking for yourself the error on p. 62 of the source notes (the numerator of $U_n(x)$)
Solution
Take the form of the recurrence relation before it has been factored,
$$ a_{k+2}=\frac{k(k+1)-n(n+1)}{(k+1)(k+2)}a_k $$and substitute $k=0$ into it, keeping $n$ as a symbol rather than substituting a number for it.
$$ a_2=\frac{0\cdot1-n(n+1)}{1\cdot2}a_0=\frac{-n(n+1)}{2}a_0=-\frac{n(n+1)}{2!}a_0 $$Therefore the coefficient of $x^2$ in $U_n(x)=a_0+a_2x^2+\cdots$ (the ratio when $a_0$ is taken to be 1) is $-\dfrac{n(n+1)}{2!}$, and its numerator is indeed $n(n+1)$. The statement “$n(n-1)$” on p. 62 of the source notes disagrees with this computation, so we see that it is an error.
As a precaution, let us also find $a_4/a_0$ (the coefficient of $x^4$ in $U_n(x)$) in the same way, by substituting $k=2$ and again leaving the result in symbolic form.
$$ a_4=\frac{2\cdot3-n(n+1)}{3\cdot4}a_2=\frac{6-n(n+1)}{12}a_2 $$Here the numerator factors as $6-n(n+1)=-(n^2+n-6)=-(n-2)(n+3)$ (the two roots of $n^2+n-6$ are $n=2,-3$, so it factors as $(n-2)(n+3)$). Therefore
$$ a_4=\frac{-(n-2)(n+3)}{12}a_2=\frac{-(n-2)(n+3)}{12}\cdot\left(-\frac{n(n+1)}{2}a_0\right)=\frac{n(n-2)(n+1)(n+3)}{24}a_0=\frac{n(n-2)(n+1)(n+3)}{4!}a_0 $$and this too agrees exactly with the numerator $n(n-2)(n+1)(n+3)$ of the coefficient of $x^4$ in $U_n(x)$, the expression used in Sections 40.2.1 and 40.3 of this chapter. Thus the computations of $a_2,a_4$ alike show, together with the concrete derivation, that the numerators of the coefficients of $U_n(x)$ are $n(n+1)$ (and $n(n-2)(n+1)(n+3)$), and not “$n(n-1)$” as on p. 62 of the source notes. (We checked the computation with SymPy by substituting with $n$ left as a symbolic variable, and verified that the results agree.)
Exercise 40.6: Checking that $P_n(1)=1$ holds for all $n$
Solution
Explanation from the definition. In Definition 40.3, we defined $P_n(x)=\dfrac{U_n(x)}{U_n(1)}$ when $n$ is even and $P_n(x)=\dfrac{V_n(x)}{V_n(1)}$ when $n$ is odd. In either case, when we substitute $x=1$, the numerator and the denominator take exactly the same value. For example, when $n$ is even, we get
$$ P_n(1)=\frac{U_n(1)}{U_n(1)}=1 $$(Since $U_n(1)\neq0$, this division always makes sense.) When $n$ is odd, $V_n(1)/V_n(1)=1$ in exactly the same way. In other words, $P_n(1)=1$ is a fact that is obvious without any computation, from the very construction in Definition 40.3, in which $P_n(x)$ was defined “by normalizing through division so that the value at $x=1$ is exactly $1$.”
Explanation from a by-product of the proof of Rodrigues's formula. In Steps 2 and 3 of the proof of Formula 40.1, letting $w(x)=v^{(n)}(x)=\diff{^n}{x^n}(x^2-1)^n$, we showed that there exists a constant $c_n$ such that
$$ w(x)=c_n\,P_n(x) $$and that the direct computation in Step 3 using Leibniz's rule gave the result
$$ w(1)=n!\,2^n $$and hence that $c_n=n!\,2^n$. Combining these, we obtain the relation
$$ w(1)=c_n\,P_n(1)\quad\Longrightarrow\quad n!\,2^n=n!\,2^n\cdot P_n(1) $$Here $n!\,2^n\neq0$ (both $n!$ and $2^n$ are positive real numbers and can never be $0$), so we can divide both sides by $n!\,2^n$, and we get
$$ P_n(1)=\frac{n!\,2^n}{n!\,2^n}=1 $$Along this route as well, the same conclusion $P_n(1)=1$ is reached. The explanation from the definition rests on the algebraically trivial reason “of course, because we defined it that way,” whereas the explanation from Rodrigues's formula is a check that includes the nontriviality of the agreement: even by passing through a completely different method of computation (differentiation, and evaluation by Leibniz's rule at the endpoint $x=1$), we arrive at the same value $1$. (With SymPy we computed $w(1)/(2^n n!)$ for $n=0,1,\ldots,8$ and verified that all of them equal $1$.)
← Back to Chapter 40, “Legendre's Differential Equation and Legendre Polynomials”
Chapter 41 Special Functions — Bessel Functions and Laguerre Polynomials
Exercise 41.1: The coefficients $a_2,a_4$ for $\alpha=3$
Solution
The coefficients on the $\lambda=\alpha$ side of Bessel's differential equation obey the recurrence relation
$$ a_{k+2}=\frac{-a_k}{(k+2)(k+2+2\alpha)} $$Substituting $\alpha=3$ gives $a_{k+2}=\dfrac{-a_k}{(k+2)(k+8)}$.
$k=0$: since $(0+2)(0+8)=16$, we have
$$ a_2=-\frac{a_0}{16} $$$k=2$: since $(2+2)(2+8)=4\times10=40$, we obtain
$$ a_4=-\frac{a_2}{40}=-\frac{1}{40}\times\left(-\frac{a_0}{16}\right)=\frac{a_0}{640} $$On the other hand, substituting $\alpha=3$ into the general formula $a_{2n}=\dfrac{(-1)^n}{n!\,2^{2n}(\alpha+1)(\alpha+2)\cdots(\alpha+n)}a_0$ gives
$n=1$: $a_2=\dfrac{-1}{1!\times4\times4}a_0=-\dfrac{a_0}{16}$
$n=2$: $a_4=\dfrac{1}{2!\times16\times(4\times5)}a_0=\dfrac{1}{2\times16\times20}a_0=\dfrac{a_0}{640}$
Both results agree exactly with those obtained by following the recurrence relation directly (verified with SymPy).
Exercise 41.2: Finding $\Gamma(9/2)$ from $\Gamma(1/2)=\sqrt\pi$
Solution
Use the recurrence relation $\Gamma(z+1)=z\Gamma(z)$ of the gamma function four times, for $z=1/2,3/2,5/2,7/2$ in this order.
$$ \Gamma\!\left(\frac32\right)=\frac12\Gamma\!\left(\frac12\right)=\frac{\sqrt\pi}{2} $$ $$ \Gamma\!\left(\frac52\right)=\frac32\Gamma\!\left(\frac32\right)=\frac32\times\frac{\sqrt\pi}{2}=\frac{3\sqrt\pi}{4} $$ $$ \Gamma\!\left(\frac72\right)=\frac52\Gamma\!\left(\frac52\right)=\frac52\times\frac{3\sqrt\pi}{4}=\frac{15\sqrt\pi}{8} $$ $$ \Gamma\!\left(\frac92\right)=\frac72\Gamma\!\left(\frac72\right)=\frac72\times\frac{15\sqrt\pi}{8}=\frac{105\sqrt\pi}{16} $$Therefore $\Gamma(9/2)=\dfrac{105}{16}\sqrt\pi$ (we have verified that this agrees with the value of $\Gamma(9/2)$ computed directly with SymPy).
Exercise 41.3: Checking linear dependence for $n=3$ (odd)
Solution
For $J_3(x)=\displaystyle\sum_{k=0}^{\infty}\dfrac{(-1)^k}{k!\,(3+k)!}\left(\dfrac x2\right)^{2k+3}$, the first two terms ($k=0,1$) are
$$ k=0:\ \frac{1}{0!\,3!}\left(\frac x2\right)^3=\frac{1}{6}\cdot\frac{x^3}{8}=\frac{x^3}{48} $$ $$ k=1:\ \frac{-1}{1!\,4!}\left(\frac x2\right)^5=-\frac{1}{24}\cdot\frac{x^5}{32}=-\frac{x^5}{768} $$On the other hand, substituting $n=3$ into the relation $J_{-n}(x)=(-1)^nJ_n(x)$, which holds in general, and noting that $(-1)^3=-1$, we obtain
$$ J_{-3}(x)=-J_3(x) $$This is because, as a result of the reindexing carried out in the main text (we start the sum for $J_{-n}(x)$ at $k=n$, replace the index by $k=n+\ell$, and separate the sign as $(-1)^{n+\ell}=(-1)^n(-1)^\ell$), the sign $(-1)^n=-1$ comes out in front when $n=3$ (odd). For $n=2$ (Example 41.4) we have $(-1)^2=+1$, so $J_{-2}=J_2$ and no sign appeared, whereas for $n=3$ the sign becomes negative; this is the difference that arises. Indeed, comparing the series expansion of besselj(-3,x) (SymPy's standard Bessel function) with that of $-J_3(x)$ up to the 10th term, we confirmed that they agree completely.
Exercise 41.4: Checking that the radius of convergence is $\infty$ even when the order is negative
Solution
Substituting $\alpha=-\dfrac13$ into the expression $(n+1)(\alpha+n+1)$ in the main text gives $(n+1)\left(n+\dfrac23\right)$. Substituting $n=5,10,50$ into this, we obtain
$$ n=5:\ (5+1)\left(5+\frac23\right)=6\times\frac{17}{3}=34 $$ $$ n=10:\ (10+1)\left(10+\frac23\right)=11\times\frac{32}{3}=\frac{352}{3}\approx117.3 $$ $$ n=50:\ (50+1)\left(50+\frac23\right)=51\times\frac{152}{3}=2584 $$The value grows larger and larger as $n$ increases ($34\to117.3\to2584$). In fact, $(n+1)(\alpha+n+1)$ grows on the order of $n^2$ as $n\to\infty$, so, regardless of the sign or size of $\alpha$, the limit is always $+\infty$. Therefore the radius of convergence is $R=\infty$ for $\alpha=-1/3$ as well.
Exercise 41.5: Finding the Laguerre polynomial $L_4(x)$
Solution
Use the recurrence relation $a_{k+1}=-\dfrac{4-k}{(k+1)^2}a_k$ ($m=4$, $a_0=1$) successively.
$$ a_1=-\frac{4-0}{1^2}a_0=-4,\qquad a_2=-\frac{4-1}{2^2}a_1=-\frac34\times(-4)=3 $$ $$ a_3=-\frac{4-2}{3^2}a_2=-\frac29\times3=-\frac23,\qquad a_4=-\frac{4-3}{4^2}a_3=-\frac{1}{16}\times\left(-\frac23\right)=\frac{1}{24} $$(Since $a_5=-\dfrac{4-4}{5^2}a_4=0$, the recurrence stops here.) Hence
$$ L_4(x)=1-4x+3x^2-\frac23x^3+\frac{1}{24}x^4 $$Next we evaluate Rodrigues's formula $\widehat L_4(x)=e^x\dfrac{d^4}{dx^4}(x^4e^{-x})$. Using the rule for differentiating a product (Leibniz's rule), we obtain
$$ \widehat L_4(x)=x^4-16x^3+72x^2-96x+24 $$(this was verified by computing $\dfrac{d^4}{dx^4}(x^4e^{-x})$ with SymPy and multiplying by $e^x$). Dividing this by $4!=24$ gives
$$ \frac{\widehat L_4(x)}{24}=\frac{x^4}{24}-\frac{16}{24}x^3+\frac{72}{24}x^2-\frac{96}{24}x+1 =\frac{1}{24}x^4-\frac23x^3+3x^2-4x+1 $$which is exactly the same as the $L_4(x)$ found above (with the terms listed in reverse order). That is, we have confirmed that $\widehat L_4(x)=4!\,L_4(x)$ (the exact agreement of the coefficients was verified with SymPy).
Exercise 41.6: Finding the associated Laguerre polynomial $L_2^1(x)$
Solution
First we find $\widehat L_2(x)$. $L_2(x)$ is obtained from the defining formula $L_m(x)=\displaystyle\sum_{k=0}^{m}\dfrac{(-1)^km!}{(k!)^2(m-k)!}x^k$ by substituting $m=2$:
$$ L_2(x)=\frac{2!}{(0!)^2\,2!}-\frac{2!}{(1!)^2\,1!}x+\frac{2!}{(2!)^2\,0!}x^2=1-2x+\frac12x^2 $$Therefore $\widehat L_2(x)=2!\,L_2(x)=2-4x+x^2=x^2-4x+2$. Differentiating this once, we obtain
$$ L_2^1(x)=\frac{d}{dx}\widehat L_2(x)=\frac{d}{dx}(x^2-4x+2)=2x-4 $$Next, we check this result using the series representation $L_m^N(x)=\displaystyle\sum_{k=N}^{m}\dfrac{(-1)^k(m!)^2}{k!\,(m-k)!\,(k-N)!}x^{k-N}$ of the associated Laguerre polynomial, substituting $m=2,N=1$ directly. The sum consists of the two terms $k=1,2$.
$$ k=1:\ \frac{(-1)^1(2!)^2}{1!\,1!\,0!}x^0=-4,\qquad k=2:\ \frac{(-1)^2(2!)^2}{2!\,0!\,1!}x^1=2x $$Adding them up gives $L_2^1(x)=2x-4$, which agrees exactly with the result found earlier by differentiation (verified with SymPy).
← Back to Chapter 41, “Special Functions — Bessel Functions and Laguerre Polynomials”
Chapter 42 Introduction to Partial Differential Equations and Lagrange's First-Order Partial Differential Equation
Exercise 42.1: The simplest Lagrange partial differential equation
Solution
Lagrange's partial differential equation $\pdiff zx-\pdiff zy=0$ is the case $P=1,Q=-1,R=0$. The characteristic equations are
$$ \frac{dx}{1}=\frac{dy}{-1}=\frac{dz}{0} $$Integrating the first two, $dx=-dy$ (each side can be integrated as it stands), we obtain $x=-y+C_1'$, that is,
$$ x+y=C_1 $$which is a first integral. On the other hand, the last fraction $dz/0$ was to be read according to the convention that “when the denominator of a ratio is $0$, the corresponding variable ($z$) does not change.” That is,
$$ z=C_2 $$Imposing the relation $\psi=f(\varphi)$ ($f$ is an arbitrary function) on the two independent first integrals $\varphi=x+y$ and $\psi=z$, we obtain
$$ z=f(x+y) $$This is the general solution.
Cross-check. Differentiating $z=f(x+y)$ partially with the chain rule gives $\pdiff zx=f'(x+y)$ and $\pdiff zy=f'(x+y)$, so
$$ \pdiff zx-\pdiff zy=f'(x+y)-f'(x+y)=0 $$and the original equation is indeed satisfied (verified with SymPy).
Interpretation as a traveling wave. If we regard $y$ as playing the role of the time $t$ in Section 42.5, the original equation $\pdiff zx-\pdiff zy=0$ can be written as $\pdiff zy=\pdiff zx$, that is, $\pdiff zt=1\cdot\pdiff zx$. This is exactly the equation $\pdiff ut=v_0\pdiff ux$ for the leftward-traveling wave that we saw in Section 42.5, in the case $v_0=1$. Indeed, the value of the general solution $z=f(x+y)$ does not change under the condition $x+y=(\text{constant})$, so when $y$ (= time) increases, $x$ must decrease by the same amount in order to keep the value constant—that is, this solution represents a wave traveling in the negative direction of the $x$-axis with speed $1$.
Exercise 42.2: A Lagrange partial differential equation with coefficients containing $z$
Solution
Lagrange's partial differential equation $xz\pdiff zx-yz\pdiff zy=x^2-y^2$ is the case $P=xz,Q=-yz,R=x^2-y^2$. The characteristic equations are
$$ \frac{dx}{xz}=\frac{dy}{-yz}=\frac{dz}{x^2-y^2} $$First, from the first two fractions, canceling the common factor $z$ gives $\dfrac{dx}{x}=\dfrac{dy}{-y}$ (assuming $z\ne0$). This is of separable form, and integrating gives $\ln x=-\ln y+C_1'$, that is,
$$ xy=C_1 $$which is a first integral (this is the same computation as in Illustration 42.1).
To construct another first integral, we use the method of multipliers explained in the main text (at the end of Section 42.3), because the variables cannot be separated by pairing up the three fractions directly. Using the property of proportions, “if $\dfrac ab=\dfrac cd=\dfrac ef$, then $\dfrac{\lambda a+\mu c+\nu e}{\lambda b+\mu d+\nu f}$ is also equal to the same value for any $\lambda,\mu,\nu$,” we choose $\lambda=x,\mu=y,\nu=z$ (the variables themselves) as the multipliers. Then the denominator of the new fraction is
$$ x\cdot(xz)+y\cdot(-yz)+z\cdot(x^2-y^2)=x^2z-y^2z+x^2z-y^2z=2z(x^2-y^2) $$and the numerator becomes $x\,dx+y\,dy+z\,dz$. Setting this new fraction equal to the original third fraction $\dfrac{dz}{x^2-y^2}$, we get
$$ \frac{x\,dx+y\,dy+z\,dz}{2z(x^2-y^2)}=\frac{dz}{x^2-y^2} $$Multiplying both sides by $2z(x^2-y^2)$ (assuming $x^2-y^2\ne0$),
$$ x\,dx+y\,dy+z\,dz=2z\,dz\qquad\therefore\ x\,dx+y\,dy=z\,dz $$This is an equation of separable form. Integrating both sides (with $\int x\,dx=x^2/2$, $\int y\,dy=y^2/2$, $\int z\,dz=z^2/2$),
$$ \frac{x^2}{2}+\frac{y^2}{2}=\frac{z^2}{2}+K\qquad\therefore\ x^2+y^2-z^2=C_2\quad(C_2=2K) $$we obtain the second first integral. Imposing on $C_1=xy$ and $C_2=x^2+y^2-z^2$ the relation $C_2=\varphi(C_1)$ ($\varphi$ is an arbitrary function), the general solution is given as
$$ x^2+y^2-z^2=\varphi(xy) $$in implicit form (solving explicitly for $z$ gives $z=\pm\sqrt{x^2+y^2-\varphi(xy)}$, but because an ambiguity of sign remains, it is natural to leave it in implicit form).
Cross-check. Regarding the relation as the implicit function $G(x,y,z)=x^2+y^2-z^2-\varphi(xy)=0$ and using the implicit function theorem $\pdiff zx=-\dfrac{\partial G/\partial x}{\partial G/\partial z}$, $\pdiff zy=-\dfrac{\partial G/\partial y}{\partial G/\partial z}$ (Chapter 6), one can confirm that $xz\pdiff zx-yz\pdiff zy-(x^2-y^2)$ is identically $0$, regardless of the form of $\varphi$ (verified with SymPy).
Exercise 42.3: An exact differential equation (two variables)
Solution
Here $P=y^2+2xy$ and $Q=x^2+2xy$. Checking the exactness condition,
$$ \pdiff Py=2y+2x,\qquad \pdiff Qx=2x+2y $$the two agree, so this is an exact differential equation. To find the general solution, we first find $f$ satisfying $\pdiff fx=P$ by integrating with respect to $x$ ($y$ is treated as a constant).
$$ f=\int(y^2+2xy)\,dx=xy^2+x^2y+h(y) $$(the constant of integration may be taken to be a function $h(y)$ of $y$). Next, we determine $h(y)$ from the condition $\pdiff fy=Q$.
$$ \pdiff fy=2xy+x^2+h'(y)=Q=x^2+2xy $$Comparing, we get $h'(y)=0$, that is, $h$ is a constant (it is eventually absorbed into $C$, so it can be omitted). Therefore
$$ f(x,y)=xy^2+x^2y=xy(x+y) $$and so we obtain
$$ xy(x+y)=C $$This is the general solution.
Cross-check. We get $\pdiff fx=2xy+y^2=P$ and $\pdiff fy=x^2+2xy=Q$, which indeed agree with the original $P,Q$ (verified with SymPy).
Exercise 42.4: Superposition of two traveling waves
Solution
We have $u(x,t)=A\sin(kx-\omega t)+B\sin(kx+\omega t)$. The first term $A\sin(kx-\omega t)$ is a wave traveling to the right with speed $v_0=\omega/k$, and (by the discussion in Section 42.5.3 of this chapter) it satisfies $\pdiff{^2}{t^2}\bigl[A\sin(kx-\omega t)\bigr]=v_0^2\pdiff{^2}{x^2}\bigl[A\sin(kx-\omega t)\bigr]$. The second term $B\sin(kx+\omega t)$ likewise satisfies the same wave equation, as a wave traveling to the left with speed $v_0=\omega/k$. Since partial differentiation is a linear operation (the derivative of a sum is the sum of the derivatives), for the sum $u$ of the two terms, too, the same wave equation
$$ \pdiff{^2u}{t^2}=\left(\frac\omega k\right)^2\pdiff{^2u}{x^2} $$holds.
Direct check. To be safe, let us verify this by differentiating directly.
$$ \pdiff ut=-A\omega\cos(kx-\omega t)+B\omega\cos(kx+\omega t) $$ $$ \pdiff{^2u}{t^2}=-A\omega^2\sin(kx-\omega t)-B\omega^2\sin(kx+\omega t) $$ $$ \pdiff ux=Ak\cos(kx-\omega t)+Bk\cos(kx+\omega t) $$ $$ \pdiff{^2u}{x^2}=-Ak^2\sin(kx-\omega t)-Bk^2\sin(kx+\omega t) $$Therefore
$$ \left(\frac\omega k\right)^2\pdiff{^2u}{x^2}=\frac{\omega^2}{k^2}\Bigl[-Ak^2\sin(kx-\omega t)-Bk^2\sin(kx+\omega t)\Bigr]=-A\omega^2\sin(kx-\omega t)-B\omega^2\sin(kx+\omega t)=\pdiff{^2u}{t^2} $$and the wave equation is indeed satisfied (verified with SymPy).
Exercise 42.5: Generalization to three variables
Solution
The equation $x_1\pdiff u{x_1}+x_2\pdiff u{x_2}+x_3\pdiff u{x_3}=0$ is the case of Definition 42.2 with $n=3$, $f_1=x_1,f_2=x_2,f_3=x_3$, and $g=0$. The characteristic equations are
$$ \frac{dx_1}{x_1}=\frac{dx_2}{x_2}=\frac{dx_3}{x_3} $$Integrating the first two, $\dfrac{dx_1}{x_1}=\dfrac{dx_2}{x_2}$, gives $\ln x_1=\ln x_2+C_1'$, that is,
$$ \frac{x_2}{x_1}=e^{-C_1'}=C_1 $$(since $x_1,x_2,x_3\gt0$, absolute-value signs are unnecessary). Similarly, from the first and the last, $\dfrac{dx_1}{x_1}=\dfrac{dx_3}{x_3}$, we get
$$ \frac{x_3}{x_1}=C_2 $$as two independent first integrals (since $n=3$, Theorem 42.2 requires $n=3$ first integrals, but when $g=0$ the fraction $du/0$ gives the third first integral $u=C_3$, which says “$u$ does not change”). Imposing on these three first integrals $C_1=x_2/x_1$, $C_2=x_3/x_1$, $C_3=u$ a relation $C_3=\Phi(C_1,C_2)$ through an arbitrary function $\Phi$, the general solution takes the form
$$ u=\Phi\!\left(\frac{x_2}{x_1},\frac{x_3}{x_1}\right) $$(here $\Phi$ is an arbitrary function of two variables).
Cross-check. If we use the chain rule (the multivariable version of the formula for differentiating a composite function) to differentiate $u=\Phi(x_2/x_1,x_3/x_1)$ partially with respect to each of $x_1,x_2,x_3$ and substitute the results into $x_1u_{x_1}+x_2u_{x_2}+x_3u_{x_3}$, we can confirm that it becomes identically $0$, regardless of the form of $\Phi$ and its partial derivatives (verified with SymPy). For example, even if we choose $\Phi(s,t)=s^2+t$ concretely, we can check that $u=(x_2/x_1)^2+x_3/x_1$ satisfies the equation.
Exercise 42.6: A simple example with a boundary condition
Solution
We integrate $\pdiff ux=2y$ with respect to $x$, regarding $y$ as a constant.
$$ u=\int2y\,dx=2xy+f(y) $$(the constant of integration may be any function of $y$, so we denoted it by an arbitrary function $f(y)$). This is the general solution. Substituting the boundary condition $u(0,y)=y^2$,
$$ u(0,y)=2\cdot0\cdot y+f(y)=f(y)=y^2 $$we find that $f(y)=y^2$. Therefore,
$$ u(x,y)=2xy+y^2 $$is the particular solution satisfying the boundary condition.
Cross-check. We get $\pdiff ux=2y$, so the equation is satisfied. Also $u(0,y)=2\cdot0\cdot y+y^2=y^2$, so the boundary condition is satisfied as well (verified with SymPy).
Chapter 43 The Wave Equation and the Heat Equation — Derivation and Separation of Variables
Exercise 43.1: Dimension of the speed in the wave equation
Solution
The unit of the tension $T$ is the unit of force, $\mathrm N$, and from the equation of motion $F=ma$ (mass × acceleration) this is $\mathrm N=\mathrm{kg}\cdot\mathrm{m/s^2}$. The unit of the linear density $\rho$ is $\mathrm{kg/m}$, since it is mass per unit length. The unit of the quantity $T/\rho$ inside $v=\sqrt{T/\rho}$ can simply be computed as a fraction.
$$ \frac{[T]}{[\rho]}=\frac{\mathrm{kg\cdot m/s^2}}{\mathrm{kg/m}}=\mathrm{kg\cdot m/s^2}\times\frac{\mathrm m}{\mathrm{kg}}=\frac{\mathrm m^2}{\mathrm s^2} $$(The $\mathrm{kg}$ cancels between the numerator and the denominator, and the factors of $\mathrm m$ multiply to give $\mathrm m^2$.) Therefore the unit of $v=\sqrt{T/\rho}$ is
$$ [v]=\sqrt{\frac{\mathrm m^2}{\mathrm s^2}}=\frac{\mathrm m}{\mathrm s} $$and indeed this is the unit of speed ($\mathrm{m/s}$). This is also a condition required for the two sides of the wave equation $\pdiff{^2u}{x^2}=\dfrac1{v^2}\pdiff{^2u}{t^2}$ to have the same dimension: the dimension of the left-hand side is $[u]/\mathrm m^2$, and that of the right-hand side is $(\mathrm s^2/\mathrm m^2)\times([u]/\mathrm s^2)=[u]/\mathrm m^2$, and the fact that the unit of $v$ is $\mathrm{m/s}$ guarantees this agreement (verified with SymPy by treating the base units $\mathrm{kg,m,s}$ as symbols, which gives $[T/\rho]=\mathrm m^2/\mathrm s^2$).
Exercise 43.2: Dimension of the thermal diffusivity in the heat equation
Solution
Write the given units in the form of fractions.
$$ [k]=\frac{\mathrm{kg\cdot m}}{\mathrm{s^3\cdot K}},\qquad[\rho]=\frac{\mathrm{kg}}{\mathrm{m^3}},\qquad[C]=\frac{\mathrm{m^2}}{\mathrm{s^2\cdot K}} $$First compute $[\rho][C]$, which appears in the denominator.
$$ [\rho][C]=\frac{\mathrm{kg}}{\mathrm{m^3}}\times\frac{\mathrm{m^2}}{\mathrm{s^2\cdot K}}=\frac{\mathrm{kg}}{\mathrm{m\cdot s^2\cdot K}} $$(One factor of $\mathrm m$ remains from $\mathrm{m^2}$ and $\mathrm{m^3}$.) Next, compute the unit of $a=k/(\rho C)$.
$$ [a]=\frac{[k]}{[\rho][C]}=\frac{\mathrm{kg\cdot m}/(\mathrm{s^3\cdot K})}{\mathrm{kg}/(\mathrm{m\cdot s^2\cdot K})}=\frac{\mathrm{kg\cdot m}}{\mathrm{s^3\cdot K}}\times\frac{\mathrm{m\cdot s^2\cdot K}}{\mathrm{kg}}=\frac{\mathrm{m^2}}{\mathrm s} $$(The $\mathrm{kg}$ and the $\mathrm K$ each cancel, and $\mathrm s^3/\mathrm s^2=\mathrm s$ remains in the denominator.) Therefore the unit of the thermal diffusivity $a$ is $\mathrm{m^2/s}$. This can also be confirmed from the fact that the dimension $[u]/\mathrm s$ of the left-hand side of the heat equation $\pdiff ut=a\pdiff{^2u}{x^2}$ agrees with the dimension $(\mathrm m^2/\mathrm s)\times([u]/\mathrm m^2)=[u]/\mathrm s$ of the right-hand side (verified with SymPy by treating the base units as symbols, which gives $[a]=\mathrm m^2/\mathrm s$).
Exercise 43.3: The wave equation when the initial condition is a sine wave of double frequency
Solution
The general solution is $u(x,t)=\displaystyle\sum_{m=1}^\infty D_m\sin\dfrac{m\pi}Lx\cos\dfrac{m\pi}Lvt$. The initial condition $u(x,0)=h\sin\dfrac{2\pi x}L$ is itself the eigenfunction $\sin(2\pi x/L)$ for $m=2$. Using the orthogonality of the sine functions
$$ \int_0^L\sin\frac{2\pi x}L\sin\frac{m\pi x}Ldx=\frac L2\delta_{2m} $$(this equals $L/2$ only when $m=2$, and $0$ otherwise) in the formula for the Fourier coefficients, we obtain
$$ D_m=\frac2L\int_0^Lh\sin\frac{2\pi x}L\sin\frac{m\pi x}Ldx=\begin{cases}h&(m=2)\\0&(m\ne2)\end{cases} $$Therefore only the $m=2$ term of the series survives, and
$$ u(x,t)=h\sin\frac{2\pi x}L\cos\frac{2\pi vt}L $$is the required solution. Compared with Example 43.4 (the case $m=1$), there is one more node (a point that does not oscillate, where $\sin$ is $0$) in the spatial direction, at $x=L/2$, and the angular frequency in the time direction is also doubled, from $\pi v/L$ to $2\pi v/L$—this is a concrete instance of the general relation that when the wavelength is halved, the frequency doubles (verified with SymPy: direct integration confirms that $D_2=h$ for $m=2$ and $D_m=0$ for $m=1,3,4,5$).
Exercise 43.4: The heat equation when the initial temperature is uniform
Solution
The general solution is $U(x,t)=\displaystyle\sum_{n=1}^\infty b_n\,e^{-\frac{n^2\pi^2}{L^2}at}\sin\dfrac{n\pi}Lx$. Substituting $U(x,0)=T_0$ (a constant) into the formula for the Fourier sine coefficients, we obtain
$$ b_n=\frac2L\int_0^LT_0\sin\frac{n\pi}Lx\,dx=\frac2L\left[-\frac L{n\pi}T_0\cos\frac{n\pi}Lx\right]_0^L=\frac{2T_0}{n\pi}\bigl(1-\cos n\pi\bigr) $$Since $\cos n\pi=(-1)^n$, we have $1-\cos n\pi=1-(-1)^n$, which is $0$ when $n$ is even and $2$ when odd. Therefore
$$ b_n=\begin{cases}\dfrac{4T_0}{n\pi}&(n\text{ odd})\\[4pt]0&(n\text{ even})\end{cases} $$and the required solution is
$$ U(x,t)=\sum_{n=1,3,5,\ldots}^\infty\frac{4T_0}{n\pi}e^{-\frac{n^2\pi^2}{L^2}at}\sin\frac{n\pi}Lx $$Here the initial condition is the constant value $T_0$ (at both ends, $U(0,0)=U(L,0)=T_0\ne0$), whereas the boundary conditions impose $U(0,t)=U(L,t)=0$ (for $t\gt0$ both ends are forced to be $0$); hence at the instant $t=0^+$ an abrupt change (a situation close to a discontinuity) occurs near both ends. For this reason, if the series is truncated after finitely many terms, the Gibbs phenomenon (overshoot) appears near both ends, just as in the case of the rectangular pulse in Section 43.6. However, for $t\gt0$ the exponential decay begins immediately, and as time passes the distribution becomes smoother (verified with SymPy: direct integration confirms that $b_n=4T_0/(n\pi)$ for $n=1,3,5,7$ and $b_n=0$ for $n=2,4,6,8$).
Exercise 43.5: The two-dimensional wave equation for a different normal mode
Solution
The general solution is $u(x,y,t)=\displaystyle\sum_{m,n}D_{mn}\sin m\pi x\sin n\pi y\cos v\sqrt{m^2+n^2}\,\pi t$. The initial condition $u(x,y,0)=\sin\pi x\sin2\pi y$ is itself the eigenfunction for $m=1,n=2$, so by the orthogonality of the double Fourier sine series,
$$ D_{mn}=\begin{cases}1&(m,n)=(1,2)\\0&\text{otherwise}\end{cases} $$Noting that $m^2+n^2=1^2+2^2=5$, we find that the required solution is
$$ u(x,y,t)=\sin\pi x\sin2\pi y\cos\bigl(v\sqrt5\,\pi t\bigr) $$Compared with Example 43.5 ($(m,n)=(1,1)$, angular frequency $v\sqrt2\,\pi$), the angular frequency is $\sqrt5/\sqrt2\approx1.58$ times as large—as the waves in the $y$ direction become “finer” ($n$ goes from $1$ to $2$), the frequency of the whole motion rises as well (verified with SymPy: direct integration confirms that $b_{12}=1$ for $(m,n)=(1,2)$, while all other $(m,n)\,(\le3)$ give $0$).
Exercise 43.6: Laplace's equation when the boundary condition is a quadratic function
Solution
The form of the general solution is the same as in Illustration 43.5 and Example 43.8: $u(x,y)=\displaystyle\sum_{n=1}^\infty b_n\sinh\!\left(\dfrac{n\pi}L(L-x)\right)\sin\dfrac{n\pi}Ly$. From the boundary condition $u(0,y)=y(L-y)$, the coefficients are determined by
$$ b_n\sinh(n\pi)=\frac2L\int_0^Ly(L-y)\sin\frac{n\pi}Ly\,dy $$The integral on the right-hand side is computed by writing $y(L-y)=Ly-y^2$ and applying integration by parts twice (the same technique as in Sections 43.4 and 43.5). Finding an antiderivative and substituting the endpoints $y=0,L$ (note that $y(L-y)$ is $0$ at each of $y=0,L$), we obtain
$$ \int_0^Ly(L-y)\sin\frac{n\pi}Ly\,dy=\frac{2L^3\bigl(1-(-1)^n\bigr)}{n^3\pi^3} $$Therefore
$$ b_n\sinh(n\pi)=\frac2L\cdot\frac{2L^3\bigl(1-(-1)^n\bigr)}{n^3\pi^3}=\frac{4L^2\bigl(1-(-1)^n\bigr)}{n^3\pi^3} $$Since $1-(-1)^n$ is $2$ when $n$ is odd and $0$ when even,
$$ b_n=\begin{cases}\dfrac{8L^2}{n^3\pi^3\sinh(n\pi)}&(n\text{ odd})\\[4pt]0&(n\text{ even})\end{cases} $$and the required solution is
$$ u(x,y)=\sum_{n=1,3,5,\ldots}^\infty\frac{8L^2}{n^3\pi^3\sinh(n\pi)}\sinh\!\left(\frac{n\pi}L(L-x)\right)\sin\frac{n\pi}Ly $$The fact that the boundary function $y(L-y)$ is a parabola that is symmetric about the axis $y=L/2$ is the reason that only the odd-order terms appear in the Fourier series (the same as the symmetry argument seen in Illustration 43.4 and Example 43.8). Moreover, since the denominator contains both $n^3$ and $\sinh(n\pi)$, the series of Exercise 43.6 converges even faster than that of Example 43.8—this reflects the general property of Fourier analysis that the smoother the boundary condition ($y(L-y)$ is of class $C^\infty$), the faster the Fourier coefficients tend to $0$ (verified with SymPy: $(2/L)\int_0^Ly(L-y)\sin(n\pi y/L)dy=4L^2(1-(-1)^n)/(n^3\pi^3)$).
Chapter 44 Coordinate Transformations and the Laplacian
Exercise 44.1: $\nabla^2(r^2)$ in polar coordinates
Solution
Since $u=r^2$ does not contain $\theta$, we have $u_\theta=u_{\theta\theta}=0$. For $r$, $u_r=2r$ and $u_{rr}=2$. The Laplacian in polar coordinates is
$$ \nabla^2u=u_{rr}+\frac1r u_r+\frac{1}{r^2}u_{\theta\theta} $$Substituting these derivatives into it, we obtain
$$ \nabla^2u=2+\frac1r\cdot2r+\frac{1}{r^2}\cdot0=2+2=4 $$On the other hand, in Cartesian coordinates $u=r^2=x^2+y^2$, so from $u_x=2x,\ u_{xx}=2$ and $u_y=2y,\ u_{yy}=2$ we get
$$ \nabla^2u=u_{xx}+u_{yy}=2+2=4 $$Thus we confirm that the same value $4$ is obtained whichever coordinate system we compute in (verified with SymPy).
Exercise 44.2: Harmonicity of $u=z$ in spherical coordinates
Solution
Since $u=r\cos\theta$ does not contain $\varphi$, we have $u_\varphi=u_{\varphi\varphi}=0$. For $r$, $u_r=\cos\theta$ and $u_{rr}=0$. For $\theta$, $u_\theta=-r\sin\theta$ and $u_{\theta\theta}=-r\cos\theta$. The Laplacian in spherical coordinates is
$$ \nabla^2u=u_{rr}+\frac2r u_r+\frac{1}{r^2}u_{\theta\theta}+\frac{\cos\theta}{r^2\sin\theta}u_\theta+\frac{1}{r^2\sin^2\theta}u_{\varphi\varphi} $$Substituting these derivatives into it, we obtain
$$ \nabla^2u=0+\frac2r\cos\theta+\frac{1}{r^2}(-r\cos\theta)+\frac{\cos\theta}{r^2\sin\theta}(-r\sin\theta)+0 =\frac{2\cos\theta}{r}-\frac{\cos\theta}{r}-\frac{\cos\theta}{r}=0 $$so the function indeed satisfies Laplace's equation. In Cartesian coordinates, $u=z$ and $u_{xx}=u_{yy}=u_{zz}=0$, so $\nabla^2u=0$ is obvious (verified with SymPy). Thus, even through spherical coordinates, a coordinate system that looks complicated at first sight, we have confirmed the same simple fact (by taking a detour).
Exercise 44.3: Reproduce the reason for the cylindrical-coordinate Laplacian
Solution
Cylindrical coordinates are given by the transformation $x=r\cos\theta,\ y=r\sin\theta,\ z=z$. The following two facts deserve attention here.
(i) $r,\theta$ do not depend on $z$ at all. Since $z$ appears nowhere in the expressions $r=\sqrt{x^2+y^2}$ and $\theta=\tan^{-1}(y/x)$, we have $\partial r/\partial z=0$ and $\partial\theta/\partial z=0$.
(ii) $z$ does not depend on $x,y$ at all. The relation $z=z$ itself means that $z$ is another coordinate, independent of $x,y$.
Because of these two facts, when we differentiate $u(x,y,z)=u\bigl(r(x,y),\theta(x,y),z\bigr)$ partially with respect to $x$ or $y$, $z$ is treated as a constant that does not change at all along the way, so the computation of $u_{xx},u_{yy}$ carried out in Section 44.2 remains valid as it stands (whether or not $z$ is present, if we regard $z$ as a mere parameter, the same chain-rule computation holds as it is). Conversely, when we differentiate $u$ partially with respect to $z$, we merely treat $r,\theta$ (and hence $x,y$) as constants, and this never mixes with the partial derivatives in the $r,\theta$ directions (since $r_z=\theta_z=0$, the chain rule gives $u_z=u_r r_z+u_\theta\theta_z+u_z\cdot1=u_z$, and $u_z$ contains no information at all from the $r,\theta$ directions).
In other words, in general, for a function such as $u(x,y,z)=f(x,y)+g(z)$, in which the part depending on $x,y$ and the part depending on $z$ are completely separated, we have
$$ \pdiff{^2u}{x^2}+\pdiff{^2u}{y^2}+\pdiff{^2u}{z^2}=\bigl(f_{xx}+f_{yy}\bigr)+g''(z) $$As this shows, the second derivatives of the two parts are simply added without mixing (one may also think that mixed partial derivatives of $f,g$ such as $\partial^2/\partial x\partial z$ do not exist in the first place, that is, they are automatically $0$). For cylindrical coordinates the reason is essentially the same: of the three-dimensional Laplacian $u_{xx}+u_{yy}+u_{zz}$ in Cartesian coordinates, only the part $u_{xx}+u_{yy}$ is replaced wholesale by the polar-coordinate formula (Formula 44.1), while the part $u_{zz}$ remains as it is, unchanged (we have also verified with SymPy that this additivity holds for general functions of the form $f(x,y)+g(z)$).
Exercise 44.4: Complete the direct method for the spherical-coordinate Laplacian
Solution
We use the first-order partial derivatives found with the formulas in the main text:
$$ r_x=\sin\theta\cos\varphi,\qquad \theta_x=\frac{\cos\theta\cos\varphi}{r},\qquad \varphi_x=-\frac{\sin\varphi}{r\sin\theta} $$First, differentiate $u_x=u_r r_x+u_\theta\theta_x+u_\varphi\varphi_x$ once more with respect to $x$. This time it is the chain rule for three variables, so applying the product rule to each of the three terms gives
$$ u_{xx}=\bigl(u_{rx}r_x+u_r r_{xx}\bigr)+\bigl(u_{\theta x}\theta_x+u_\theta\theta_{xx}\bigr)+\bigl(u_{\varphi x}\varphi_x+u_\varphi\varphi_{xx}\bigr) $$where, regarding $u_r,u_\theta,u_\varphi$ as functions of $r,\theta,\varphi$ (in the same way as for $u$ itself) and applying the chain rule, we obtain for $u_{rx},u_{\theta x},u_{\varphi x}$, respectively,
$$ u_{rx}=u_{rr}r_x+u_{r\theta}\theta_x+u_{r\varphi}\varphi_x,\quad u_{\theta x}=u_{\theta r}r_x+u_{\theta\theta}\theta_x+u_{\theta\varphi}\varphi_x,\quad u_{\varphi x}=u_{\varphi r}r_x+u_{\varphi\theta}\theta_x+u_{\varphi\varphi}\varphi_x $$(by Schwarz's theorem, $u_{r\theta}=u_{\theta r}$, $u_{r\varphi}=u_{\varphi r}$, $u_{\theta\varphi}=u_{\varphi\theta}$). Substituting all of these and rearranging, we obtain
$$ u_{xx}=u_{rr}r_x^2+u_{\theta\theta}\theta_x^2+u_{\varphi\varphi}\varphi_x^2+2u_{r\theta}r_x\theta_x+2u_{r\varphi}r_x\varphi_x+2u_{\theta\varphi}\theta_x\varphi_x+u_r r_{xx}+u_\theta\theta_{xx}+u_\varphi\varphi_{xx} $$The result takes this form (the pattern is the same as in the expansion of a quadratic form; one may think of it as the formula for the two-variable case in Section 44.2 with the terms involving $\varphi$ added). All that remains is to compute the squares and products of $r_x,\theta_x,\varphi_x$ and the second-order derivatives $r_{xx},\theta_{xx},\varphi_{xx}$, and to substitute them. The second-order derivatives are obtained by the same procedure as in the main text (differentiating $r_x=\sin\theta\cos\varphi$ and the like once more with respect to $x$, this time noting that $\theta,\varphi$ are functions of $x$), and after simplification we have
$$ r_{xx}=\frac{1-\sin^2\theta\cos^2\varphi}{r},\qquad \theta_{xx}=\frac{(\sin^2\varphi-2\sin^2\theta\cos^2\varphi)\cos\theta}{r^2\sin\theta},\qquad \varphi_{xx}=\frac{\sin2\varphi}{r^2\sin^2\theta} $$(verified with SymPy to agree with the second partial derivatives computed directly from Cartesian coordinates). Substituting all of these together with $r_x,\theta_x,\varphi_x$, and simplifying as in $2r_x\theta_x=\dfrac{2\sin\theta\cos\theta\cos^2\varphi}{r}$, $2r_x\varphi_x=-\dfrac{\sin2\varphi}{r}$, $2\theta_x\varphi_x=-\dfrac{\sin2\varphi\cos\theta}{r^2\sin\theta}$, we finally obtain
$$ \begin{aligned} u_{xx}={}&\sin^2\theta\cos^2\varphi\,u_{rr}+\frac{\cos^2\theta\cos^2\varphi}{r^2}u_{\theta\theta}+\frac{\sin^2\varphi}{r^2\sin^2\theta}u_{\varphi\varphi}\\ &+\frac{2\sin\theta\cos\theta\cos^2\varphi}{r}u_{r\theta}-\frac{\sin2\varphi}{r}u_{r\varphi}-\frac{\sin2\varphi\cos\theta}{r^2\sin\theta}u_{\theta\varphi}\\ &+\frac{1-\sin^2\theta\cos^2\varphi}{r}u_r+\frac{(\sin^2\varphi-2\sin^2\theta\cos^2\varphi)\cos\theta}{r^2\sin\theta}u_\theta+\frac{\sin2\varphi}{r^2\sin^2\theta}u_\varphi \end{aligned} $$This is the complete expression for $u_{xx}$ (verified with SymPy that this expression agrees algebraically with the one assembled mechanically from the chain rule). At this point all nine kinds of second- and first-order partial derivatives have already appeared; if we carry out the same computation for $y,z$ and add the three expressions $u_{xx}+u_{yy}+u_{zz}$ (the many terms involving the angles cancel one another, as in Section 44.2), we finally arrive at the Laplacian in spherical coordinates given in Formula 44.3. Through this exercise one can appreciate that the “shortcut” introduced in the main text effectively spared us this computation in the $y,z$ directions and the enormous simplification that follows it.
Exercise 44.5: Harmonicity of $u=x$ in spherical coordinates
Solution
For $u=r\sin\theta\cos\varphi$, we find each partial derivative. For $r$, $u_r=\sin\theta\cos\varphi$ and $u_{rr}=0$. For $\theta$, $u_\theta=r\cos\theta\cos\varphi$ and $u_{\theta\theta}=-r\sin\theta\cos\varphi$. For $\varphi$, $u_\varphi=-r\sin\theta\sin\varphi$ and $u_{\varphi\varphi}=-r\sin\theta\cos\varphi$. Substituting into Formula 44.3, we obtain
$$ \nabla^2u=0+\frac2r\sin\theta\cos\varphi+\frac{1}{r^2}(-r\sin\theta\cos\varphi)+\frac{\cos\theta}{r^2\sin\theta}(r\cos\theta\cos\varphi)+\frac{1}{r^2\sin^2\theta}(-r\sin\theta\cos\varphi) $$Simplifying each term, we get
$$ \nabla^2u=\frac{2\sin\theta\cos\varphi}{r}-\frac{\sin\theta\cos\varphi}{r}+\frac{\cos^2\theta\cos\varphi}{r\sin\theta}-\frac{\cos\varphi}{r\sin\theta} =\frac{\sin\theta\cos\varphi}{r}+\frac{\cos\varphi(\cos^2\theta-1)}{r\sin\theta} $$Here, using $\cos^2\theta-1=-\sin^2\theta$ (a basic trigonometric identity), the second term becomes $\dfrac{-\sin^2\theta\cos\varphi}{r\sin\theta}=-\dfrac{\sin\theta\cos\varphi}{r}$, so
$$ \nabla^2u=\frac{\sin\theta\cos\varphi}{r}-\frac{\sin\theta\cos\varphi}{r}=0 $$and the function indeed satisfies Laplace's equation. In Cartesian coordinates $u=x$, and $\nabla^2x=0$ is trivial. In spherical coordinates the computation is longer, because of the dependence on both $\theta,\varphi$, but it does settle down to $0$ in the end (verified with SymPy).
Exercise 44.6: Harmonicity of $x^2-y^2$ in spherical coordinates
Solution
For $u=r^2\sin^2\theta\cos2\varphi$, we find each partial derivative. For $r$, $u_r=2r\sin^2\theta\cos2\varphi$ and $u_{rr}=2\sin^2\theta\cos2\varphi$. For $\theta$, using the fact that the derivative of $\sin^2\theta$ is $2\sin\theta\cos\theta=\sin2\theta$, we get $u_\theta=r^2\sin2\theta\cos2\varphi$, and then, since the derivative of $\sin2\theta$ is $2\cos2\theta$, $u_{\theta\theta}=2r^2\cos2\theta\cos2\varphi$. For $\varphi$, $u_\varphi=-2r^2\sin^2\theta\sin2\varphi$ and $u_{\varphi\varphi}=-4r^2\sin^2\theta\cos2\varphi$. Substituting into Formula 44.3, we obtain
$$ \nabla^2u=2\sin^2\theta\cos2\varphi+\frac2r\bigl(2r\sin^2\theta\cos2\varphi\bigr)+\frac{1}{r^2}\bigl(2r^2\cos2\theta\cos2\varphi\bigr)+\frac{\cos\theta}{r^2\sin\theta}\bigl(r^2\sin2\theta\cos2\varphi\bigr)+\frac{1}{r^2\sin^2\theta}\bigl(-4r^2\sin^2\theta\cos2\varphi\bigr) $$Simplifying the dependence on $r,\theta,\varphi$ (computing the fourth term with $\sin2\theta=2\sin\theta\cos\theta$ in mind gives $\dfrac{\cos\theta}{\sin\theta}\cdot2\sin\theta\cos\theta\cos2\varphi=2\cos^2\theta\cos2\varphi$), we get
$$ \nabla^2u=\cos2\varphi\Bigl(2\sin^2\theta+4\sin^2\theta+2\cos2\theta+2\cos^2\theta-4\Bigr) $$Rewriting the contents of the parentheses with $\cos2\theta=2\cos^2\theta-1$ (the double-angle formula used in Chapter 40 and earlier; $\cos2\theta=1-2\sin^2\theta$ would also do), we get
$$ 2\sin^2\theta+4\sin^2\theta+2(2\cos^2\theta-1)+2\cos^2\theta-4=6\sin^2\theta+6\cos^2\theta-6=6(\sin^2\theta+\cos^2\theta)-6=6-6=0 $$so $\nabla^2u=\cos2\varphi\cdot0=0$, and the function indeed satisfies Laplace's equation. By the identity in the hint, $u=r^2\sin^2\theta\cos2\varphi=(r\sin\theta\cos\varphi)^2-(r\sin\theta\sin\varphi)^2=x^2-y^2$, so we have confirmed the same harmonic function as in Example 44.2 (the check in polar coordinates), this time in spherical coordinates, a coordinate system with three variables (verified with SymPy).
← Back to Chapter 44, “Coordinate Transformations and the Laplacian”
Chapter 45 The Schrödinger Equation (Cartesian Coordinates) and the Infinite Square Well Potential
Exercise 45.1: Ratios of energy levels
Solution
We found earlier that the energy eigenvalues of the infinite square well potential (half-width $a$) are
$$ E_n=\frac{\hbar^2\pi^2}{8ma^2}n^2\qquad(n=1,2,3,\dots) $$Computing $E_5$ and $E_2$, we obtain
$$ E_5=\frac{\hbar^2\pi^2}{8ma^2}\cdot5^2=\frac{25\hbar^2\pi^2}{8ma^2},\qquad E_2=\frac{\hbar^2\pi^2}{8ma^2}\cdot2^2=\frac{4\hbar^2\pi^2}{8ma^2} $$Taking the ratio, the common factor $\dfrac{\hbar^2\pi^2}{8ma^2}$ cancels out.
$$ \frac{E_5}{E_2}=\frac{25\hbar^2\pi^2/(8ma^2)}{4\hbar^2\pi^2/(8ma^2)}=\frac{25}{4} $$In general, we can write $E_n=\dfrac{\hbar^2\pi^2}{8ma^2}n^2=E_1\cdot n^2$ ($E_1=\dfrac{\hbar^2\pi^2}{8ma^2}$ is the value for $n=1$), so
$$ \frac{E_n}{E_1}=\frac{E_1\cdot n^2}{E_1}=n^2 $$holds. Since $a,m,\hbar$ take the same values for every $n$, they all cancel when we compute $E_n/E_1$, and the ratio is determined by $n^2$ alone. (Verified with SymPy: we defined $E_n=\hbar^2\pi^2n^2/(8ma^2)$ and confirmed that $E_5/E_2=25/4$ and $E_n/E_1=n^2$.)
Exercise 45.2: “Accidental” degeneracy in the two-dimensional well
Solution
The energy of the two-dimensional infinite square well potential is $E_{n_1,n_2}=\dfrac{\pi^2\hbar^2}{8ma^2}(n_1^2+n_2^2)$, and it is determined solely by the value of $n_1^2+n_2^2$. Let us compute a few values for pairs with $n_1\le n_2$.
$$ \begin{array}{c|cccccccc} (n_1,n_2) & (1,1) & (1,2) & (2,2) & (1,3) & (2,3) & (1,4) & (3,3) & (2,4)\\\hline n_1^2+n_2^2 & 2 & 5 & 8 & 10 & 13 & 17 & 18 & 20 \end{array} $$Continuing to list the values of $n_1^2+n_2^2$ in this way, we find that $(1,7)$ and $(5,5)$ both give
$$ 1^2+7^2=1+49=50,\qquad 5^2+5^2=25+25=50 $$In the range $1^2+7^2\le50$, there is no other pair of positive integers with $n_1^2+n_2^2=50$ ($n_1\le n_2$) (indeed, solving $n_1^2+n_2^2=50$ for $n_1=1,\dots,7$, the quantity $n_2^2=50-n_1^2$ is a perfect square only for $n_1=1$ ($n_2^2=49$) and $n_1=5$ ($n_2^2=25$)). Therefore, the three states $(n_1,n_2)=(1,7)$ (and its swap $(7,1)$) and $(5,5)$ all have the same energy
$$ E_{1,7}=E_{7,1}=E_{5,5}=\frac{\pi^2\hbar^2}{8ma^2}\cdot50=\frac{25\pi^2\hbar^2}{4ma^2} $$The degeneracy of $(1,7)$ and $(7,1)$ comes from a simple swap, but the fact that $(5,5)$ joins them at the same energy is due to the numerical coincidence $1^2+7^2=5^2+5^2$ ($1+49=25+25$); it is an “extra” degeneracy that cannot be explained by the symmetry of the two-dimensional well alone. (Verified with Python: computing $n_1^2+n_2^2$ for all pairs $n_1,n_2=1,\dots,7$, we confirmed that the smallest repeated value among the pairs with $n_1\le n_2$ is $50$ (that of $(1,7)$ and $(5,5)$).)
Exercise 45.3: Commutator of the momentum operator and the energy operator
Solution
Let $f=f(x,t)$ be an arbitrary sufficiently smooth function (one whose partial derivatives up to second order exist). By definition,
$$ \hat p\hat Ef=\frac\hbar i\pdiff{}{x}\left(-\frac\hbar i\pdiff ft\right) =-\frac{\hbar^2}{i^2}\pdiff{}{x}\left(\pdiff ft\right) =\hbar^2\pdiff{^2f}{x\partial t} $$(We used $-\dfrac{1}{i^2}=-\dfrac1{-1}=1$.) Similarly,
$$ \hat E\hat pf=-\frac\hbar i\pdiff{}{t}\left(\frac\hbar i\pdiff fx\right) =-\frac{\hbar^2}{i^2}\pdiff{}{t}\left(\pdiff fx\right) =\hbar^2\pdiff{^2f}{t\partial x} $$Therefore, the commutator is
$$ [\hat p,\hat E]f=\hat p\hat Ef-\hat E\hat pf=\hbar^2\left(\pdiff{^2f}{x\partial t}-\pdiff{^2f}{t\partial x}\right) $$Now, if $f$ is a sufficiently smooth function (one whose second-order partial derivatives are continuous), then Clairaut's theorem (also called Schwarz's theorem) holds: the result does not change when the order of partial differentiation is exchanged.
$$ \pdiff{^2f}{x\partial t}=\pdiff{^2f}{t\partial x} $$Hence the expression in the parentheses is identically $0$, and
$$ [\hat p,\hat E]f=\hbar^2\cdot0=0 $$holds for every $f$. That is, $[\hat p,\hat E]=0$ (the operators commute). (Using SymPy, for a general symbolic function $f(x,t)$ we computed $\hat p\hat Ef-\hat E\hat pf$ and confirmed that it is identically $0$.)
Exercise 45.4: When the initial state is the ground state itself
Solution
The general solution found in Section 45.4 was, for odd $n$,
$$ \psi(x,t)=\frac1{\sqrt a}\,e^{-i\frac{\hbar\pi^2}{8ma^2}n^2t}\cos\frac{n\pi}{2a}x $$and for even $n$ it had the form with $\sin$ in place of $\cos$. To satisfy the initial condition $\psi(x,0)=\psi_1(x)=\dfrac1{\sqrt a}\cos\dfrac\pi{2a}x$, the expression obtained by substituting $t=0$ must coincide with $\psi_1(x)$. Substituting $t=0$ into the general solution (since $e^0=1$) gives
$$ \psi(x,0)=\frac1{\sqrt a}\cos\frac{n\pi}{2a}x $$(in the case of odd $n$). This coincides with $\dfrac1{\sqrt a}\cos\dfrac\pi{2a}x$ exactly when $n=1$ (for $n=3,5,\dots$ we get functions such as $\cos\dfrac{3\pi}{2a}x$, which differ from $\cos\dfrac\pi{2a}x$). Therefore, the required solution consists of the $n=1$ term only, namely
$$ \psi(x,t)=\frac1{\sqrt a}\,e^{-i\frac{\hbar\pi^2}{8ma^2}t}\cos\frac{\pi}{2a}x=\psi_1(x)\,e^{-iE_1t/\hbar} $$(with $E_1=\hbar^2\pi^2/(8ma^2)$). In other words, when the initial state is exactly one eigenfunction (here, the ground state), the time evolution takes the extremely simple form “the state itself multiplied only by the phase factor $e^{-iE_1t/\hbar}$ corresponding to the energy $E_1$.” (When the initial condition is a superposition of several eigenfunctions, each term carries a phase factor determined by its own energy, so the whole undergoes a more complicated change in time—a phenomenon like “beats.” This goes beyond the scope of this chapter, so here we treated only the case where the initial state is a single eigenfunction. Verified with SymPy that $\psi(x,t)=\psi_1(x)e^{-iE_1t/\hbar}$ satisfies the time-dependent Schrödinger equation and coincides with $\psi_1(x)$ at $t=0$.)
Exercise 45.5: Normalization constant in two dimensions (the even × even case)
Solution
When $n_1,n_2$ are both even, $\psi(x,y)=B_1B_2\sin\dfrac{n_1\pi}{2a}x\sin\dfrac{n_2\pi}{2a}y$. The normalization condition is
$$ \iint_{-\infty}^{\infty}\abs{\psi(x,y)}^2\,dx\,dy=1 $$and since $\psi=0$ outside the well, it suffices to integrate over the region $[-a,a]\times[-a,a]$. Because $\psi$ is a product of a function of $x$ alone and a function of $y$ alone, the double integral factors into the product of two single-variable integrals.
$$ \iint_{-a}^{a}B_1^2B_2^2\sin^2\frac{n_1\pi}{2a}x\sin^2\frac{n_2\pi}{2a}y\,dx\,dy =B_1^2B_2^2\left(\int_{-a}^{a}\sin^2\frac{n_1\pi}{2a}x\,dx\right)\left(\int_{-a}^{a}\sin^2\frac{n_2\pi}{2a}y\,dy\right) $$As shown in the normalization computation of Section 45.3, using the half-angle formula $\sin^2\theta=\dfrac{1-\cos2\theta}2$, for a positive integer $n$ the following holds:
$$ \int_{-a}^{a}\sin^2\frac{n\pi}{2a}u\,du=\int_{-a}^{a}\frac{1-\cos\frac{n\pi}au}2\,du=\frac12(2a)-\frac12\left[\frac{a}{n\pi}\sin\frac{n\pi}au\right]_{-a}^{a}=a-0=a $$(The integral of the $\cos$ term vanishes because $\sin(n\pi)=\sin(-n\pi)=0$.) Applying this to both the $x$-integral and the $y$-integral, we obtain
$$ B_1^2B_2^2\cdot a\cdot a=B_1^2B_2^2a^2=1 $$Therefore (if we take $B_1,B_2$ to be positive real numbers) we obtain
$$ B_1B_2=\frac1a $$This agrees with the value stated in Section 45.5. (Verified with SymPy that $\int_{-a}^a\sin^2(n\pi u/2a)\,du=a$ ($n$ a positive integer).)
Exercise 45.6: Why is $\hat H\psi=E\psi$ “time-independent”?
Solution
The equation $\hat H\psi=E\psi$ itself certainly contains no symbol for the time $t$. However, what the name “time-independent” refers to is not whether the symbol $t$ appears in the equation, but the meaning of the symbol $E$.
As stated in Definition 45.1 of Section 45.1, in the eigenvalue equation $\hat A\psi=\lambda\psi$ the $\lambda$ must be “a constant independent of $\psi$.” The $E$ in $\hat H\psi=E\psi$ is likewise a constant in exactly this sense—a single real number that does not change with time. In other words, the moment we write $\hat H\psi=E\psi$, the physical assumption that “the energy of this system is fixed at a particular value $E$ that does not change as time passes” (the assumption of a stationary state) is already built in.
In contrast, in the general time-evolution equation $\hat H\psi=\hat E\psi$ derived in Section 45.2 (that is, $-\dfrac{\hbar^2}{2m}\pdiff{^2\psi}{x^2}+V\psi=-\dfrac\hbar i\pdiff\psi t$), the energy operator $\hat E=-\dfrac\hbar i\pdiff{}t$ appears in place of $E$. The operator $\hat E$ is itself the operation of “differentiating with respect to $t$,” and it directly describes how $\psi$ changes with time. In this case, the wave function $\psi(x,t)$ is in general allowed to change its form depending on the time $t$.
To summarize—the $E$ in $\hat H\psi=E\psi$ is “a single number that does not change as time passes,” whereas the $\hat E$ in $\hat H\psi=\hat E\psi$ is “an operator that represents the change in the $t$ direction itself.” We call the former “time-independent” not because $t$ does not appear in the equation as written, but because the name declares that the $E$ appearing there is a constant that does not vary in time. (As stated in the “Caution: The relation between ‘time-independent’ and ‘time-dependent’” in Section 45.2, in fact, a solution of $\hat H\psi=E\psi$, written in the form $\psi(x,t)=\psi(x)e^{-iEt/\hbar}$, is a special solution of $\hat H\psi=\hat E\psi$.)
Chapter 46 The Harmonic Oscillator and the Morse Potential
Exercise 46.1: The coefficients $a_2,a_4$ of the Hermite series
Solution
The recurrence relation is $a_{k+2}=\dfrac{2k+1-\varepsilon}{(k+1)(k+2)}a_k$.
$k=0$: $a_2=\dfrac{2\cdot0+1-\varepsilon}{1\cdot2}a_0=\dfrac{1-\varepsilon}{2}a_0=-\dfrac{\varepsilon-1}{2}a_0$.
$k=2$: $a_4=\dfrac{2\cdot2+1-\varepsilon}{3\cdot4}a_2=\dfrac{5-\varepsilon}{12}a_2=\dfrac{5-\varepsilon}{12}\times\left(-\frac{\varepsilon-1}{2}a_0\right)=-\frac{(5-\varepsilon)(\varepsilon-1)}{24}a_0=\frac{(\varepsilon-1)(\varepsilon-5)}{24}a_0$.
To summarize, we have
$$ a_2=-\frac{\varepsilon-1}{2}a_0,\qquad a_4=\frac{(\varepsilon-1)(\varepsilon-5)}{24}a_0=\frac{(\varepsilon-1)(\varepsilon-5)}{4!}a_0 $$Since $4!=24$, the latter form agrees with the formula in the main text (Section 46.2.1).
Exercise 46.2: The wave function for $n=2$
Solution
For $n=2$, the normalization constant is
$$ C_2=\left(\frac{m\omega_0}{\pi\hbar}\right)^{1/4}\frac1{\sqrt{2^2\cdot2!}}=\left(\frac{m\omega_0}{\pi\hbar}\right)^{1/4}\frac1{\sqrt8} $$(here $2^2\cdot2!=4\times2=8$). Setting $u=\sqrt{m\omega_0/\hbar}\,x$, we have $H_2(u)=4u^2-2=4\dfrac{m\omega_0}{\hbar}x^2-2$, so we can write
$$ \psi_2(x)=\left(\frac{m\omega_0}{\pi\hbar}\right)^{1/4}\frac1{\sqrt8}\left(4\frac{m\omega_0}{\hbar}x^2-2\right)e^{-\frac{m\omega_0}{2\hbar}x^2} $$Using $\dfrac1{\sqrt8}\times2=\dfrac2{\sqrt8}=\dfrac1{\sqrt2}$ to simplify further, we obtain
$$ \psi_2(x)=\left(\frac{m\omega_0}{\pi\hbar}\right)^{1/4}\frac1{\sqrt2}\left(2\frac{m\omega_0}{\hbar}x^2-1\right)e^{-\frac{m\omega_0}{2\hbar}x^2} $$This is another way of writing the same wave function (verified with SymPy that $\displaystyle\int_{-\infty}^\infty\psi_2(x)^2\dd x=1$).
Exercise 46.3: Energy levels on a half-infinite domain ($n=0,1$)
Solution
The energy on the half-infinite domain was $E=(2n+\frac32)\hbar\omega_0$ ($n=0,1,2,\ldots$).
$n=0$: $E=\left(2\cdot0+\dfrac32\right)\hbar\omega_0=\dfrac32\hbar\omega_0$. The corresponding value is $n'=2n+1=1$ ($H_1$, the Hermite polynomial of degree one).
$n=1$: $E=\left(2\cdot1+\dfrac32\right)\hbar\omega_0=\dfrac72\hbar\omega_0$. The corresponding value is $n'=2\cdot1+1=3$ ($H_3$, the Hermite polynomial of degree three).
Therefore, $n=1$ on the half-infinite domain (the first excited state) corresponds exactly to what is called the third excited state of the harmonic oscillator on the whole space ($n'=3$, an odd wave function that uses $H_3(u)=8u^3-12u$). On the half-infinite domain, each time $n$ increases by one, the quantum number on the whole space increases by two according to the rule $n'=2n+1$ (because only the odd-degree Hermite functions are used, skipping every other one).
Exercise 46.4: The degeneracy of the three-dimensional isotropic harmonic oscillator ($N=2$)
Solution
We write out all the triples satisfying $n_1+n_2+n_3=2$ ($n_1,n_2,n_3$ are nonnegative integers). There are two cases: one of them equals $2$ and the other two equal $0$, or two of them equal $1$ each and the remaining one equals $0$.
$$ (2,0,0),\ (0,2,0),\ (0,0,2),\ (1,1,0),\ (1,0,1),\ (0,1,1) $$There are six possibilities in all. On the other hand, the formula of Theorem 46.8 gives $g(2)=\dfrac{(2+1)(2+2)}2=\dfrac{3\times4}2=6$, which agrees. All six of these states have $E=\left(2+\frac32\right)\hbar\omega_0=\frac72\hbar\omega_0$.
Exercise 46.5: The number of bound states of a Morse potential
Solution
Substituting $m=\hbar=1$, $K=50$, $D=1$ into $\lambda=\sqrt{2mK}/(\hbar D)$, we obtain
$$ \lambda=\frac{\sqrt{2\times1\times50}}{1\times1}=\sqrt{100}=10 $$The number of bound states is $n_{\max}=\lfloor\lambda-\frac12\rfloor=\lfloor10-0.5\rfloor=\lfloor9.5\rfloor=9$, so the allowed values of $n$ are the 10 possibilities $n=0,1,\ldots,9$; that is, there are $n_{\max}+1=10$ bound states (it has been verified by numerical computation that diagonalizing the Hamiltonian by the finite-difference method also gives the same result—however, a different set of parameter values was used for this numerical check; see the verification at the end of the book).
Exercise 46.6: The coefficients of the associated Laguerre series (the case $n=2$)
Solution
The recurrence relation is $c_{k+1}=\dfrac{k-n}{(k+1)(k+2\alpha+1)}c_k$. We compute successively, taking $n=2$ and $c_0=1$.
$k=0$: $c_1=\dfrac{0-2}{(1)(0+2\alpha+1)}c_0=\dfrac{-2}{2\alpha+1}=-\dfrac2{2\alpha+1}$.
(Note: Theorems 46.10 and 46.11 in the main text deal with the equation obtained after the factor $g(u)=u^\alpha$ has been factored out in the form $f=u^\alpha g$, and in $c_1$ the denominator $2\alpha+1$ appears as it is. Here we compute in general, treating $\alpha$ as an arbitrary real number.)
$k=1$: $c_2=\dfrac{1-2}{(2)(1+2\alpha+1)}c_1=\dfrac{-1}{2(2\alpha+2)}\times\left(-\frac2{2\alpha+1}\right)=\dfrac{1}{2\alpha+2}\times\frac1{2\alpha+1}=\frac1{(2\alpha+1)(2\alpha+2)}$.
$k=2$: $c_3=\dfrac{2-2}{(3)(2+2\alpha+1)}c_2=\dfrac0{3(2\alpha+3)}c_2=0$.
Indeed, the numerator becomes $k-n=2-2=0$, so $c_3=0$, and all the later coefficients also become $0$ (because the right-hand side of the recurrence relation is multiplied by $c_3=0$). Therefore $g(u)$ is
$$ g(u)=c_0+c_1u+c_2u^2=1-\frac2{2\alpha+1}u+\frac1{(2\alpha+1)(2\alpha+2)}u^2 $$a polynomial that stops at exactly degree two (verified with SymPy by actually substituting into the recurrence relation for $k=0,1,2,3$, which gives $c_1=-2/(2\alpha+1)$, $c_2=1/(2(\alpha+1)(2\alpha+1))$, $c_3=0$—see the verification at the end of the book).
← Back to Chapter 46, “The Harmonic Oscillator and the Morse Potential”
Chapter 47 The Schrödinger Equation (Polar and Cylindrical Coordinates) and Bessel Functions
Exercise 47.1: Checking $J_{-1}(x)=-J_1(x)$ with the series
Solution
Substituting $\alpha=-1$ into the definition of the Bessel function of the first kind (Definition 41.2 in Chapter 41) gives
$$ J_{-1}(x)=\sum_{k=0}^{\infty}\frac{(-1)^k}{k!\,\Gamma(-1+k+1)}\left(\frac x2\right)^{2k-1}=\sum_{k=0}^{\infty}\frac{(-1)^k}{k!\,\Gamma(k)}\left(\frac x2\right)^{2k-1} $$Here the term for $k=0$ contains $\Gamma(0)$, but the gamma function is not defined at integers less than or equal to $0$ (we regard $1/\Gamma(0)=0$, following the idea of Chapter 41, Section 41.3.4), so this term vanishes. Hence the sum effectively starts from $k=1$. Changing the summation index to $k=j+1$ ($j=0,1,2,\dots$), we have $k!=(j+1)!$, $\Gamma(k)=\Gamma(j+1)=j!$, and $2k-1=2j+1$, so
$$ J_{-1}(x)=\sum_{j=0}^{\infty}\frac{(-1)^{j+1}}{(j+1)!\,j!}\left(\frac x2\right)^{2j+1} =-\sum_{j=0}^{\infty}\frac{(-1)^{j}}{j!\,(j+1)!}\left(\frac x2\right)^{2j+1} $$(we used $(-1)^{j+1}=-(-1)^j$). On the other hand, substituting $\alpha=1$ and using $\Gamma(1+k+1)=(k+1)!$, we have for $J_1(x)$
$$ J_1(x)=\sum_{k=0}^{\infty}\frac{(-1)^k}{k!\,(k+1)!}\left(\frac x2\right)^{2k+1} $$Comparing the two, the summand of $J_{-1}(x)$ has exactly the same form as the summand of $J_1(x)$ (they coincide if $j$ is read as $k$), so the relation
$$ J_{-1}(x)=-J_1(x) $$has been verified completely for each term of the series ($k=0,1,2,\dots$) (the numerical verification with scipy.special.jv at $x=0.5,1,\dots,10$ also agrees: the maximum error is less than $10^{-15}$).
Exercise 47.2: The energy for $(m=0,\ l=2)$
Solution
The second positive zero of the Bessel function $J_0$ is $\lambda_0(2)=5.5201$ (Table 47.1 of this chapter). Substituting $m=0,\ l=2$ into the energy-level formula for the circular region
$$ E_m(l)=\frac{\hbar^2}{2m_ea^2}\lambda_m^2(l) $$gives
$$ E_0(2)=\frac{\hbar^2}{2m_ea^2}(5.5201)^2=\frac{\hbar^2}{2m_ea^2}\times30.4715\fallingdotseq15.236\cdot\frac{\hbar^2}{m_ea^2} $$(verified with scipy.special.jn\_zeros: $\lambda_0(2)=5.520078\ldots$, $E_0(2)=15.2356\ldots\ \hbar^2/(m_ea^2)$). This is about $5.3$ times the ground-state energy $E_0(1)\approx2.8916\,\hbar^2/(m_ea^2)$ found in Example 47.3, and we see that, even for the same $m=0$, the energy rises considerably by the amount corresponding to one additional oscillation in the radial direction ($l=1\to2$).
Exercise 47.3: The case of a periodic boundary condition in the $z$ direction
Solution
For $Z(z)=D_0\cos\omega z+E_0\sin\omega z$ we consider the periodic boundary conditions $Z(z_0)=Z(-z_0)$ and $Z'(z_0)=Z'(-z_0)$. Since $\cos$ is an even function and $\sin$ is an odd function, we have
$$ Z(z_0)-Z(-z_0)=\bigl(D_0\cos\omega z_0+E_0\sin\omega z_0\bigr)-\bigl(D_0\cos\omega z_0-E_0\sin\omega z_0\bigr)=2E_0\sin\omega z_0 $$The condition for this to equal $0$ is $E_0=0$ or $\sin\omega z_0=0$. Next, using $Z'(z)=-D_0\omega\sin\omega z+E_0\omega\cos\omega z$, we obtain
$$ Z'(z_0)-Z'(-z_0)=\bigl(-D_0\omega\sin\omega z_0+E_0\omega\cos\omega z_0\bigr)-\bigl(D_0\omega\sin\omega z_0+E_0\omega\cos\omega z_0\bigr)=-2D_0\omega\sin\omega z_0 $$and the condition for this to equal $0$ is $D_0=0$ or $\sin\omega z_0=0$.
If we set both $D_0,E_0$ to $0$, then $Z(z)$ would be identically $0$ and would be meaningless as a physical solution. Therefore, in order to satisfy both conditions simultaneously without setting either of $D_0,E_0$ to $0$, we must have
$$ \sin\omega z_0=0\qquad\therefore\quad\omega z_0=n\pi\ (n=1,2,3,\dots)\qquad\text{that is}\qquad\omega=\frac{n\pi}{z_0} $$In this case $D_0,E_0$ can both be chosen freely ($D_0\cos(n\pi z/z_0)+E_0\sin(n\pi z/z_0)$ is a solution as it stands). Whereas the quantization condition in the main text (the Dirichlet-type boundary condition, $Z(\pm z_0)=0$) was $\omega z_0=l\pi/2$ ($l$ a positive integer), for the periodic boundary condition it becomes $\omega z_0=n\pi$ (the condition that the length of the period is the reciprocal of an integer multiple of $2z_0$, that is, that the wavelength is the whole height $2z_0$ of the cylinder divided by an integer), and we see that the spacing of the quantized values is different. We verified with SymPy that, with $D_0,E_0$ kept as symbols, $Z(z_0)-Z(-z_0)=2E_0\sin(\omega z_0)$ and $Z'(z_0)-Z'(-z_0)=-2D_0\omega\sin(\omega z_0)$.
Exercise 47.4: Periodicity in the angular direction and the integrality of $m$
Solution
For $m=2$, substituting $\theta\to\theta+2\pi$ into $\Theta(\theta)=e^{i2\theta}$ gives
$$ \Theta(\theta+2\pi)=e^{i2(\theta+2\pi)}=e^{i2\theta}\cdot e^{i4\pi} $$By Euler's formula, $e^{i4\pi}=\cos4\pi+i\sin4\pi=1+0i=1$ ($4\pi$ is an integer multiple of $2\pi$), so $\Theta(\theta+2\pi)=e^{i2\theta}\times1=\Theta(\theta)$, and the periodicity indeed holds.
On the other hand, for $m=2.3$ (not an integer), we have
$$ \Theta(\theta+2\pi)=e^{i2.3\theta}\cdot e^{i2\pi\times2.3}=e^{i2.3\theta}\cdot e^{i4.6\pi} $$We compute $e^{i4.6\pi}=\cos(4.6\pi)+i\sin(4.6\pi)$. Since $4.6\pi=4\pi+0.6\pi$ and $\cos,\sin$ have period $2\pi$, the $4\pi$ part can be ignored, and $\cos(0.6\pi)\fallingdotseq-0.309$, $\sin(0.6\pi)\fallingdotseq0.951$. Therefore
$$ e^{i4.6\pi}\fallingdotseq-0.309+0.951i\neq1 $$and $\Theta(\theta+2\pi)=(-0.309+0.951i)\,\Theta(\theta)\neq\Theta(\theta)$. That is, if $m$ is not an integer, the periodic boundary condition does not hold. This is a concrete example of the statement “the periodic boundary condition implies $m\in\mathbb Z$” proved in Theorem 47.1 in Section 47.2.3 (we verified with SymPy, by computing the numerical value of $e^{i2\pi\times2.3}$, that it deviates significantly from $1$).
Exercise 47.5: Checking the normalization constant $A_0$ by numerical integration
Solution
Let $a=1$ and use $\lambda_0(1)=2.40483$ (computed with scipy.special.jn\_zeros). Evaluating the integral
$$ A_0^{\text{(integral)}}=\int_0^1 J_0^2(2.40483\,r)\,r\,dr $$by numerical integration (scipy.integrate.quad) gives $A_0^{\text{(integral)}}\fallingdotseq0.1347571$. On the other hand, the formula in Section 47.2.5 of this chapter is $A_0=\dfrac{a^2}2J_1^2(\lambda_0(1))$ ($a=1$), so
$$ A_0^{\text{(formula)}}=\frac12J_1^2(2.40483)=\frac12\times(0.519153)^2\fallingdotseq0.1347571 $$and the result of the numerical integration, $A_0^{\text{(integral)}}$, and the value given by the formula, $A_0^{\text{(formula)}}$, agree completely up to the seventh decimal place (verified with scipy; the difference between the two is less than $10^{-14}$). This supports the correctness, at least in this concrete example, of the general formula (Lommel's integral formula) that we agreed in Section 47.2.5 to “accept and use without proof.”
Exercise 47.6: Expressing $J_2(x)$ in terms of $J_0,J_1$ with the recurrence relation
Solution
Substituting $m=1$ into the recurrence relation $J_{m-1}(x)+J_{m+1}(x)=\dfrac{2m}{x}J_m(x)$ derived in Example 47.5 of this chapter gives
$$ J_0(x)+J_2(x)=\frac{2}{x}J_1(x) $$Solving this for $J_2(x)$, we obtain
$$ J_2(x)=\frac2xJ_1(x)-J_0(x) $$Thus $J_2(x)$ has been expressed using only the lower-order functions $J_0(x),J_1(x)$ (together with elementary multiplication by $2/x$ and subtraction)—when higher-order Bessel functions are handled on a computer, the method of building them up one after another from lower-order functions by a recurrence relation in this way (upward recurrence) is often used. Using scipy.special.jv, we compared the values of the right-hand side $\dfrac2xJ_1(x)-J_0(x)$ and the left-hand side $J_2(x)$ at several points $x=0.5,1,2,\dots,10$ and confirmed that the maximum error is less than $10^{-15}$, so the two agree completely.
Chapter 48 The Schrödinger Equation for the Hydrogen Atom (Spherical Coordinates)
Exercise 48.1: Allowed sets of quantum numbers for $n=2,3$
Solution
The azimuthal quantum number ranges over $\ell=0,1,\dots,n-1$, and for each $\ell$ the magnetic quantum number ranges over $m=-\ell,-\ell+1,\dots,\ell$.
(a) For $n=2$. $\ell$ takes the two values $0,1$ ($\ell\le n-1=1$).
- $\ell=0$: $m=0$ (one possibility, the 2s state)
- $\ell=1$: $m=-1,0,1$ (three possibilities, the 2p state)
In total there are $1+3=4=n^2$ possibilities, which agrees with the formula for the degree of degeneracy in the main text.
(b) For $n=3$. Since $\ell\le n-1=2$, there are three possibilities, $\ell=0,1,2$ (corresponding to 3s, 3p, and 3d).
Exercise 48.2: The associated Laguerre polynomial for $n=3,\ell=0$ (the 3s state)
Solution
Since $n=3,\ell=0$, we have $p=2\ell+1=1$ and $q=n+\ell=3$. By the defining formula, the sum consists of three terms, $k=1,2,3$.
$$ k=1:\ \frac{(-1)^1(3!)^2}{(1-1)!\,1!\,(3-1)!}\alpha^{1-1}=\frac{-36}{1\cdot1\cdot2}=-18 $$ $$ k=2:\ \frac{(-1)^2(3!)^2}{(2-1)!\,2!\,(3-2)!}\alpha^{2-1}=\frac{36}{1\cdot2\cdot1}\alpha=18\alpha $$ $$ k=3:\ \frac{(-1)^3(3!)^2}{(3-1)!\,3!\,(3-3)!}\alpha^{3-1}=\frac{-36}{2\cdot6\cdot1}\alpha^2=-3\alpha^2 $$Therefore we have
$$ L_3^1(\alpha)=-3\alpha^2+18\alpha-18=-3(\alpha^2-6\alpha+6) $$We now check that this satisfies the equation $\alpha y''+(2-\alpha)y'+2y=0$ for the case $p=1,q=3$ ($p+1=2$, $q-p=2$). If $y=-3\alpha^2+18\alpha-18$, then $y'=-6\alpha+18$ and $y''=-6$, so the left-hand side becomes
$$ \alpha(-6)+(2-\alpha)(-6\alpha+18)+2(-3\alpha^2+18\alpha-18) $$Expanding this gives $-6\alpha+(-12\alpha+36+6\alpha^2-18\alpha)+(-6\alpha^2+36\alpha-36)=-6\alpha-30\alpha+36+6\alpha^2-6\alpha^2+36\alpha-36=0$ (the term linear in $\alpha$: $-6-30+36=0$; the constant term: $36-36=0$; the quadratic term: $6-6=0$), so it is indeed $0$ (verified with SymPy).
Exercise 48.3: The associated Legendre functions for $\ell=1$
Solution
The Legendre polynomial for $\ell=1$ is $P_1(x)=x$.
$m=0$: $\Theta(x)=b_0(1-x^2)^0\dfrac{d^0P_1}{dx^0}=b_0x$. Returning to $x=\cos\theta$, we get $\Theta(\theta)=b_0\cos\theta$.
$m=1$: $\Theta(x)=b_0(1-x^2)^{1/2}\dfrac{dP_1}{dx}=b_0\sqrt{1-x^2}\cdot1=b_0\sqrt{1-x^2}$. Since $1-x^2=1-\cos^2\theta=\sin^2\theta$ ($\sin\theta\ge0$, $\theta\in[0,\pi]$), we get $\Theta(\theta)=b_0\sin\theta$.
$m=-1$: As confirmed in the main text, the right-hand side of the formula is determined by $|m|$, so we use the same formula as for $|m|=1$. Therefore $\Theta(\theta)=b_0\sin\theta$ (exactly the same functional form as for $m=1$; the difference appears in the sign of the exponent in the azimuthal part $\bar\Phi_m(\varphi)=C_0e^{im\varphi}$ that multiplies it in the complete wave function—whether it is $e^{+i\varphi}$ or $e^{-i\varphi}$).
Exercise 48.4: Derivation of the Rydberg constant
Solution
The energy of the photon emitted when the principal quantum number drops from $n_2$ to $n_1$ ($n_1\lt n_2$) is the energy of the higher level minus that of the lower level, $E_{n_2}-E_{n_1}$. Substituting the energy-level formula $E_n=-\dfrac{m_ee_0^4}{8\varepsilon_0^2h^2}\cdot\dfrac1{n^2}$, we obtain
$$ E_{n_2}-E_{n_1}=-\frac{m_ee_0^4}{8\varepsilon_0^2h^2}\left(\frac1{n_2^2}-\frac1{n_1^2}\right)=\frac{m_ee_0^4}{8\varepsilon_0^2h^2}\left(\frac1{n_1^2}-\frac1{n_2^2}\right) $$(since $n_1\lt n_2$, we have $1/n_1^2\gt1/n_2^2$, so the right-hand side is positive—consistent with the physical direction, namely that energy is emitted). The energy of the photon is $\dfrac{hc}{\lambda}$, so
$$ \frac{hc}{\lambda}=\frac{m_ee_0^4}{8\varepsilon_0^2h^2}\left(\frac1{n_1^2}-\frac1{n_2^2}\right) $$Dividing both sides by $hc$ gives
$$ \frac1\lambda=\frac{m_ee_0^4}{8\varepsilon_0^2h^3c}\left(\frac1{n_1^2}-\frac1{n_2^2}\right) $$Comparing this with the form $\dfrac1\lambda=R_H\left(\dfrac1{n_1^2}-\dfrac1{n_2^2}\right)$, we find
$$ R_H=\frac{m_ee_0^4}{8\varepsilon_0^2h^3c} $$Substituting numerical values ($m_e=9.109\times10^{-31}\,\text{kg}$, $e_0=1.602\times10^{-19}\,\text C$, $\varepsilon_0=8.854\times10^{-12}\,\text{F/m}$, $h=6.626\times10^{-34}\,\text{J\,s}$, $c=2.998\times10^8\,\text{m/s}$), we obtain $R_H\approx1.097\times10^7\,\text m^{-1}$, which agrees with the experimentally known value of the Rydberg constant (verified with SymPy/numpy using the precise values in scipy.constants—they agree to within 1%).
Exercise 48.5: The radius at which the radial probability density of the 1s state is maximal
Solution
Since $R_{10}(r)\propto e^{-r/a_0}$, the radial probability density is $f(r):=r^2R_{10}(r)^2\propto r^2e^{-2r/a_0}$ (the constant of proportionality does not affect the value of $r$ that gives the maximum, so we may take it to be $1$). Using the product rule for derivatives, we get
$$ f'(r)=2re^{-2r/a_0}+r^2\cdot\left(-\frac2{a_0}\right)e^{-2r/a_0}=2re^{-2r/a_0}\left(1-\frac r{a_0}\right) $$Here we factored out the common factor $2re^{-2r/a_0}$. The derivative satisfies $f'(r)=0$ exactly when $r=0$ or $1-r/a_0=0$ (that is, $r=a_0$), because $e^{-2r/a_0}$ is never $0$. At $r=0$ we have $f(0)=0$ (the probability density is at its minimum, and this is a boundary endpoint, not a local maximum). We check whether $r=a_0$ is a local maximum by means of the second derivative.
$$ f''(r)=2e^{-2r/a_0}\left(1-\frac ra_0\right)+2r\cdot\left(-\frac2{a_0}\right)e^{-2r/a_0}\left(1-\frac r{a_0}\right)+2re^{-2r/a_0}\cdot\left(-\frac1{a_0}\right) $$Substituting $r=a_0$ into this expression, we find that $1-r/a_0=0$, so all the terms containing this factor vanish and only the last term remains.
$$ f''(a_0)=2a_0e^{-2}\cdot\left(-\frac1{a_0}\right)=-2e^{-2}\lt0 $$Since the second derivative is negative, $f(r)$ has a local maximum at $r=a_0$ (if we make an increase–decrease table, we see that $f'(r)\gt0$ (increasing) for $0\lt r\lt a_0$ and $f'(r)\lt0$ (decreasing) for $r\gt a_0$, so $r=a_0$ is the only local maximum and is also the global maximum of the graph). Therefore, the radius at which the radial probability density is maximal is
$$ r=a_0 $$—exactly the Bohr radius itself. This means that the statement of Bohr's atomic model, “the electron moves on a circular orbit of radius $a_0$,” corresponds precisely to the answer of the Schrödinger equation, “the probability of finding the electron near $r=a_0$ is the highest” (in the picture given by the Schrödinger equation, however, the electron is not located at the single point $r=a_0$ but is distributed with some spread around $r=a_0$—see the 1s curve in Figure 48.4).
Exercise 48.6: Orthogonality of the azimuthal solutions
Solution
The complex conjugate of $\bar\Phi_m(\varphi)=C_0e^{im\varphi}$ is obtained by reversing only the sign in the exponent: $\overline{\bar\Phi_{m'}(\varphi)}=\overline{C_0}e^{-im'\varphi}$. Therefore,
$$ \int_0^{2\pi}\bar\Phi_m(\varphi)\overline{\bar\Phi_{m'}(\varphi)}\,\dd\varphi =|C_0|^2\int_0^{2\pi}e^{im\varphi}e^{-im'\varphi}\,\dd\varphi =|C_0|^2\int_0^{2\pi}e^{i(m-m')\varphi}\,\dd\varphi $$Let $k:=m-m'$ (since $m\neq m'$, it is an integer such that $k\neq0$). By the formula for the antiderivative of the exponential function ($\displaystyle\int e^{ik\varphi}\dd\varphi=\dfrac{e^{ik\varphi}}{ik}$, $k\neq0$), we obtain
$$ \int_0^{2\pi}e^{ik\varphi}\,\dd\varphi=\left[\frac{e^{ik\varphi}}{ik}\right]_0^{2\pi}=\frac{e^{i2\pi k}-e^{0}}{ik}=\frac{1-1}{ik}=0 $$(since $k$ is an integer, Euler's formula gives $e^{i2\pi k}=\cos2\pi k+i\sin2\pi k=1+0=1$). Therefore, when $m\neq m'$ the integral is $0$ (when $m=m'$ the integrand is identically $1$ and the integral is $2\pi\neq0$—this corresponds to the “normal” (normalization) part of “orthonormal”).
The reason this result guarantees the orthogonality of two hydrogen-atom states with different magnetic quantum numbers is as follows. The inner product of the complete wave functions (a triple integral) can be decomposed into the product of three integrals, over the radial, zenith-angle, and azimuthal variables (because it is an integral of functions whose variables have been separated).
$$ \int\psi_{n\ell m}\,\overline{\psi_{n'\ell'm'}}\,r^2\sin\theta\,\dd r\,\dd\theta\,\dd\varphi =\left(\int_0^\infty R_{n\ell}R_{n'\ell'}\,r^2\dd r\right)\left(\int_0^\pi\Theta_{\ell m}\Theta_{\ell'm'}\sin\theta\,\dd\theta\right)\left(\int_0^{2\pi}\bar\Phi_m\overline{\bar\Phi_{m'}}\,\dd\varphi\right) $$If even one of the three integrals on the right-hand side is $0$, the whole product (the triple integral) is also $0$. As we have just shown, when $m\neq m'$ the azimuthal integral (the third factor) is automatically $0$, so regardless of the values of the radial and zenith-angle integrals, $\psi_{n\ell m}$ and $\psi_{n'\ell'm'}$ ($m\neq m'$) are orthogonal. This is the simplest concrete example one can verify of the general theorem in quantum mechanics that “eigenfunctions corresponding to different eigenvalues are orthogonal” (which is beyond the scope of this book).
← Back to Chapter 48, “The Schrödinger Equation for the Hydrogen Atom (Spherical Coordinates)”
Chapter 49 Statistical Mechanics and Black-Body Radiation — The Boltzmann Distribution and Planck's Radiation Law
Exercise 49.1: The altitude at which the density is halved
Solution
In the altitude distribution of gas molecules $N(z)=N(0)e^{-mgz/kT}$, we find the altitude $z$ at which $N(z)=N(0)/2$. Dividing both sides by $N(0)$ gives
$$ e^{-\frac{mgz}{kT}}=\frac12 $$Taking the natural logarithm of both sides (on the left, $\ln e^{X}=X$; on the right, $\ln\dfrac12=-\ln2$), we obtain
$$ -\frac{mgz}{kT}=\ln\frac12=-\ln2 $$Multiplying both sides by $-1$ and solving for $z$, we obtain
$$ z=\frac{kT\ln2}{mg} $$Next, we substitute concrete numerical values. Taking the mean molecular weight of air to be $28.97\ \mathrm{g/mol}$, the mass per molecule is the same as in Example 49.1:
$$ m=\frac{28.97\times10^{-3}}{6.02214076\times10^{23}}\approx4.8106\times10^{-26}\ \mathrm{kg} $$Substituting $k=1.380649\times10^{-23}\ \mathrm{J/K}$, $T=288\ \mathrm K$, $g=9.8\ \mathrm{m/s^2}$, and $\ln2\approx0.693147$, we obtain
$$ z=\frac{(1.380649\times10^{-23})\times288\times0.693147}{(4.8106\times10^{-26})\times9.8}\approx5846\ \mathrm m\approx5.85\ \mathrm{km} $$This altitude (verified with SymPy/numpy) is even higher than Mt. Fuji (elevation about $3.8\ \mathrm{km}$) and amounts to about 60% of the cruising altitude of passenger aircraft (about $10\ \mathrm{km}$, Example 49.1). In Example 49.1 we confirmed that “at an altitude of 10,000 m the density drops to about 31% of the surface value,” and the present result does not contradict it—because the ratio $0.306$ at $1$ × 10,000 m is much smaller than $1/2$, the altitude $z\approx5.85\ \mathrm{km}$ at which the density is halved must of course lie below $1$ × 10,000 m, and indeed it does.
Exercise 49.2: A concrete example with $h\nu\ll kT$
Solution
First we compute the value of $h\nu/kT$. Using $h=6.62607015\times10^{-34}\ \mathrm{J\,s}$, $\nu=1\ \mathrm{GHz}=1.0\times10^9\ \mathrm{Hz}$, $k=1.380649\times10^{-23}\ \mathrm{J/K}$, and $T=300\ \mathrm K$, we have
$$ h\nu=(6.62607015\times10^{-34})\times(1.0\times10^9)\approx6.626\times10^{-25}\ \mathrm J $$ $$ kT=(1.380649\times10^{-23})\times300\approx4.142\times10^{-21}\ \mathrm J $$ $$ \frac{h\nu}{kT}\approx\frac{6.626\times10^{-25}}{4.142\times10^{-21}}\approx1.60\times10^{-4} $$Indeed, this satisfies $h\nu/kT\approx1.60\times10^{-4}\ll1$ (compared with $h\nu/kT\approx80$ for visible light in Example 49.2, it is in fact smaller by more than $5$ orders of magnitude. For radio waves, whose frequency is far lower than that of visible light, this means that the energy $h\nu$ of a single photon is smaller than the thermal energy $kT$ by orders of magnitude, and that quantum effects can be almost entirely neglected).
Next, for these $\nu,T$, we compare numerically the values of Planck's formula (Theorem 49.2) and the Rayleigh–Jeans formula (Formula 49.1). The coefficient $8\pi\nu^2/c^3$ is common to both, so it suffices to compare only the remaining factors. The factor in Planck's formula is
$$ \frac{h\nu}{e^{h\nu/kT}-1} $$Substituting $h\nu/kT\approx1.60\times10^{-4}$ and computing numerically (the value of the denominator is very close to that given by $e^{1.60\times10^{-4}}-1\approx1.60\times10^{-4}$), the value of Planck's formula is $E_{\text{Planck}}\approx3.8632\times10^{-27}$ (the value of the energy per unit volume per unit frequency, including $8\pi\nu^2/c^3$, in SI units). On the other hand, using $kT$ as it is, the value of the Rayleigh–Jeans formula is $E_{\text{RJ}}\approx3.8635\times10^{-27}$. The relative difference is
$$ \frac{|E_{\text{Planck}}-E_{\text{RJ}}|}{E_{\text{RJ}}}\approx8.0\times10^{-5} $$As computed above (verified with SymPy/numpy), the two values agree so well that they coincide to four places after the decimal point. This confirms that the analytic approximation made in Section 49.3.2 ($e^{h\nu/kT}\fallingdotseq1+h\nu/kT$; in the limit $h\nu/kT\to0$, Planck's formula coincides with the Rayleigh–Jeans formula) also holds true in actual numerical values.
Exercise 49.3: Expanding the high-frequency limit yourself
Solution
We rewrite the fraction in Planck's formula using $X:=e^{-h\nu/kT}$ (when $h\nu/kT\gg1$, $X$ is a small positive number close to $0$). First, multiplying the numerator and denominator of the fraction whose denominator is $e^{h\nu/kT}-1$ by $e^{-h\nu/kT}=X$, we get
$$ \frac{1}{e^{h\nu/kT}-1}=\frac{1}{e^{h\nu/kT}-1}\times\frac{X}{X}=\frac{X\cdot e^{-h\nu/kT}\cdot e^{h\nu/kT}}{X\left(e^{h\nu/kT}-1\right)} $$This is also possible, but let us transform the expression directly, in a way that is easier to follow. Noting that $e^{h\nu/kT}=1/X$, we have
$$ \frac{1}{e^{h\nu/kT}-1}=\frac{1}{\dfrac1X-1}=\frac{1}{\dfrac{1-X}{X}}=\frac{X}{1-X} $$(We have simply rewritten a complex fraction as a product with the reciprocal.) Now, supposing that $X$ is small ($X\ll1$), we expand $\dfrac{X}{1-X}$ as a power series. Since $\dfrac1{1-X}=1+X+X^2+\cdots$ (the sum formula for an infinite geometric series for $|X|\lt1$, the same formula used in Section 49.4.1), we have
$$ \frac{X}{1-X}=X\left(1+X+X^2+\cdots\right)=X+X^2+X^3+\cdots $$When $X$ is sufficiently small, the terms from $X^2$ onward are even smaller than $X$ itself and can be neglected, so that in the $1$st-order approximation we obtain
$$ \frac{1}{e^{h\nu/kT}-1}=\frac{X}{1-X}\fallingdotseq X=e^{-h\nu/kT} $$(This was also verified with SymPy's series expansion \texttt{series}: it gives $X+O(X^2)$—the lowest-order term is exactly $X$.) Substituting this into Planck's formula (Theorem 49.2), we obtain
$$ E(\nu)\,d\nu=\frac{8\pi\nu^2}{c^3}\cdot h\nu\cdot\frac{1}{e^{h\nu/kT}-1}\,d\nu\ \fallingdotseq\ \frac{8\pi\nu^2}{c^3}\cdot h\nu\cdot e^{-h\nu/kT}\,d\nu $$This is exactly the same expression as Wien's radiation law (Formula 49.2). In Section 49.3.1 of the main text we started from the approximation that “the $-1$ in the denominator is negligibly small,” but here, independently, by a different route—a power series expansion in $X=e^{-h\nu/kT}$—we have arrived at the same conclusion (in the high-frequency limit, Planck's formula coincides with Wien's formula).
Exercise 49.4: The density of states in two dimensions
Solution
We apply the three-dimensional argument of Section 49.5.2 to two-dimensional standing waves confined in a square membrane of side $L$ (area $A=L^2$). For the same reason as in three dimensions (quantization of the wavenumbers by the boundary conditions), the wavenumbers in the $x,y$ directions take the discrete values
$$ k_1=\frac{n_1\pi}{L},\qquad k_2=\frac{n_2\pi}{L}\qquad(n_1,n_2=1,2,3,\dots) $$The number of pairs $(n_1,n_2)$ for which the magnitude $K=\sqrt{k_1^2+k_2^2}$ of the wave vector $\bm k=(k_1,k_2)$ is at most a given value equals the number of lattice points inside the circle of radius $K$ centered at the origin, within “the first quadrant of the two-dimensional lattice, where $n_1,n_2$ are both positive.” The “$1/8$ of a sphere (the positive octant)” of the three-dimensional case is replaced in two dimensions by “$1/4$ of a circle (the first quadrant).” The area of a circle of radius $K$ is $\pi K^2$, and we consider $1/4$ of it. The lattice points are arranged at intervals of $\pi/L$ in each of the $x,y$ directions, so the area occupied by one lattice point is $(\pi/L)^2$. Therefore, the number of pairs $(n_1,n_2)$ (pairs of positive integers) for which the magnitude of the wavenumber is at most $K$ is
$$ \frac14\cdot\pi K^2\Big/\left(\frac\pi L\right)^2=\frac{\pi K^2L^2}{4\pi^2}=\frac{K^2L^2}{4\pi} $$As in the three-dimensional case, an electromagnetic wave has two polarization degrees of freedom, so doubling this, the actual total number of modes is
$$ N_{\text{2D}}(K)=2\times\frac{K^2L^2}{4\pi}=\frac{K^2L^2}{2\pi}=\frac{K^2A}{2\pi} $$($A=L^2$ is the area of the square.) Next, we rewrite the wavenumber $K$ in terms of the frequency $\nu$. Substituting the same relation $K=2\pi\nu/c$ as in the three-dimensional case, we obtain
$$ N_{\text{2D}}(\nu)=\frac{1}{2\pi}\left(\frac{2\pi\nu}{c}\right)^2A=\frac{1}{2\pi}\cdot\frac{4\pi^2\nu^2}{c^2}\,A=\frac{2\pi\nu^2}{c^2}\,A $$This is “the total number of modes with frequency at most $\nu$.” Differentiating it with respect to $\nu$ gives the increment, for the area $A$, in “the number of modes between frequency $\nu$ and $\nu+d\nu$.”
$$ \frac{dN_{\text{2D}}}{d\nu}=\frac{4\pi\nu}{c^2}\,A $$Finally, to obtain the density of states per unit area, we simply divide by $A$.
$$ \rho_{\text{2D}}(\nu)=\frac1A\frac{dN_{\text{2D}}}{d\nu}=\frac{4\pi\nu}{c^2} $$(Verified with SymPy—we retraced exactly the same steps as in the three-dimensional case, now in two dimensions: from the computation of the area of a circle of radius $K$, through the substitution of $K=2\pi\nu/c$, to the differentiation with respect to $\nu$.)
Compared with the three-dimensional result $\rho(\nu)=8\pi\nu^2/c^3\propto\nu^2$, in two dimensions $\rho_{\text{2D}}(\nu)\propto\nu^1$: the power of $\nu$ is lower by one. This is because each time the dimension of space decreases by one, the exponent that expresses the volume of a “(hyper)sphere of radius $K$” ($K^3$ in three dimensions, $K^2$ in two dimensions) decreases by one; and even after the operation of differentiating with respect to $\nu$ to lower the exponent by one ($K^3\to\nu^3\to$ differentiation gives $\nu^2$ in three dimensions; $K^2\to\nu^2\to$ differentiation gives $\nu^1$ in two dimensions), we see that the difference in dimension remains as it is, as the difference in the $\nu$-dependence of $\rho(\nu)$.
Exercise 49.5: The total energy of Wien's formula converges
Solution
Wien's radiation law (Formula 49.2) reads $E(\nu)\,d\nu=\dfrac{8\pi}{c^3}\nu^2\cdot h\nu\cdot e^{-h\nu/kT}\,d\nu=\dfrac{8\pi h}{c^3}\nu^3e^{-h\nu/kT}\,d\nu$. If we collect the part that does not depend on $\nu$ into the constant $C:=8\pi h/c^3$, then $E(\nu)=C\nu^3e^{-h\nu/kT}$. The total energy we seek is
$$ \int_0^\infty E(\nu)\,d\nu=C\int_0^\infty \nu^3e^{-h\nu/kT}\,d\nu $$To compute this integral, we change to the dimensionless variable $x:=h\nu/kT$. Then $\nu=\dfrac{kT}{h}x$, and differentiating both sides gives $d\nu=\dfrac{kT}{h}dx$ (since $k,T,h$ are constants independent of $\nu$, they come out of the differentiation as constants of proportionality). The limits of integration remain unchanged: $\nu:0\to\infty$ corresponds to $x:0\to\infty$ (as $\nu\to\infty$, $x\to\infty$; at $\nu=0$, $x=0$). Therefore,
$$ \int_0^\infty \nu^3e^{-h\nu/kT}\,d\nu=\int_0^\infty\left(\frac{kT}{h}x\right)^3e^{-x}\cdot\frac{kT}{h}\,dx=\left(\frac{kT}{h}\right)^4\int_0^\infty x^3e^{-x}\,dx $$(We combined $\left(\dfrac{kT}h\right)^3\times\dfrac{kT}h=\left(\dfrac{kT}h\right)^4$.) Here, $\displaystyle\int_0^\infty x^3e^{-x}\,dx$ is exactly the case $n=4$ of the gamma function $\Gamma(n)=\displaystyle\int_0^\infty x^{n-1}e^{-x}dx$ studied in Chapter 32, and $\Gamma(n)=(n-1)!$ holds for positive integers $n$ (this can be shown by repeated integration by parts), so we obtain the finite value
$$ \int_0^\infty x^3e^{-x}\,dx=\Gamma(4)=3!=6 $$Therefore, the total energy converges to the finite value
$$ \int_0^\infty E(\nu)\,d\nu=C\left(\frac{kT}{h}\right)^4\times6=\frac{8\pi h}{c^3}\cdot\frac{6(kT)^4}{h^4}=\frac{48\pi(kT)^4}{c^3h^3} $$(Also verified with SymPy's definite integral: $\displaystyle\int_0^\infty C\nu^3e^{-h\nu/kT}d\nu=6C(kT)^4/h^4$.)
For the Rayleigh–Jeans formula (Example 49.3), the integral diverged because the integrand was $\nu^2$ (a polynomial that does not decay even as $\nu\to\infty$). In Wien's formula, by contrast, the exponential function $e^{-h\nu/kT}$ approaches $0$ faster than any polynomial as $\nu\to\infty$ (as was also noted in the Intuition box of Section 49.2.3), so the decay of the exponential completely cancels the growth of the polynomial $\nu^3$, and the integral settles at a finite value. This is the mathematical heart of the reason why Wien's formula (and Planck's formula, which contains it) does not suffer an ultraviolet catastrophe.
Exercise 49.6: Continuing the original notes (Advanced)
Solution
In Section 49.5.1 of the main text, the product-to-sum formula is used twice to reach the intermediate expression
$$ \sin\frac{\pi n_1}{L}x\cdot\sin\frac{\pi n_2}{L}y\cdot\sin\frac{\pi n_3}{L}z =-\frac12\sin\frac{\pi n_3}Lz\left\{\cos\frac{\pi(n_1x+n_2y)}L-\cos\frac{\pi(n_1x-n_2y)}L\right\} $$Then, expanding only the product with the first term $\cos\dfrac{\pi(n_1x+n_2y)}L$ inside $\{\ \}$, the original notes begin to write
$$ -\frac12\sin\frac{\pi n_3}Lz\cdot\cos\frac{\pi(n_1x+n_2y)}L=-\frac14\left[\sin\frac{\pi(n_3z+n_1x+n_2y)}L\right. $$but end there, with the line unfinished. Let us complete the rest. To simplify the notation, let $A:=\dfrac{\pi n_1}Lx$, $B:=\dfrac{\pi n_2}Ly$, and $C:=\dfrac{\pi n_3}Lz$ (in this notation the intermediate expression in the main text can be written as $\sin A\sin B\sin C=-\dfrac12\sin C\{\cos(A+B)-\cos(A-B)\}$).
The first term (the term the original notes had begun to write). Using the formula $\sin\alpha\cos\beta=\dfrac12\{\sin(\alpha+\beta)+\sin(\alpha-\beta)\}$ with $\alpha=C$ and $\beta=A+B$, we obtain
$$ -\frac12\sin C\cos(A+B)=-\frac12\cdot\frac12\bigl\{\sin(C+A+B)+\sin(C-A-B)\bigr\}=-\frac14\sin(C+A+B)-\frac14\sin(C-A-B) $$This gives the expression above, and it shows that the contents of the large square bracket $[\ $ that the original notes left open split into two terms: $\sin(C+A+B)$ (exactly the term written in the original notes) and one more term, $\sin(C-A-B)$—that is, closing the square bracket of the original notes gives
$$ -\frac14\left[\sin\frac{\pi(n_3z+n_1x+n_2y)}L+\sin\frac{\pi(n_3z-n_1x-n_2y)}L\right] $$This is the result.
The second term (the $-\cos(A-B)$ term inside $\{\ \}$). Note that inside the $\{\ \}$ of the intermediate expression, there is no $-$ in front of $\cos(A+B)$, while a $-$ is attached in front of $\cos(A-B)$ (as in $\{\cos(A+B)-\cos(A-B)\}$). Multiplying this further by the leading factor $-\dfrac12\sin C$ gives $-\dfrac12\sin C\times\bigl(-\cos(A-B)\bigr)=+\dfrac12\sin C\cos(A-B)$, so the sign is reversed once more and becomes plus. Using the same formula with $\alpha=C$ and $\beta=A-B$, we obtain
$$ \frac12\sin C\cos(A-B)=\frac12\cdot\frac12\bigl\{\sin(C+A-B)+\sin(C-(A-B))\bigr\}=\frac14\sin(C+A-B)+\frac14\sin(C-A+B) $$That is what we obtain.
Collecting the four terms. Adding the two computations above, we obtain the final complete expansion.
$$ \sin\frac{\pi n_1}Lx\cdot\sin\frac{\pi n_2}Ly\cdot\sin\frac{\pi n_3}Lz =-\frac14\sin\frac{\pi(n_3z+n_1x+n_2y)}L-\frac14\sin\frac{\pi(n_3z-n_1x-n_2y)}L+\frac14\sin\frac{\pi(n_3z+n_1x-n_2y)}L+\frac14\sin\frac{\pi(n_3z-n_1x+n_2y)}L $$This is an expression in which terms of the form $\pm\dfrac14\sin\dfrac{\pi(\pm n_1x\pm n_2y\pm n_3z)}L$ appear in exactly four sign combinations (the sign of $n_3z$ is always taken to be positive, and among the sign combinations $++,+-,-+,--$ of $n_1x,n_2y$, the four independent ones appear), and it agrees with the form announced in the “Caution” of Section 49.5.1 of the main text, namely an expansion into four terms (verified with SymPy that the values of the left- and right-hand sides agree when numerical values are substituted—and even with $n_1,n_2,n_3,x,y,z,L$ left as symbols, we confirmed, using the expansion rules for trigonometric functions, that the two sides are identically equal).
Why can't we count the number this way? What this expansion computes is an **identity** that rewrites a single standing wave $\sin\dfrac{\pi n_1}Lx\sin\dfrac{\pi n_2}Ly\sin\dfrac{\pi n_3}Lz$ (one particular, definite waveform as a function of $x,y,z$) as a superposition of $4$ plane traveling waves $\sin\dfrac{\pi(\pm n_1x\pm n_2y\pm n_3z)}L$. This rearrangement is a relation that holds each time we fix one triple of integers $(n_1,n_2,n_3)$ (that is, each time we choose one standing wave), and it does not touch the values of $n_1,n_2,n_3$ themselves at all—the same $n_1,n_2,n_3$ as before the expansion remain unchanged in the expanded expression. Therefore, however far we push this expansion, we cannot extract from it the information “how many triples $(n_1,n_2,n_3)$ there are in all.” The operation of decomposing a waveform into components and the operation of counting the total number of sets of components (or of the original quantum numbers) are entirely different tasks.
By contrast, the method of Section 49.5.2, which counts the lattice points in $k$-space, does not go into the waveforms of the individual standing waves (their form as functions of $x,y,z$) at all. It counts the “number” directly, using only the geometry of wavenumber space itself—“where in $k$-space, and how densely, the wavenumber triples $(k_1,k_2,k_3)=\dfrac\pi L(n_1,n_2,n_3)$ that satisfy the boundary conditions are arranged” (the lattice spacing $\pi/L$ and the volume of a ball of radius $K$). The route that the original notes were following on their last page (decomposing the waveform by product-to-sum formulas) cannot, even if carried through to the end, reach the density of states $\rho(\nu)$ on its own—this is why this chapter switches to the standard counting method in Section 49.5.2.