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

Solving a problem which relates to the movement of a charged particle in an electric field I had to solve the following diff-equation:

$$y\frac{dy}{dx}=-\frac{a}{x}+by$$ where $(a,b>0)\,\text{and}\,y(x_0)=0;x_0>0$

Wolfram Alpha is not able to solve it.

Any hint?

share|cite|improve this question
$yy'=\frac12 (y^2)'$, not sure if it helps... – draks ... Aug 31 '12 at 14:22
Why are you expecting it to be solvable? – Sasha Aug 31 '12 at 14:26
@Sasha Is there any reason to believe otherwise? – Martin Gales Aug 31 '12 at 14:35
at least approximately. – Martin Gales Aug 31 '12 at 14:38
@Sasha: Doesn't the Picard–Lindelöf theorem tell us that there will always be a unique local (possibly global) solution to any first order ODE with initial conditions? – Fly by Night Aug 31 '12 at 14:39

Here is an implicit solution derived by maple

$$ \left\{ {\it \_C1}+ \left( -2\,{{\rm e}^{-1/2\,{\frac { \left( bx-y \left( x \right) \right) ^{2}}{a}}}}\sqrt {a}- {{\rm erf}\left(1/2\,{\frac { \left( bx-y \left( x \right) \right) \sqrt {2}}{\sqrt {a}}}\right)} \sqrt {2}\sqrt {\pi }bx \right) {x}^{-1}=0 \right\}\,. $$

where ${\rm erf } (x)$ is the error function

share|cite|improve this answer
Thank you. If y(x0)=0 then all OK? – Martin Gales Aug 31 '12 at 15:18
If you differentiate the left hand side with respect to x and then put $x=x_0$ and $y(x_0)=0$ then you get $$ \frac{2\sqrt{a}}{x_0^2}e^{-b^2x_0/2a} = 0 \, . $$ The only way this can have a solution is if $a = 0$. In fact we need $a \to 0^+.$ – Fly by Night Aug 31 '12 at 19:56

Maybe I'm missing something here. But your initial condition $y(x_0) = 0$ implies that $a = 0$. If

$$y \frac{dy}{dx} = by - \frac{a}{x} $$

then why not substitute $x = x_0$ to give $0 = -a/x_0$? Since $x_0 > 0$ it follows that $a=0$.

$$ y \frac{dy}{dx} = by $$

has a very simple solution: either $y \equiv 0$ or $y = bx + k$ for any $k \in \mathbb{R}.$ Imposing the condition that $y(x_0) = 0$ means that $k = -bx_0$ and so $y \equiv 0$ and $y(x) = b(x - x_0)$ are the two solutions. You'll need to change your initial conditions from $a,b > 0$ to $a,b \ge 0.$

share|cite|improve this answer
Thank you for this hint. I will try. How about special functions? Hopeless? – Martin Gales Aug 31 '12 at 14:56
I've edited my answer while you made a comment. I think I have a solution. – Fly by Night Aug 31 '12 at 14:58
"But your initial condition y(x0)=0 implies that a=0". I do not understand this. No, a>0. – Martin Gales Aug 31 '12 at 15:05
Your initial conditions are inconsistent. Put $x = x_0$ into your ODE, you get $y(x_0)y'(x_0) = by(x_0) - a/x_0.$ You've told me that $y(x_0) = 0$ and so your ODE reduces to $0 = -a/x_0$. Provided $x_0 \neq 0$ $-a/x_0 = 0 \iff a = 0.$ You may have copied something down wrong. If you insist that $a>0$ then there literally is no solution because your assumptions are inconsistent and produce a contradiction. – Fly by Night Aug 31 '12 at 15:09
At $y(x_0)=0$ i get: $y^2=2a\ln\frac{x_0}{x};x<x_0$. Near $x_0$! – Martin Gales Aug 31 '12 at 15:30

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.