A natural function with discontinuities (Part 2)

Yesterday, I began a short series motivated by the following article from the American Mathematical Monthly.

Today, I’d like to talk about the how this function was obtained.

If $180^\circ \le latex \theta \le 360^\circ$, then clearly $r = R$. The original circle of radius $R$ clearly works. Furthermore, any circle that inscribes the grey circular region (centered at the origin) must include the points $(-R,0)$ and $(R,0)$, and the distance between these two points is $2R$. Therefore, the diameter of any circle that works must be at least $2R$, so a smaller circle can’t work.

The other extreme is also easy: if $\theta =0^\circ$, then the “circular region” is really just a single point.

Let’s now take a look at the case $0 < \theta \le 90^\circ$. The smallest circle that encloses the grey region must have the points $(0,0)$, $(R,0)$, and $(R \cos \theta, R \sin \theta)$ on its circumference, and so the center of the circle will be equidistant from these three points.

The center must be on the angle bisector (the dashed line depicted in the figure) since the bisector is the locus of points equidistant from $(R,0)$ and $(R \cos \theta, R \sin \theta)$. Therefore, we must find the point on the bisector that is equidistant from $(0,0)$ and $(R,0)$. This point forms an isosceles triangle, and so the distance $r$ can be found using trigonometry:

$\cos \displaystyle \frac{\theta}{2} = \displaystyle \frac{R/2}{r}$,

or

$r = \displaystyle \frac{R}{2} \sec \frac{\theta}{2}$.

This logic works up until $\theta = 90^\circ$, when the isosceles triangle will be a 45-45-90 triangle. However, when $\theta > 90^\circ$, a different picture will be needed. I’ll consider this in tomorrow’s post.

How I Impressed My Wife: Part 5b

Amazingly, the integral below has a simple solution:

$Q = \displaystyle \int_0^{2\pi} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x} = \displaystyle \frac{2\pi}{|b|}.$

Even more amazingly, the integral $Q$ ultimately does not depend on the parameter $a$. For several hours, I tried to figure out a way to demonstrate that $Q$ is independent of $a$, but I couldn’t figure out a way to do this without substantially simplifying the integral, but I’ve been unable to do so (at least so far).

So here’s what I have been able to develop to prove that $Q$ is independent of $a$ without directly computing the integral $Q$.

Earlier in this series, I showed that

$Q = 2 \displaystyle \int_{-\pi/2}^{\pi/2} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

$= 2 \displaystyle \int_{-\pi/2}^{\pi/2} \frac{\sec^2 x dx}{1 + 2 a \tan x + (a^2 + b^2) \tan^2 x}$

$= 2 \displaystyle \int_{-\infty}^{\infty} \frac{du}{1 + 2 a u + (a^2+b^2) u^2}$

$= \displaystyle \frac{2}{a^2+b^2} \int_{-\infty}^{\infty} \frac{dv}{v^2 + \displaystyle \frac{b^2}{(a^2+b^2)^2} }$

$= \displaystyle 2 \int_{-\infty}^{\infty} \frac{(a^2+ b^2) dv}{(a^2 + b^2) v^2 + b^2 }$

Yesterday, I showed used the substitution $w = (a^2 + b^2) v$ to show that $Q$ was independent of $a$. Today, I’ll use a different method to establish the same result. Let

$Q(a) = \displaystyle 2 \int_{-\infty}^{\infty} \frac{(a^2+b^2) dv}{(a^2+b^2)^2 v^2 + b^2 }$.

Notice that I’ve written this integral as a function of the parameter $a$. I will demonstrate that $Q'(a) = 0$, so that $Q(c)$ is a constant with respect to $a$. In other words, $Q(a)$ does not depend on $a$.

To do this, I differentiate under the integral sign with respect to $a$ (as opposed to $x$) using the Quotient Rule:

$Q'(a) = \displaystyle 2 \int_{-\infty}^{\infty} \frac{ 2a \left[ (a^2+b^2)^2 v^2 + b^2\right] - 2 (a^2+b^2) \cdot (a^2+b^2) v^2 \cdot 2a }{\left[ (a^2+b^2)^2 v^2 + b^2 \right]^2} dv$

$Q'(a) = \displaystyle 4a \int_{-\infty}^{\infty} \frac{(a^2+b^2)^2 v^2 + b^2- 2 (a^2+b^2)^2 v^2}{\left[ (a^2+b^2)^2 v^2 + b^2 \right]^2} dv$

$Q'(a) = \displaystyle 4a \int_{-\infty}^{\infty} \frac{b^2-(a^2+b^2)^2 v^2}{\left[ (a^2+b^2)^2 v^2 + b^2 \right]^2} dv$

I now apply the trigonometric substitution $v = \displaystyle \frac{b}{a^2+b^2} \tan \theta$, so that

$(a^2+b^2)^2 v^2 = (a^2+b^2)^2 \displaystyle \left[ \frac{b}{a^2+b^2} \tan \theta \right]^2 = b^2 \tan^2 \theta$

and

$dv = \displaystyle \frac{b}{a^2+b^2} \sec^2 \theta \, d\theta$

The endpoints of integration change from $-\infty < v < \infty$ to $-\pi/2 < \theta < \pi/2$, and so

$Q'(a) = \displaystyle 4a \int_{-\pi/2}^{\pi/2} \frac{b^2- b^2 \tan^2 \theta}{\left[ b^2 \tan^2 \theta + b^2 \right]^2} \frac{b}{a^2+b^2} \sec^2 \theta \, d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} \frac{[1- \tan^2 \theta] \sec^2 \theta}{\left[ \tan^2 \theta +1 \right]^2} d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} \frac{[1-\tan^2 \theta] \sec^2 \theta}{\left[ \sec^2 \theta \right]^2} d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} \frac{[1-\tan^2 \theta] \sec^2 \theta}{\sec^4 \theta} d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} \frac{[1- \tan^2 \theta]}{\sec^2 \theta} d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} [1- \tan^2 \theta] \cos^2 \theta \, d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} [\cos^2 \theta -\sin^2 \theta] d\theta$

$= \displaystyle \frac{4ab^3}{a^2+b^2} \int_{-\pi/2}^{\pi/2} \cos 2\theta \, d\theta$

$= \displaystyle \left[ \frac{2ab^3}{a^2+b^2} \sin 2\theta \right]^{\pi/2}_{-\pi/2}$

$= \displaystyle \frac{2ab^3}{a^2+b^2} \left[ \sin \pi - \sin (-\pi) \right]$

$= \displaystyle \frac{2ab^3}{a^2+b^2} \left[ 0- 0 \right]$

$= 0$.

I’m not completely thrilled with this demonstration that $Q$ is independent of $a$, mostly because I had to do so much simplification of the integral $Q$ to get this result. As I mentioned in yesterday’s post, I’d love to figure out a way to directly start with

$Q = \displaystyle \int_0^{2\pi} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

and demonstrate that $Q$ is independent of $a$, perhaps by differentiating $Q$ with respect to $a$ and demonstrating that the resulting integral must be equal to 0. However, despite several hours of trying, I’ve not been able to establish this result without simplifying $Q$ first.

How I Impressed My Wife: Part 2c

Some husbands try to impress their wives by lifting extremely heavy objects or other extraordinary feats of physical prowess.

That will never happen in the Quintanilla household in a million years.

But she was impressed that I broke an impasse in her research and resolved a discrepancy between Mathematica 4 and Mathematica 8 by finding the following integral by hand in less than an hour:

$Q = \displaystyle \int_0^{2\pi} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

In this series, I’ll explore different ways of evaluating this integral.So far in this series, I’ve shown that

$Q = 2 \displaystyle \int_{-\pi/2}^{\pi/2} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

$= 2 \displaystyle \int_{-\pi/2}^{\pi/2} \frac{\sec^2 x dx}{1 + 2 a \tan x + (a^2 + b^2) \tan^2 x}$

I now employ the substitution $u = \tan x$, so that $du = \sec^2 x dx$. Also, the endpoints change from $-\pi/2 < x < \pi/2$ to $-\infty < u < \infty$, so that

$Q = 2 \displaystyle \int_{-\infty}^{\infty} \frac{du}{1 + 2 a u + (a^2+b^2) u^2}$

I’ll continue with the evaluation of this integral in tomorrow’s post.

Inverse Functions: Arcsecant (Part 29)

We now turn to a little-taught and perhaps controversial inverse function: arcsecant. As we’ve seen throughout this series, the domain of this inverse function must be chosen so that the graph of $y = \sec x$ satisfies the horizontal line test. It turns out that the choice of domain has surprising consequences that are almost unforeseeable using only the tools of Precalculus.

The standard definition of $y = \sec^{-1} x$ uses the interval $[0,\pi]$ — or, more precisely, $[0,\pi/2) \cup (\pi/2, \pi]$ to avoid the vertical asymptote at $x = \pi/2$ — in order to approximately match the range of $\cos^{-1} x$. However, when I was a student, I distinctly remember that my textbook chose $[0,\pi/2) \cup [\pi,3\pi/2)$ as the range for $\sec^{-1} x$.

I believe that this definition has fallen out of favor today. However, for the purpose of today’s post, let’s just run with this definition and see what happens. This portion of the graph of $y = \sec x$ is perhaps unorthodox, but it satisfies the horizontal line test so that the inverse function can be defined.

Let’s fast-forward a couple of semesters and use implicit differentiation (see also https://meangreenmath.com/2014/08/08/different-definitions-of-logarithm-part-8/ for how this same logic is used for other inverse functions) to find the derivative of $y = \sec^{-1} x$:

$x = \sec y$

$\displaystyle \frac{d}{dx} (x) = \displaystyle \frac{d}{dx} (\sec y)$

$1 = \sec y \tan y \displaystyle \frac{dy}{dx}$

$\displaystyle \frac{1}{\sec y \tan y} = \displaystyle \frac{dy}{dx}$

At this point, the object is to convert the left-hand side to something involving only $x$. Clearly, we can replace $\sec y$ with $x$. As it turns out, the replacement of $\tan y$ is a lot simpler than we saw in yesterday’s post. Once again, we begin with one of the Pythagorean identities:

$1 + \tan^2 y = \sec^2 y$

$\tan^2 y = \sec^2 y - 1$

$\tan^2 y = x^2 - 1$

$\tan y = \sqrt{x^2 - 1} \qquad \hbox{or} \tan y = -\sqrt{x^2 - 1}$

So which is it, the positive answer or the negative answer? In yesterday’s post, the answer depended on whether $x$ was positive or negative. However, with the current definition of $\sec^{-1} x$, we know for certain that the answer is the positive one! How can we be certain? The angle $y$ must lie in either the interval $[0,\pi/2)$ or else the interval $[\pi,3\pi/2)$. In either interval, $\tan y$ is positive. So, using this definition of $\sec^{-1} x$, we can simply say that

$\displaystyle \frac{d}{dx} \sec^{-1} x = \displaystyle \frac{1}{x \sqrt{x^2-1}}$,

and we don’t have to worry about $|x|$ that appeared in yesterday’s post.

Turning to integration, we now have the simple formula

$\displaystyle \int \frac{dx}{x \sqrt{x^2 -1}} = \sec^{-1} x + C$

that works whether $x$ is positive or negative. For example, the orange area can now be calculated correctly:

$\displaystyle \int_{-2}^{-2\sqrt{3}/3} \frac{dx}{x \sqrt{x^2 -1}} = \sec^{-1} \left( - \displaystyle \frac{2\sqrt{3}}{3} \right) - \sec^{-1} (-2)$

$= \displaystyle \frac{7\pi}{6} - \frac{4\pi}{3}$

$= \displaystyle -\frac{\pi}{6}$

So, unlike yesterday’s post, this definition of $\sec^{-1} x$ produces a simple integration formula.

So why isn’t this the standard definition for $\sec^{-1} x$? I’m afraid the answer is simple: with this definition, the equation

$\sec^{-1} x = \cos^{-1} \left( \displaystyle \frac{1}{x} \right)$

is no longer correct if $x < -1$. Indeed, I distinctly remember thinking, back when I was a student taking trigonometry, that the definition of $\sec^{-1} x$ seemed really odd, and it seemed to me that it would be better if it matched that of $\cos^{-1} x$. Of course, at that time in my mathematical development, it would have been almost hopeless to explain that the range $[0,\pi/2) \cup [\pi,3\pi/2)$ had been chosen to simplify certain integrals from calculus.

So I suppose that The Powers That Be have decided that it’s more important for this identity to hold than to have a simple integration formula for $\displaystyle \int \frac{dx}{x \sqrt{x^2 -1}}$

Inverse Functions: Arcsecant (Part 28)

We now turn to a little-taught and perhaps controversial inverse function: arcsecant. As we’ve seen throughout this series, the domain of this inverse function must be chosen so that the graph of $y = \sec x$ satisfies the horizontal line test. It turns out that the choice of domain has surprising consequences that are almost unforeseeable using only the tools of Precalculus.

The standard definition of $y = \sec^{-1} x$ uses the interval $[0,\pi]$, so that

$\sec^{-1} x = \cos^{-1} \left( \displaystyle \frac{1}{x} \right)$

Why would this be controversial? Yesterday, we saw that $\tan x$ is both positive and negative on the interval $[0,\pi]$, and so great care has to be used to calculate the integral:

$\displaystyle \int \frac{dx}{x \sqrt{x^2 -1}}$

Here’s another example: let’s use trigonometric substitution to calculate

$\displaystyle \int_{-6}^{-3} \frac{ \sqrt{x^2-9} }{x} dx$

The standard trick is to use the substitution $x = 3 \sec \theta$. With this substitution:

• $x^2 - 9 = 9 \sec^2 \theta - 9 = 9 \tan^2 \theta$, and
• $dx = 3 \sec \theta \tan \theta \, d\theta$
• $x = -3 \quad \Longrightarrow \quad \sec \theta = -1 \quad \Longrightarrow \quad \theta = \sec^{-1} (-1) = \pi$
• $x = -6 \quad \Longrightarrow \quad \sec \theta = -2 \quad \Longrightarrow \quad \theta = \sec^{-1} (-2) = \displaystyle \frac{2\pi}{3}$

Therefore,

$\displaystyle \int_{-6}^{-3} \frac{ \sqrt{x^2-9} }{x} dx = \displaystyle \int_{2\pi/3}^{\pi} \frac{ \sqrt{9 \tan^2 \theta}} { 3 \sec \theta} 3 \sec \theta \tan \theta \, d\theta$

At this point, the common mistake would be to replace $\sqrt{9 \tan^2 \theta}$ with $3 \tan \theta$. This is a mistake because

$\sqrt{9 \tan^2 \theta} = |3 \tan \theta|$

Furthermore, for this particular problem, $\tan \theta$ is negative on the interval $[2\pi/3,\pi]$. Therefore, for this problem, we should replace $\sqrt{9 \tan^2 \theta}$ with $-3 \tan \theta$.

Continuing the calculation,

$\displaystyle \int_{-6}^{-3} \frac{ \sqrt{x^2-9} }{x} dx = \displaystyle \int_{2\pi/3}^{\pi} \frac{ -3 \tan \theta} { 3 \sec \theta} 3 \sec \theta \tan \theta$

$= \displaystyle \int_{2\pi/3}^{\pi} -3\tan^2 \theta \, d\theta$

$= \displaystyle \int_{2\pi/3}^{\pi} -3(\sec^2 \theta-1) \, d\theta$

$= \displaystyle \int_{2\pi/3}^{\pi} (3-3 \sec^2 \theta) \, d\theta$

$= \displaystyle \bigg[ 3 \theta - 3 \tan \theta \bigg]_{2\pi/3}^{\pi}$

$= \displaystyle \left[ 3 \pi - 3 \tan \pi \right] - \left[ 3 \left( \frac{2\pi}{3} \right) - 3 \tan \left( \frac{2\pi}{3} \right) \right]$

$= \displaystyle 3\pi - 0 - 2\pi + 3(-\sqrt{3})$

$= \pi - 3\sqrt{3}$

So if great care wasn’t used to correctly simplify $\sqrt{9 \tan^2 \theta}$, one would instead obtain the incorrect answer $3\sqrt{3} - \pi$.

Inverse Functions: Arcsecant (Part 27)

We now turn to a little-taught and perhaps controversial inverse function: arcsecant. As we’ve seen throughout this series, the domain of this inverse function must be chosen so that the graph of $y = \sec x$ satisfies the horizontal line test. It turns out that the choice of domain has surprising consequences that are almost unforeseeable using only the tools of Precalculus.

The standard definition of $y = \sec^{-1} x$ uses the interval $[0,\pi]$, so that

$\sec^{-1} x = \cos^{-1} \left( \displaystyle \frac{1}{x} \right)$

Why would this be controversial? Let’s fast-forward a couple of semesters and use implicit differentiation (see also https://meangreenmath.com/2014/08/08/different-definitions-of-logarithm-part-8/ for how this same logic is used for other inverse functions) to find the derivative of $y = \sec^{-1} x$:

$x = \sec y$

$\displaystyle \frac{d}{dx} (x) = \displaystyle \frac{d}{dx} (\sec y)$

$1 = \sec y \tan y \displaystyle \frac{dy}{dx}$

$\displaystyle \frac{1}{\sec y \tan y} = \displaystyle \frac{dy}{dx}$

At this point, the object is to convert the left-hand side to something involving only $x$. Clearly, we can replace $\sec y$ with $x$. However, doing the same with $\tan y$ is trickier. We begin with one of the Pythagorean identities:

$1 + \tan^2 y = \sec^2 y$

$\tan^2 y = \sec^2 y - 1$

$\tan^2 y = x^2 - 1$

$\tan y = \sqrt{x^2 - 1} \qquad \hbox{or} \tan y = -\sqrt{x^2 - 1}$

• If $0 \le y < \pi/2$ (so that $x = \sec y \ge 1$), then $\tan y$ is positive, and so $\tan y = \sqrt{\sec^2 y - 1}$.
• If $\pi/2 < y \le \pi$ (so that $x = \sec y \le 1$), then $\tan y$ is negative, and so $\tan y = -\sqrt{\sec^2 y - 1}$.

We therefore have two formulas for the derivative of $y = \sec^{-1} x$:

$\displaystyle \frac{d}{dx} sec^{-1} x = \displaystyle \frac{1}{x \sqrt{x^2-1}} \qquad \hbox{if} \qquad x > 1$

$\displaystyle \frac{d}{dx} sec^{-1} x = \displaystyle -\frac{1}{x \sqrt{x^2-1}} \qquad \hbox{if} \qquad x < 1$

These may then be combined into the single formula

$\displaystyle \frac{d}{dx} sec^{-1} x = \displaystyle \frac{1}{|x| \sqrt{x^2-1}}$

It gets better. Let’s now find the integral

$\displaystyle \int \frac{dx}{x \sqrt{x^2 -1}}$

Several calculus textbooks that I’ve seen will lazily give the answer

$\displaystyle \int \frac{dx}{x \sqrt{x^2 -1}} = \sec^{-1} x + C$

This answer works as long as $x > 1$, so that $|x|$ reduces to simply $x$. For example, the red signed area in the above picture on the interval $[2\sqrt{3}/3,2]$ may be correctly computed as

$\displaystyle \int_{2\sqrt{3}/3}^2 \frac{dx}{x \sqrt{x^2 -1}} = \sec^{-1} 2 - \sec^{-1} \displaystyle \frac{2\sqrt{3}}{3}$

$= \cos^{-1} \left( \displaystyle \frac{1}{2} \right) - \cos^{-1} \left( \displaystyle \frac{\sqrt{3}}{2} \right)$

$= \displaystyle \frac{\pi}{3} - \frac{\pi}{6}$

$= \displaystyle \frac{\pi}{6}$

However, the orange signed area on the interval $[-2,-2\sqrt{3}/3]$  is incorrectly computed using this formula!

$\displaystyle \int_{-2}^{-2\sqrt{3}/3} \frac{dx}{x \sqrt{x^2 -1}} = \sec^{-1} \left( - \displaystyle \frac{2\sqrt{3}}{3} \right) - \sec^{-1} (-2)$

$= \cos^{-1} \left( -\displaystyle \frac{\sqrt{3}}{2} \right) -\cos^{-1} \left( \displaystyle \frac{1}{2} \right)$

$= \displaystyle \frac{5\pi}{6} - \frac{2\pi}{3}$

$= \displaystyle \frac{\pi}{6}$

This is patently false, as the picture clearly indicates that the above integral has to be negative. For this reason, careful calculus textbooks will often ask students to solve a problem like

$\displaystyle \int \frac{dx}{x \sqrt{x^2 -1}}, \qquad x > 1$

and the caveat $x > 1$ is needed to ensure that the correct antiderivative is used. Indeed, a calculus textbook that doesn’t include such caveats are worthy of any scorn that an instructor cares to heap upon it.

Inverse Functions: Arcsecant (Part 26)

We now turn to a little-taught and perhaps controversial inverse function: arcsecant. As we’ve seen throughout this series, the domain of this inverse function must be chosen so that the graph of $y = \sec x$ satisfies the horizontal line test. It turns out that the choice of domain has surprising consequences that are almost unforeseeable using only the tools of Precalculus.

The standard definition of $y = \sec^{-1} x$ uses the interval $[0,\pi]$ — or, more precisely, $[0,\pi/2) \cup (\pi/2, \pi]$ to avoid the vertical asymptote at $x = \pi/2$. This portion of the graph of $y = \sec x$ satisfies the horizontal line test and, conveniently, matches almost perfectly the domain of $y = \cos^{-1} x$. This is perhaps not surprising since, when both are defined, $\cos x$ and $\sec x$ are reciprocals.

Since this range of $\sec^{-1} x$ matches that of $\cos^{-1} x$, we have the convenient identity

$\sec^{-1} x = \cos^{-1} \left( \displaystyle \frac{1}{x} \right)$

To see why this works, let’s examine the right triangle below. Notice that

$\cos \theta = \displaystyle \frac{x}{1} \qquad \Longrightarrow \qquad \theta = \cos^{-1} x$.

Also,

$\sec\theta = \displaystyle \frac{1}{x} \qquad \Longrightarrow \qquad \theta = \cos^{-1} \left( \displaystyle \frac{1}{x} \right)$.

This argument provides the justification for $0 < \theta < \pi/2$ — that is, for $x > 1$ — but it still works for $x = 1$ and $x \le -1$.

So this seems like the most natural definition in the world for $\sec^{-1} x$. Unfortunately, there are consequences for this choice in calculus, as we’ll see in tomorrow’s post.