Derivative of $\operatorname{arctan2}$

4k Views Asked by At

I'm currently working on some navigation equations and I would like to write down the derivative with respect to $x$ of something like $$f(x) = \operatorname{arctan2}(c(x), d(x))$$

I've searched wherever I've could and the only thing I've come across are the partial derivatives of $\operatorname{arctan2}(y,x)$ with respect to $x$ and $y$.

To be more specific, my equation looks like this: $$\psi = \operatorname{arctan2} \left ( -m_y \cos(\phi + \delta \phi) + m_z \sin(\phi + \delta \phi) \ , \ m_x \cos(\theta + \delta \theta) + m_y \sin(\psi + \delta \psi) \sin(\theta + \delta \theta) + m_x \cos(\phi + \delta \phi) \sin(\theta + \delta \theta) \right )$$

and I want to know $$\frac{\partial \ \psi}{\partial \ \delta \phi} \text{ and } \frac{\partial \ \psi}{\partial \ \delta \theta}$$

I've tried to rewrite the expression to some conditional that checks if $d(x) < 0$, and if so it sums $\pi$ to $\tan(c(x),d(x))$. The thing is that the condition depends on both $\delta \theta$ and $\delta \phi$ and I don't know how to derive it.

Both $\delta \theta$ and $\delta \phi$ may be assumed to be very small angles.

I don't know for sure if the expressions I want exist. I've got no problem in using conditionals as long as the expressions I want are in closed-form. All suggestions are appreciated. Thank you in advance.

2

There are 2 best solutions below

0
On BEST ANSWER

Let's begin by assuming you know that$$\partial_cf=\frac{d}{c^2+d^2},\,\partial_df=\frac{-c}{c^2+d^2}.$$Dividing the chain rule $\operatorname{d}f=\partial_cf\operatorname{d}c+\partial_df\operatorname{d}d$ by $\operatorname{d}x$ gives$$f^\prime=\frac{c^\prime d-cd^\prime}{c^2+d^2}.$$

0
On

Hint

Using the chain rule, the derivative of a function $F$ with

$$f(x) =F(c(x),d(x))$$ is

$$f^\prime(x) =c^\prime(x) F^\prime_x(c(x),d(x)) +d^\prime(x) F^\prime_y(c(x),d(x))$$ where $F(x,y)$ is a map of two variables (take care of the order of $x$ and $y$!). You can apply that to the partial derivatives of $atan2$ that you know.