A special differential equation I want to know that how we can solve a differential equation of the general form
$$y'(x)= y(u(x))+g(x). $$
For example $y'(x)= y(\sin(x))+ x,$ or $y'(x)= y(\sin(x)).$
How we prove  existence or uniqueness of the solution?
 A: First consider the main differential equation for $g(x)=ay'(x)$ where $a\in\mathbb{R}-\{1\}$ (if $a=1$ then the we have the trivial solution $y(x)\equiv0$).
Thus
$$y'(x)=y(u(x))+g(x)\Rightarrow (1-a)y'(x)=y(u(x))\Rightarrow (1-a)\frac{dy}{du}\cdot\frac{du}{dx}=y(u)$$$$\Rightarrow(1-a)\frac{y'(u)}{y(u)}\cdot\frac{du}{dx}=1$$
Along the lines above we have used the chain rule. Direct integration will yield
$$(1-a)\int\frac{y'(u)}{y(u)}\,du=\int\,dx\Rightarrow(1-a)\ln|(y(u)|=x+c\Rightarrow y(u)=c\exp(\frac{x}{1-a})$$
Assuming $u$ is invertible then set $u(x)=z\Rightarrow u^{-1}(z)=x$. Interchanging $x$ with $z$ to get
$$y(x)=c\exp(\frac{u^{-1}(x)}{1-a})$$
Now in general for any $g(x)$. Rewrite the main equation as 
$$y'(x)-y(u(x))=g(x)\Rightarrow -y'(u)u'(x)+y(u)=-g(x)$$
Multiply both sides by a function $h(x)\neq0$ such that $h'(x)=-u'(x)h(x)$
This would yield $$\frac{h'(x)}{h(x)}=-u'(x)$$
Direct integration would yield
$$h(x)=c\exp(u(x))$$
Now the original equation uppon multiplication by $h(x)$ becomes
$$h(x)y(u)-h(x)u'(x)y'(x)=-h(x)g(x)\Leftrightarrow (h(x)y(u))'=-h(x)g(x)$$
Direct integration will yield
$$\int (h(x)y(u))'=-\int h(x)g(x)\,dx\Leftrightarrow h(x)y(u)=-\int h(x)g(x)\,dx+c$$
in other words 
$$y(u)=\frac{1}{h(x)}\Big(-\int h(x)g(x)\,dx+c\Big)$$
Assuming the invertibility of $u$ we can substitute $x$ with $u^{-1}(x)$ to get
$$y(x)=\frac{1}{h(u^{-1}(x))}\Big(-\int h(u^{-1}(x))g(u^{-1}(x))\frac{dx}{u'(x)}+c\Big)$$ 
where $h(x)=c\exp(u(x))$.
