# Solving an ODE numerically

I really appreciate it if anyone helps me with this:

How can I solve this ODE and plot the answer for $x$ on $[0.6,5]$:

\begin{align*} -2xy'[x] = y''[x]+ 47.21 (-.0025 x^6 & + 0.0614 x^5- 0.6087 x^4+ 3.048 x^3-8.0588 x^2 \\ & + 10.586 x - 3.9582)^2\operatorname{Erfc}[x] \end{align*}

With the following boundary conditions: $y[0.6]=0$ and $y[\infty]=0$

I used NDsolve, but its answer was:

Cannot find starting value for the variable y'[x]

Original source of the equation:

-2xy'[x] = y''[x] + 47.21 (-.0025 x^6 + 0.0614 x^5 - 0.6087 x^4 + 3.048 x^3
- 8.0588 x^2 + 10.586 x - 3.9582)^2 Erfc[x]


If you are willing to settle for $y(5) = 0$ instead of $y(\infty) = 0$, the commands to solve it are

sol = First@NDSolve[
{-2 x y'[x] == 47.21 (-3.9582 + 10.586 x - 8.0588 x^2 + 3.048 x^3 -
0.6087 x^4 + 0.0614 x^5 - 0.0025 x^6)^2 Erfc[x] + y''[x],
y[0.6] == 0, y[5] == 0},
y, {x, 0.6, 5}]

Plot[y[x] /. sol // Evaluate, {x, 0.6, 5}]


Increasing the upper bound from 5 to a larger number won't change much, so I believe using $y(5) = 0$ might be a good enough approximation.

There are completely analogous examples in the NDSolve documentation. Please check them.

• @ Szabolcs: thank you so much – sirous Apr 9 '12 at 12:14