$$\int \sqrt{1-x^2} \cos^{-1}\left( \sqrt{1-x^2} \right) \,\mathrm{d}x \qquad (|x| <1). $$
I have been trying to solve this for an hour now, but I'm struggling. I have been trying partial integration and substitution. However, I always end up with a lot of numbers and expressions, and then get confussed. Does someone have some tips?
This is trickier than it looks. The usual straightforward attempt yields an incorrect answer.
Let us start by understanding the integrand of the given indefinite integral. Plotting it, we see that the desired antiderivative is continuous (although we would not normally say this, we will use this fact later), monotonically nondecreasing, has one critical point (it would have two more, but the endpoints are excluded), and has three inflection points (one at the critical point in the middle). (Throughout, I plot the integrands of indefinite integrals is orange and (eventually) their antiderivatives in blue.)
We want the argument to the arccosine to be cosine so there is some chance of rewriting the arccosine as a simple expression. Using the trigonometric Pythagorean identity in the usual way, we set $x = \sin u$ so $\textrm{d}x = \cos u \,\mathrm{d}u$, obtaining \begin{align*} \int \sqrt{1-x^2}& \cos^{-1} \sqrt{1 - x^2} \,\mathrm{d}x \\ &= \int \sqrt{1-\sin^2 u} \cos^{-1} \sqrt{1 - \sin^2 u} \cos u \,\mathrm{d}u \\ &= \int \sqrt{\cos^2 u} \left( \cos^{-1} \sqrt{\cos^2 u} \right) \cos u \,\mathrm{d}u \\ &= \int \left| \cos u \right| \cos u \left( \cos^{-1} \left|\cos u\right| \right) \,\mathrm{d}u \end{align*} (If the appearance of absolute values is a surprise, recall that cosine takes negative values and, for instance $\sqrt{(-1/4)^2} = 1/4 \neq -1/4$.) Now we should be a little careful. The original integrand is real valued when $1 \leq x \leq 1$ which conveniently contains the specified range $|x| < 1$. We have many choices of ranges of $u$ giving $x$s in that range. One choice is $- \pi/2 < u < \pi/2$. (In fact we can set the left endpoint at $\frac{(2k+1)\pi}{2}$ for any integer $k$. Interestingly, when $k$ is even $u$ produces the range of $x$ values in reverse order. We don't choose to include that property in our chosen interval.)
Now we have a problem (and we have this problem for any choice of interval for $u$): while it is the case that $|\cos u| = \cos u$ for any $u$ in $(-\pi/2, \pi/2)$, the output of the arccosine is restricted to the range $[0, \pi]$. So we have \begin{align*} \int \sqrt{1-x^2}& \cos^{-1} \sqrt{1 - x^2} \,\mathrm{d}x \\ &= \int \cos^2 u \left( \begin{cases} -u ,& -\pi/2 < u < 0 \\ u ,& 0 \leq u < \pi/2 \end{cases} \right) \,\mathrm{d}u \end{align*} (The nondifferentiability of the original integrand at $x = 0$ was a warning that this "change of branch" behaviour was possible.)
If we ignore the detail with signs, we get the wrong integrand.
The antiderivative of this function is not monotonically nondecreasing and does not have three inflection points.
Alternatively, if we do account for signs, we get the correct integrand.
Now we proceed by parts with both antiderivatives to verify that the distinction I have made actually produces a difference in the end. (It must, just by counting inflection points, but let us also see what kind of difference we obtain.) \begin{align*} \int u &\cos^2 u \,\mathrm{d}u \\ &\begin{bmatrix} v = u, & \mathrm{d}w = \cos^2 u \,\mathrm{d}u \\ \mathrm{d}v = \mathrm{d}u, & w = u/2 + (1/4)\sin(2u)\end{bmatrix} \\ &= \frac{u^2}{2} + \frac{u \sin 2u}{4} - \int \frac{u}{2} + \frac{\sin(2u)}{4} \,\mathrm{d}u \\ &= \frac{u^2}{2} + \frac{u \sin 2u}{4} - \left( \frac{u^2}{4} - \frac{1 + \cos 2u}{8} \right) \\ &= \frac{u^2}{4} + \frac{1 + \cos 2u}{8} + \frac{u \sin 2u}{4} \end{align*} Since we chose $-\pi/2 <u < \pi/2$, we can use $u = \sin^{-1} x$ to return to the original variable. \begin{align*} \int \sqrt{1-x^2}& \cos^{-1} \sqrt{1 - x^2} \,\mathrm{d}x \\ &\neq \frac{(\sin^{-1} x)^2}{4} + \frac{1 + \cos 2(\sin^{-1} x)}{8} + \frac{(\sin^{-1} x) \sin( 2\sin^{-1} x)}{4} + C \end{align*} We know that "$\neq$" is correct by plotting this function: it isn't monotonically nondecreasing.
Proceeding instead with the correct expression, \begin{align*} \int \cos^2 u & \left( \begin{cases} -u ,& -\pi/2 < u < 0 \\ u ,& 0 \leq u < \pi/2 \end{cases} \right) \,\mathrm{d}u \\ &= \begin{cases} -\int u \cos^2 u ,& -\pi/2 < u < 0 \\ \int u \cos^2 u ,& 0 \leq u < \pi/2 \end{cases} \\ &\overset{?}{=} \begin{cases} -\left( \frac{(\sin^{-1} x)^2}{4} + \frac{1 + \cos 2(\sin^{-1} x)}{8} + \frac{(\sin^{-1} x) \sin( 2\sin^{-1} x)}{4} \right) + C_{1?} ,& -\pi/2 < u < 0 \\ \frac{(\sin^{-1} x)^2}{4} + \frac{1 + \cos 2(\sin^{-1} x)}{8} + \frac{(\sin^{-1} x) \sin( 2\sin^{-1} x)}{4} + C_{2?} ,& 0 \leq u < \pi/2 \end{cases} \end{align*}
There is a question mark over that equality sign and on the two constants of integration because we are almost, but not quite, done. Let's graph this antiderivative.
(The label for the graph has a slight error. The signum function, almost does what we want with the sign of the pre-multiplier being the same as the sign of $x$, except at $x = 0$. This isn't a significant error for graphing. And it is something we are about to correct anyway.)
Something is clearly off -- antiderivatives of continuous functions are supposed to be continuous. What happened? There are two ways to describe it:
We have freedom to choose any vertical offsets that produce a continuous antiderivative. Let's decide, just for symmetry, to make the two pieces meet at the origin. To do so, we need $$ \lim_{x \rightarrow 0^+} \frac{(\sin^{-1} x)^2}{4} + \frac{1 + \cos 2(\sin^{-1} x)}{8} + \frac{(\sin^{-1} x) \sin( 2\sin^{-1} x)}{4} = \frac{1}{8} \text{.} $$
Therefore, the antiderivative we want is \begin{align*} & \int \cos^2 u \left( \begin{cases} -u ,& -\pi/2 < u < 0 \\ u ,& 0 \leq u < \pi/2 \end{cases} \right) \,\mathrm{d}u \\ &= \left( \begin{cases} \frac{1}{8}-\left( \frac{(\sin^{-1} x)^2}{4} + \frac{1 + \cos 2(\sin^{-1} x)}{8} + \frac{(\sin^{-1} x) \sin( 2\sin^{-1} x)}{4} \right) ,& -\pi/2 < u < 0 \\ \frac{-1}{8} + \frac{(\sin^{-1} x)^2}{4} + \frac{1 + \cos 2(\sin^{-1} x)}{8} + \frac{(\sin^{-1} x) \sin( 2\sin^{-1} x)}{4} ,& 0 \leq u < \pi/2 \end{cases} \right) + C \end{align*}
Now plotting the original integrand and this antiderivative on the same axes,
we see that this antiderivative is
That is, it has all the properties we initially extracted from the given integrand, unlike other antiderivatives we discarded along the way.