1. ## Unfamiliar ode

Here's the ode i set up,
$\frac{d^2 x}{d t^2} + \frac{k}{c -x} =0$
assuming i set it up properly, how would i deal with the x in the denominator?
Substituting y= c-x gives this:
$\frac {-d^2 y}{dt^2} + \frac{k}{y}=0$
the y in the denominator has me mixed up

2. Why not just substitute y= (1/c-x) instead, giving:

(-d2y)/(dt2) + ky = 0

3. Originally Posted by crymorenoobs
Why not just substitute y= (1/c-x) instead, giving:

(-d2y)/(dt2) + ky = 0
Because that substitution does NOT give that equation.

If $y= \frac{1}{c-x}$ then $c- x= \frac{1}{y}= y^{-1}$.

$\frac{d(c-x)}{dt}= -\frac{dx}{dt}= -y^{-2}\frac{dy}{dt}$
$-\frac{d^2x}{dt^2}= -y^{-2}\frac{d^2y}{dt^2}+ 2y^{-3}\frac{dy}{dt}$.

with that substitution the equation becomes $-y^{-2}\frac{d^2y}{dt^2}+ 2y^{-3}\frac{dy}{dt}+ \frac{k}{y}= 0$

Multiplying by $-y^3$ makes that
$y\frac{d^2y}{dt^2}- 2\frac{dy}{dt}- ky^2= 0$
which is certainly not an improvement.

4. That's a case of independent variable missing. So if $x''+\frac{k}{c-x}=0$ and I let $x'=p$, then I get the new equation:

$p\frac{dp}{dx}=\frac{k}{x-c}$

with variables separated. That's ok if we get a $p^2$. Just take it's square root and solve both first-order odes resulting from the root.

Guess it's kinda' messy though and you'll have to invert the expression and get it in terms of an inverse function.

5. The second order DE has the form...

$x^{''} = f(x)$ (1)

... where...

$f(x)= \frac{k}{x-c}$ (2)

The approach to solve (1) is the following: because is...

$x^{''} = \frac{d x^{'}}{dt} = \frac{d x^{'}}{dx}\cdot \frac{dx}{dt} = x^{'}\cdot \frac{dx^{'}}{dx}$ (3)

... the (1) becomes...

$x^{'}\cdot \frac{dx^{'}}{dx}= f(x) \rightarrow x^{'}\cdot dx^{'} = f(x)\cdot dx$ (4)

... so that we have a first order DE in $x^{'}$ and $x$. Integrating (4) we obtain...

$\frac{x^{'2}}{2} = \phi (x) + c_{1} \rightarrow x^{'} = \sqrt{2\cdot \phi(x) + c_{1}}$ (5)

... where $\phi(x)$ is a primitive of $f(x)$. Separating variables again in (5) we obtain...

$dt = \frac{dx}{ \sqrt{2\cdot \phi(x) + c_{1}}}$ (6)

... so that is...

$t= \int \frac{dx}{ \sqrt{2\cdot \phi(x) + c_{1}}} + c_{2}$ (7)

Now what remains to do is compute a primitive of $f(x)$ given by (2), insert it in (7), and then integrating again... very easy ...

Kind regards

$\chi$ $\sigma$

6. Shawsend and ChiSigma are giving essentially the same answer.

7. Originally Posted by shawsend
That's a case of independent variable missing. So if $x''+\frac{k}{c-x}=0$ and I let $x'=p$, then I get the new equation:

$p\frac{dp}{dx}=\frac{k}{x-c}$

with variables separated. That's ok if we get a $p^2$. Just take it's square root and solve both first-order odes resulting from the root.

Guess it's kinda' messy though and you'll have to invert the expression and get it in terms of an inverse function.
here 's the try
$p \frac{dp}{dx} = \frac{k}{x-c}$
and separating variables;
$p dp =k \frac{dx}{x-c}$
integrating:
$\frac{p ^2}{2} = k ln|x-c| + c_1$
and if im still on the right track,
$\frac{dx}{dt} =2 (k ln|x-c| + c_1) ^{\frac{1}{2}}$
which looks like something i need to take a while to work on, did i get you right though? thanks again.

8. Originally Posted by chisigma
The second order DE has the form...

$x^{''} = f(x)$ (1)

... where...

$f(x)= \frac{k}{x-c}$ (2)

The approach to solve (1) is the following: because is...

$x^{''} = \frac{d x^{'}}{dt} = \frac{d x^{'}}{dx}\cdot \frac{dx}{dt} = x^{'}\cdot \frac{dx^{'}}{dx}$ (3)

... the (1) becomes...

$x^{'}\cdot \frac{dx^{'}}{dx}= f(x) \rightarrow x^{'}\cdot dx^{'} = f(x)\cdot dx$ (4)

... so that we have a first order DE in $x^{'}$ and $x$. Integrating (4) we obtain...

$\frac{x^{'2}}{2} = \phi (x) + c_{1} \rightarrow x^{'} = \sqrt{2\cdot \phi(x) + c_{1}}$ (5)

... where $\phi(x)$ is a primitive of $f(x)$. Separating variables again in (5) we obtain...

$dt = \frac{dx}{ \sqrt{2\cdot \phi(x) + c_{1}}}$ (6)

... so that is...

$t= \int \frac{dx}{ \sqrt{2\cdot \phi(x) + c_{1}}} + c_{2}$ (7)

Now what remains to do is compute a primitive of $f(x)$ given by (2), insert it in (7), and then integrating again... very easy ...

Kind regards

$\chi$ $\sigma$

thanks, iv not quite encountered primitives but il sure look that up . thanks.

9. Hi. How about start at the end and work backwards. Suppose I solve a DE for $x(t)$ and I end up with a messy implicit expression in terms of $x(t)$ like $\text{myfunction}(x)=t+c$ and I can't invert it to get x(t). One thing to do is just create a table of x and t values starting with the initial value x(0)=x_0. Something like:

myInversionTable=Table[{myFunction[x]-c,x},{x,x_0,xend}]

Now, I've just constructed an "inverse" table of (t,x(t)) values. Now, in the range of values that is one-to-one, I can then fit that table to some function like a polynomial of high degree and that polynomial will probably be a good empirical representation of the solution for some range of values of t.

So, we have:

$pdp=\frac{k}{x-c}dx$

Let's integrate that explicitly based on the initial conditions $x(0)=x_0, x'(0)=x_1$:

$\int_{x'(0)}^{x'(t)} pdp=k\int_{x(0)}^{x(t)}\frac{1}{x-c}dx$

$\frac{p^2}{2}\biggr|_{x'(0)}^{x'(t)}=k\log(x-c)\biggr|_{x(0)}^{x(t)}$

$1/2 x'(t)^2=1/2 x'(0)^2+k\log(x-c)-k\log(x_0-c)$

$\left(\frac{dx}{dt}\right)^2=2k\log(x-c)+K_1$

$\frac{dx}{dt}=\pm\sqrt{2k\log(x-c)+K_1}$

Now integrate explicitly again:

$\pm\int_{x(0)}^{x(t)}\frac{dx}{\sqrt{2k\log(x-c)+K_1}}= \int_{t_0}^t dt$

$\pm\text{myFunction(x)}=t+K_2$

10. Originally Posted by chisigma
The second order DE has the form...

$x^{''} = f(x)$ (1)

... where...

$f(x)= \frac{k}{x-c}$ (2)

The approach to solve (1) is the following: because is...

$x^{''} = \frac{d x^{'}}{dt} = \frac{d x^{'}}{dx}\cdot \frac{dx}{dt} = x^{'}\cdot \frac{dx^{'}}{dx}$ (3)

... the (1) becomes...

$x^{'}\cdot \frac{dx^{'}}{dx}= f(x) \rightarrow x^{'}\cdot dx^{'} = f(x)\cdot dx$ (4)

... so that we have a first order DE in $x^{'}$ and $x$. Integrating (4) we obtain...

$\frac{x^{'2}}{2} = \phi (x) + c_{1} \rightarrow x^{'} = \sqrt{2\cdot \phi(x) + c_{1}}$ (5)

... where $\phi(x)$ is a primitive of $f(x)$. Separating variables again in (5) we obtain...

$dt = \frac{dx}{ \sqrt{2\cdot \phi(x) + c_{1}}}$ (6)

... so that is...

$t= \int \frac{dx}{ \sqrt{2\cdot \phi(x) + c_{1}}} + c_{2}$ (7)

Now what remains to do is compute a primitive of $f(x)$ given by (2), insert it in (7), and then integrating again... very easy ...

Kind regards

$\chi$ $\sigma$
Lets try to effectively perform double integration. From (2) we have...

$\phi (x) = \int \frac{k}{x-c}\cdot dx = k\cdot \ln (x+c)$ (8)

... so that (7) becomes...

$t = \frac{1}{\sqrt{2k}}\cdot \int \frac{dx}{\sqrt{\ln (x-c) + \frac{c_{1}}{2k}}}+ c_{2}$ (9)

Now first we set $\ln (x-c)= y \rightarrow dx= e^{y}\cdot dy$ so that the integral in (9) becomes...

$\int \frac{dx}{\sqrt{\ln (x-c) + \frac{c_{1}}{2k}}}= \int \frac{e^{y}}{\sqrt{y + \frac{c_{1}}{2k}}}\cdot dy$ (10)

... and then $\sqrt{y + \frac{c_{1}}{2k}}= \xi \rightarrow dy = 2\cdot \xi \cdot d\xi$ so that the integral (10) becomes...

$\int \frac{e^{y}}{\sqrt{y + \frac{c_{1}}{2k}}}\cdot dy= e^{-\frac{c_{1}}{2k}}\cdot \int e^{\xi^{2}}\cdot d\xi = -i\cdot \frac{\sqrt{\pi}}{2}\cdot e^{-\frac{c_{1}}{2k}}\cdot erf (i\cdot \xi)$ (11)

... so that the solution of (1) is...

$t = -\frac{i}{\sqrt{2k}}\cdot \frac{\sqrt{\pi}}{2}\cdot e^{-\frac{c_{1}}{2k}}\cdot erf \{i\cdot \sqrt{\ln (x-c) + \frac{c_{1}}{2k}} \}+ c_{2}$ (12)

Kind regards

$\chi$ $\sigma$