Not a native english speaker so please excuse my bad english.


Substituting different values are yielding different results , i believe it is due to 2(theta) exceeding the domain of the inverse function but i have no clue how to correct it.
Not a native english speaker so please excuse my bad english.


Substituting different values are yielding different results , i believe it is due to 2(theta) exceeding the domain of the inverse function but i have no clue how to correct it.
Consider, $x = \cos\theta$ Here we have to select $\theta$ in the principal value branch of $\cos^{-1}$. i.e,
$\color{darkviolet}{x\in [-1,1] - \{0\} \text{ or } \theta \in[0,\pi]-\{\frac{\pi}{2}\} }$ as $\tan(\frac{\pi}{2})$ is undefined.
Now, $$u = \tan^{-1}\frac{\sqrt{1-x^2}}{x} = \tan^{-1}(\frac{\sin\theta}{\cos\theta}) = \tan^{-1}(\tan\theta)$$ (sine is positve in both first and second quadrants)
So, $u =\begin{cases} \tan^{-1}(\tan\theta) = \color{red}{\theta} &\text{ for } \theta \in[0,\pi/2) \\ \\ \tan^{-1}(\tan\theta) = \tan^{-1}(-\tan(\pi-\theta)) = \tan^{-1}(\tan(\theta - \pi)) = \color{red}{\theta -\pi}&\text{ for }\theta \in(\pi/2,\pi] \\&\text{ or } \theta-\pi \in(-\pi/2,0] \end{cases}$
$$v = \cos^{-1}(2x\sqrt{1-x^2}) = \cos^{-1}(2\cos\theta\sin\theta) = \cos^{-1}(\sin2\theta) = \pi/2 - \sin^{-1}(\sin2\theta)$$
So, $$\frac{\pi}{2} - v = \begin{cases}\sin^{-1}(\sin2\theta) = 2\theta & \text{for } 0\le\theta\lt\frac{\pi}{4} \text{or } \color{blue}{0\le2\theta\lt\frac{\pi}{2}} \\ \\ \sin^{-1}(\sin2\theta) = \sin^{-1}(\sin(\pi-2\theta)) = \pi - 2\theta &\text{for } \frac{\pi}{4}\lt\theta\lt\frac{\pi}{2} \\&\text{or } \color{blue}{\frac{\pi}{2}\lt2\theta\lt\pi \iff 0\lt \pi-2\theta\lt\frac{\pi}{2}}\\ \\ \sin^{-1}(\sin2\theta) = -\sin^{-1}(\sin(2\theta - \pi)) = \pi -2\theta &\text{for } \frac{\pi}{2}\lt\theta\lt\frac{3\pi}{4} \\ &\text{or } \color{blue}{\pi\lt2\theta\lt\frac{3\pi}{2} \iff 0\lt 2\theta - \pi\lt\frac{\pi}{2}}\\ \\ \sin^{-1}(\sin2\theta) = - \sin^{-1}(\sin(2\pi-2\theta)) =2\theta-2\pi &\text{for } \frac{3\pi}{4}\lt\theta\le\pi \\ &\text{or } \color{blue}{\frac{3\pi}{2}\lt2\theta\le2\pi \iff 0\le2\pi - 2\theta\lt\frac{\pi}{2}} \end{cases}$$
Now,
$$\frac{du}{dv} = \begin{cases}\frac{d(\theta)}{d(\pi/2 - 2\theta)} = -\frac{1}{2} & \text{for } 0\le\theta \lt\frac{\pi}{4} \text{ or } \color{red}{\frac{1}{\sqrt2}\lt x\le1} \\ \\ \frac{d(\theta)}{d(-\pi/2 + 2\theta)} = \frac{1}{2} & \text{for } \frac{\pi}{4}\lt\theta <\frac{\pi}{2} \text{ or } \color{red}{0\lt x\lt\frac{1}{\sqrt2}} \\\\ \frac{d(\theta-\pi)}{d(-\pi/2 + 2\theta)} = \frac{1}{2} & \text{for } \frac{\pi}{2}\lt\theta \lt\frac{3\pi}{4} \text{ or } \color{red}{-\frac{1}{\sqrt2}\lt x\lt 0 } \\\\ \frac{d(\theta-\pi)}{d(-2\theta+3\pi/2)} = -\frac{1}{2} & \text{for } \frac{3\pi}{4}\lt\theta \le{\pi} \text{ or } \color{red}{-1 \le x\lt-\frac{1}{\sqrt2} } \end{cases}$$
$$\frac{du}{dv} = \begin{cases} \color{blue}{-\frac{1}{2}} &\text{for} \color{red}{-1\le x\lt-\frac{1}{\sqrt2}} \\\\ \color{blue}{\frac{1}{2}} &\text{for} \color{red}{-\frac{1}{\sqrt2}\lt x\le\frac{1}{\sqrt2} \ , x\neq0} \\\\ \color{blue}{-\frac{1}{2}} &\text{for }\color{red}{\frac{1}{\sqrt2}\lt x\le1 } \end{cases}$$
Edit:
Evaluating without substitution:
$u = \tan^{-1}\frac{\sqrt{1-x^2}}{x}$ and $v = \cos^{-1}(2x\sqrt{1-x^2})$
$$\color{blue}{ \frac{du}{dx}} = \frac{1}{1+\frac{1-x^2}{x^2}}\cdot\frac{x\cdot\frac{-x}{\sqrt{1-x^2}} - \sqrt{1-x^2}}{x^2} = \frac{x^2}{1}\cdot\frac{-x^2-1+x^2}{x^2\sqrt{1-x^2}} = -\frac{1}{\sqrt{1-x^2}}$$
$$\frac{dv}{dx} = -\frac{1}{\sqrt{1- 4x^2(1-x^2)}}\cdot2\cdot\bigg[1\cdot\sqrt{1-x^2}+\frac{x(-x)}{\sqrt{1-x^2}}\bigg] = -\frac{2}{\sqrt{(1-2x^2)^2}}\cdot\frac{1-2x^2}{\sqrt{1-x^2}}$$
When $2x^2<1 \implies -\frac{1}{\sqrt2}<x<\frac{1}{\sqrt2}$ and $|1-2x^2| = 1-2x^2$
and when $-1\le x\lt -\frac{1}{\sqrt2}$ or $\frac{1}{\sqrt2}\lt x\le1$ , $|1-2x^2| = -(1-2x^2)$
So,
$$\color{blue}{\frac{dv}{dx}} = \begin{cases} \frac{2}{\sqrt{1-x^2}} & \text{for } -1<x<-\frac{1}{\sqrt2}\\ \\ -\frac{2}{\sqrt{1-x^2}} & \text{for } -\frac{1}{\sqrt2}<x<\frac{1}{\sqrt2}\\ \\ \frac{2}{\sqrt{1-x^2}} & \text{for } \frac{1}{\sqrt2}<x\le1 \end{cases}$$
Thus,
$$\frac{du}{dv} = \begin{cases} \color{blue}{-\frac{1}{2}} &\text{for} \color{red}{-1\le x\lt-\frac{1}{\sqrt2}} \\\\ \color{blue}{\frac{1}{2}} &\text{for} \color{red}{-\frac{1}{\sqrt2}\lt x\le\frac{1}{\sqrt2} \ , x\neq0} \\\\ \color{blue}{-\frac{1}{2}} &\text{for }\color{red}{\frac{1}{\sqrt2}\lt x\le1 } \end{cases}$$