What am i doing wrong when solving this differential equation

199 Views Asked by At

$$ f(x) = \frac{\frac{d^2}{dx^2}[e^y]}{\frac{d}{dx}[e^y]} $$

Given that $f(x) = cx$

$$ \frac{c}{2}x^2 + k_1 = \ln(e^y y') $$

$$ k_2\int e^{\frac{c}{2}x^2} dx = e^y $$

$$ y = \ln(k_2\int e^{\frac{c}{2}x^2} dx) $$

Therefore

$$ y'^2 - cxy' + y'' = 0 $$

$$ y' = \frac{c}{2}x \pm \sqrt{\frac{c^2}{4}- y''} $$

$$ \frac{e^{\frac{c}{2}x^2}}{\int e^{\frac{c}{2}x^2} dx} = \frac{c}{2}x \pm \sqrt{\frac{c^2}{4}x^2- y''} $$

Yet when $c=4$

$$ \frac{2\sqrt{\frac{2}{\pi}}e^{2x^2}}{\operatorname{erfi}(\sqrt{2}x)+c} = 2x \pm\sqrt{4x^2 + 8e^{2x^2}\frac{e^{2x^2}-\sqrt{2\pi}x\operatorname{erfi}(\sqrt{2}x)}{\pi \operatorname{erfi}(\sqrt{2}x)^2}} $$

Is not correct, what am i doing wrong?

3

There are 3 best solutions below

3
On

$(e^{y(x)})'=k_2e^{\frac12Cx^2}$ implies $e^{y(x)}=k_2\int_a^xe^{\frac12Ct^2}dt+k_3$, where $k_3=e^{y(a)}$ and which for $C>0$ does not involve the error function.

Then,

$$y(x)=\ln\left(k_2\int_a^xe^{\frac12Ct^2}dt+k_3\right)$$

0
On

Using the very long way, assuming that $y$ is a function of $x$,$$f(x) = \frac{\frac{d^2}{dx^2}[e^y]}{\frac{d}{dx}[e^y]}$$ finally write $$y''-y'^2-y' f(x)=0$$ which eventually allows reduction order setting $z=y'$. So, if $f(x)=c x$, the solution of $z'-z^2-z f(x)=0$ is $$z=\frac{2 \sqrt{c} e^{\frac{c x^2}{2}}}{\sqrt{2 \pi } \text{erfi}\left(\frac{\sqrt{c} x}{\sqrt{2}}\right)+2 \sqrt{c} k_1} $$ and finally $$y=\log \left(\sqrt{2 \pi } \text{erfi}\left(\frac{\sqrt{c} x}{\sqrt{2}}\right)+2 \sqrt{c} k_1\right)+k_2$$ The solution can be checked since $$\frac{d^2}{dx^2}[e^y]=2 c^{3/2} x e^{\frac{c x^2}{2}+k_2}$$ $$\frac{d}{dx}[e^y]=2 \sqrt{c} e^{\frac{c x^2}{2}+k_2}$$ $$\frac{\frac{d^2}{dx^2}[e^y]}{\frac{d}{dx}[e^y]}=cx=f(x)$$

Using the short way (as suggested by chu), define $z=\frac{d}{dx}[e^y]$ and the equation write $$\frac{z'}{z}=cx$$ so $\log(z)=\frac c2 x^2+k_1$, that is to say $z=k_1 e^{\frac c2 x^2}$ and then the gaussian integral and the final result.

5
On

Why does this not reduce to: y'' + (1-cx)y'=0?