Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One reason why the iteration


converges quickly for appropriate starting values is that this is nothing more than the Newton-Raphson iteration for $\sin\;x$.

This got me thinking: given some arbitrary function $g(x)$, is there always a function $f(x)$ such that


or are there restrictions on the nature of $g(x)$ so that the differential equation has a solution?

share|cite|improve this question

The differential equation you have is an example of a first-order separable differential equation.

If you write $y = f(x)$, then you have $$ \frac{y}{\frac{dy}{dx}} = g(x) $$ Writing this in terms of differentials (treat $\frac{dy}{dx}$ as a fraction) so that all the $y$'s are on one side and all the $x$'s are on the other gives $$ \frac{dx}{g(x)} = \frac{dy}{y} $$ Integrating both sides yields $$ \int \frac{dx}{g(x)} + C = \ln |y| $$ where $C$ is an arbitrary constant. Then $$ \exp(\int \frac{dx}{g(x)} + C) = |y| $$ and so $$ y = \pm \exp(\int \frac{dx}{g(x)} + C) $$ This works as long as $\frac{1}{g(x)}$ has an antiderivative. For this purpose, it is sufficient to have $g$ continuous and not everywhere zero.

share|cite|improve this answer

Certainly not for "arbitrary" functions, as functions of the form $\frac{f}{f'}$ satisfy properties that not all functions satisfy. In fact, in any open set where $g$ is nonzero, $\frac{1}{g}=\log(|f|)'$, so $g$ must be the reciprocal of a derivative of a function. This also leads to a way to find such $f$ in many cases, namely by integrating the last equation to get $\log(|f(x)|)=\int_a^x\frac{dt}{g(t)}+C$ provided the integral exists, in which case $f(x)=c\cdot\exp\left(\int_a^x\frac{dt}{g(t)}\right)$.

For example, attempting this with $g(x)=\tan(x)$ leads to integrating $\cot(x)$ and ending up with $f(x)=c\cdot\sin(x)$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.