In my (mostly physics based) education, when confronted with an integral like the following: $$\int \frac{\cos{x}}{\cos{x}}\,dx$$ I've typically been taught to cancel functions that appear in both the numerator and denominator, so that it can be evaluated as follows: $$\int \frac{\cos{x}}{\cos{x}}\,dx$$ $$=\int\,dx$$ $$=x+c$$ where $c$ is a constant of integration. However the integrand is undefined at infinietly many points. The above clearly holds for all $x\neq\pi/2 \pm n\pi$, but does it hold for all (or any) $x=\pi/2 \pm n\pi$? If it does, then how should an integral like this be evaluated rigorously?
-
2The set in which cos(x)=0 has zero measure. You can exclude this set of points from the interval when evaluating the integral by definition without changing the value. – Kyler S Mar 05 '23 at 06:17
-
If $c$ is some arbitrary real constant, then the map $f:x\mapsto x+c$, defined on $\mathbb R$, does satisfy $f'(x)=\cos x/\cos x$ for all $x\neq\pi/2 +n\pi$, $n\in\mathbb Z$. However, strictly speaking, it would be wrong to call it an "antiderivative" of $\cos x/\cos x$, since an antiderivative of a function $F:E\to\mathbb R$ ought to be a function $f:E\to\mathbb R$ such that $f'=F$, i.e. it should have the same domain as the function which you are integrating. You can fix this problem by considering the restriction of $f$ to ${\pi/2+n\pi:n\in\mathbb Z}$. – Joe Mar 05 '23 at 07:33
-
4On the other hand, $\cos x/\cos x$ does have other antiderivatives which are not of this form, e.g. the function $g:\mathbb R\setminus {\pi/2+n\pi:n\in\mathbb Z}$ satisfying $g(x)=x$ for $x<\pi/2$ and $g(x)=x+1$ for $x>\pi/2$. This highlights the issues of dealing with antiderivatives of functions defined on disconnected domains. – Joe Mar 05 '23 at 07:33
-
In a context where the physics gives you a function $\cos x/\cos x,$ is it physically meaningful to integrate the function across $x=\pi/2,$ for example from $0$ to $\pi$? If the interpretation of $x$ only requires it to have values strictly between $-\pi/2$ and $\pi/2,$ then it doesn't matter what happens at $x=\pm\pi/2.$ – David K Mar 05 '23 at 20:14
-
@Joe - Those two comments, especially the second one, deserve to be an answer! Just paste them in the box and I'll up vote it. – JonathanZ Mar 05 '23 at 20:32
-
@JonathanZsupportsMonicaC: Okay, I turned my comments into an answer. – Joe Mar 07 '23 at 17:47
3 Answers
To do things rigorously, we first need to formulate a precise definition of "antiderivative". I propose the following definition:
If $E\subseteq \mathbb R$, and $f:E\to\mathbb R$ is a function, then an antiderivative of $f$ is a function $F:E\to\mathbb R$ such that $F'=f$.
In other words, an antiderivative of a real-valued function $f$ is a function $F$ with the same domain as $f$, and which satisfies $F'(x)=f(x)$ for all $x$ in its domain.
In your case, we are looking for the antiderivatives of the function $f(x)=\cos x/\cos x$, where the domain of $f$ is tacitly understood to be the set of real numbers $x$ such that $\cos x\neq 0$. In what follows, all of the proposed antiderivatives of $f$ should also be understood to have this domain, meaning that they are undefined at $\pi/2+n\pi$ for every integer $n$.
Clearly, the function $F(x)= x$ is an antiderivative of $f$, as is the function $G(x)=x+C$ for any $C\in\mathbb R$. Is every antiderivative of $f$ of this form? As it turns out, the answer is no. The function $H(x)$ which equals $x$ when $x<\pi/2$ and $x+1$ when $x>\pi/2$ is also an antiderivative of $f$.
In general, an antiderivative of $f$ is a function $F:\mathbb R\setminus\{\pi/2+n\pi:n\in\mathbb Z\}\to\mathbb R$ such that $F(x)=x+C(x)$ where $C$ is a function which is constant on each connected interval of the domain of $F$, i.e. for every $n\in\mathbb Z$, there is a $C_n\in\mathbb R$ such that for all $x\in(\pi/2+n\pi,\pi/2+(n+1)\pi)$ we have $C(x)=C_n$.
To establish that we have found every antiderivative of $f$, we can use the mean value theorem to prove that if $F$ is an antiderivative of $f$, and $a$ and $b$ belong to the same connected interval, then $F(a)=F(b)$.
- 19,636
-
Also, if $a$ and $b$ are not in the same connected interval, but there are a finite or countable number of real numbers between them and not in the domain, then the definite integral's value is $F(b)-F(a)$ if antiderivative $F$ has only removable discontinuities, no jump discontinuities (like the example $H$). – aschepler Mar 08 '23 at 22:22
One can only evaluate the antiderivative on an open set that does not contain any point where $\cos x = 0$. The calculation given provides the antiderivative on an interval. If you want a function defined on the set $\{x\mid \cos x\neq0\}$, you can assign each interval a constant value.
- 7,649
- $$\forall n{\in}\mathbb Z\;\left(x\in\left(\frac{\pi}2+n\pi,\frac{3\pi}2+n\pi\right)\implies\int \frac{\cos{x}}{\cos{x}}\,\mathrm dx=\left\{x+C_n\mid C_n\in\mathbb R\right\}\right).$$
- $$\forall n,a,b\;\left(n\in\mathbb Z\;\text{ and }\;[a,b]\subset\left(\frac{\pi}2+n\pi,\frac{3\pi}2+n\pi\right)\implies\int_a^b \frac{\cos{x}}{\cos{x}}\,\mathrm dx=b-a\right).$$ If we plug the countably many undefined points of the bounded function $\dfrac{\cos{x}}{\cos{x}}$ with arbitrary values, then $$\displaystyle\int_a^b \frac{\cos{x}}{\cos{x}}\,\mathrm dx\equiv b-a.$$
- 38,879
- 14
- 81
- 179