Complex analysis. Continuous and differentiable function in polar form Given a function $f:\mathbb{R} \rightarrow \mathbb{C}$ that is continuous and differentiable everywhere. Is it true that I can write $f(t)$ as:
$$f(t) = r(t)e^{i\theta(t)}$$
for some $r(t)$ and $\theta(t)$ that are real, continuous and differentiable everywhere.
Intuitively the answer seems yes to me. I can choose $$r(t) = |f(t)|$$
I can start with $$\theta(t) = arg(f(t))$$  for nonzero $f(t)$ and modify it to remove discontinuities by adding or subtracting $2\pi$ at discontinuous t values. At values where $f(t) = 0$,  I can choose $\theta(t)$ to maintain continuity.
But I'm interested in a rigorous answer. Thanks.
 A: A counterexample: $f:\mathbb{R} \to \mathbb{C}$ defined by $f(0)=0$ and
$$
 f(t) = t^2 e^{i/t} = t^2 (\sin \frac 1t + i \cos \frac 1t)
$$
is differentiable everywhere.
Now assume that $f(t) = r(t)e^{i\theta(t)}$ with continuous, real-valued functions $r$ and $\theta$. Then $r(t) = \pm t^2$ for all $t$ and therefore 
$$
 e^{i(\theta(t)- \frac 1t)} = \pm 1
$$
for all $t \ne 0$. It follows that for each $t \ne 0$ there is a $ k(t) \in \Bbb Z$ such that
$$
\theta(t)- \frac 1t = \pi k(t) \, .
$$
But  the left hand side is continuous,  so that $k(t) $ must be constant for $t > 0$. It follows that $\theta$ is not continuous at $t=0$, which is a contradiction to our assumption.
Remark: With small modifications we can make the counterexample continuously differentiable:
$$
 f(t) = t^3 e^{i/t} 
$$
or even infinitely often differentiable:
$$
 f(t) =  e^{-1/t^2 + i/t} 
$$
A: When $f(t)\ne0$ for all $t$ then you can do it. You have $r(t)=\sqrt{x^2(t)+y^2(t)}\ne0$ for all $t$. Furthermore
$$\theta'(t)={d\over dt}\arg\bigl(x(t),y(t)\bigr)=\nabla\arg(x,y)\cdot\bigl(x'(t),y'(t)\bigr)={x(t)y'(t)-x'(t)y(t)\over x^2(t)+y^2(t)}\in{\mathbb R}$$
for all $t$. It follows that you can write
$$\theta(t)=\theta_0+\int_0^t{x(t)y'(t)-x'(t)y(t)\over x^2(t)+y^2(t)}\>dt\ ,\tag{1}$$
where $\theta_0\in\arg\bigl(x(0),y(0)\bigr)$. With $(1)$ you no longer have to worry about adding $2\pi$ at suitable places $t$.
