# Solving an ODE without Lambert W function

I have a question regarding the possibility of solving the following ODE:

$$\left[2x(t)+t\right]x^{\prime}(t)=1$$

such that $x(0)=-1$.

If we make the substitution $w(t)=2x(t)+t$, we obtain the following equation:

$$-2\ln[w(t)+2]+w(t)=t+C$$

which can be solved for $w$ (and hence $x$), although both $w$ and $x$ will be expressed in terms of the Lambert W function. I won't be posting the full solution here - WolframAlpha shows it step-by-step. Nevertheless, after applying the initial condition that $x(0)=-1$, $x$ is simplified to a much more digestible form: $x(t)=-\frac{t}{2}-1$.

Therefore, I was wondering - is it possible to arrive at this solution without the use of Lambert W function? More specifically, is it possible to somehow apply the initial condition earlier and hence to avoid having to find the general solution for $x(t)$ (and thereby avoiding stumbling on the Lambert W function)?

I would be grateful for some advice on this.

• If you make the hypothesis that the solution is a polynomial of t, say x = A + B t + C t^2 + .., replace this in tour ODE and cancel all possible terms. You will end with your result and you van verify that the initial consition is satisfied. Nov 22 '13 at 10:20
• Hm... It's an interesting idea, but I don't see how it works. When I try, I get one equation with $A$, $B$, $C$ and $t$ to solve for... Nov 22 '13 at 10:36
• Cancel all terms. This gives you equations in terms of A, B and C. The obvious one is C=0. Solve now for A and B. But what gave you as an answer JJacquelin is much better indeed. Nov 22 '13 at 11:14
• Thank you for your time anyway :) Nov 22 '13 at 11:21

Instead of looking for $x(t)$, first look for $t(x)$:

$$x' = \dfrac{\mathrm dx}{\mathrm dt} = \dfrac{1}{(\mathrm dt/\mathrm dx)} = \dfrac{1}{t'}\\\,\\(2x+t)=\dfrac{1}{x'}=t'\\\,\\ t'-t=2x$$

is a linear ODE with condition $t(1)=0$.

• If we solve the equation $t^{\prime}-t=2x$, we should obtain $t(x)=2(-1-x)+Ce^{x}$. Substituting $t=0$ and $x=-1$, we obtain that $C=0$, and hence $t=-2-2x\Longrightarrow x=-\frac{1}{2}t-1$ is the solution, which satisfies $x(0)=-1$. Is that right? If yes, it looks like it works... Nov 22 '13 at 10:59
• I will wait a bit more, see if someone else comes up with another way, and then I'll accept your answer. Nov 22 '13 at 11:22

Therefore, I was wondering - is it possible to arrive at this solution without the use of Lambert W function? More specifically, is it possible to somehow apply the initial condition earlier and hence to avoid having to find the general solution for $x(t)$ (and thereby avoiding stumbling on the Lambert W function)?

Yes this is possible. Using your substitution $w(t)=2x(t)+t$, one sees that $(w(t)+2)^2\mathrm e^{-w(t)}=C\mathrm e^{-t}$, for some constant $C$.

The initial condition $x(0)=-1$ reads $w(0)=-2$ hence $C=0$. Since $\mathrm e^{-w(t)}\ne0$, one gets $w(t)+2=0$ for every $t$, that is, $x(t)=-\frac12(t+2)$.

As you noted, this is specific to the initial condition $w(0)=-2$.