# Derivative w.r.t another function [duplicate]

Find $\frac{dv}{du}$ if $v=\sin^{-1}\frac{2x}{1+x^2}$ w.r.t $u=\tan^{-1}\frac{2x}{1-x^2}$

$$v=\sin^{-1}\frac{2x}{1+x^2}=\begin{cases}2\tan^{-1}x&\text{, if }|x|<1\\ \pm\pi-2\tan^{-1}x&\text{, if }|x|>1\end{cases}$$ and $$u=\tan^{-1}\frac{2x}{1-x^2}=\begin{cases}2\tan^{-1}x&\text{, if }|x|<1\\ \pm\pi+2\tan^{-1}x&\text{, if }|x|>1\end{cases}$$ Thus, $$\boxed{ \frac{dv}{du}=\frac{\frac{dv}{d(\tan^{-1}x)}}{\frac{du}{d({\tan^{-1}x)}}}=\begin{cases}1&\text{, if }|x|<1\\-1&\text{, if }|x|>1\end{cases}}$$

How do I find derivative w.r.t another function in similar problems using Mathematica ?

I tried

D[ArcSin[2 x / 1 + x^2], ArcTan[2 x/1 - x^2]]


which certainly not giving anything.

## marked as duplicate by J. M. will be back soon♦Sep 29 '18 at 17:36

Use the chain rule

$$\frac{\operatorname{d}v}{\operatorname{d}u} = \frac{\operatorname{d}v}{\operatorname{d}x} \cdot \frac{\operatorname{d}x}{\operatorname{d}u} = \frac{\operatorname{d}v}{\operatorname{d}x} \cdot \left(\frac{\operatorname{d}u}{\operatorname{d}x}\right)^{-1}$$

like this

v = ArcSin[2 x/(1 + x^2)];
u = ArcTan[2 x/(1 - x^2)];
dvdu = Simplify[D[v, x]/D[u, x], x \[Element] Reals]


$$\begin{cases} -1 & x\geq 1\lor x\leq -1 \\ 1 & \text{True}\end{cases}$$