Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I 2nd order ODE numerical solution

  1. Nov 18, 2017 #1
    I would like to solve the following differential equation, it seems easy but only given one initial value.

    y''(x) = ln(ln(x))
    y(5) = 0
    Solve for y(10)

    I know it can be directly integrated but cannot be expressed in terms of elementary functions.

    Most numerical method involves expressing the ODE in terms of first order ODE, but it need to have to initial value of y and also y'.

    Is it even possible to solve this, given only y(5) = 0?
  2. jcsd
  3. Nov 18, 2017 #2

    As long as it says "solve for y(10)", you can integrate two times without using the initial values, so y=y(x,c1, c2).
    In order to find c2, you will use x=5, y=y(5)=0. In order to express c1 as a function of y(10), you will use x=10, y=y(10).
  4. Nov 18, 2017 #3
    But the integrand cannot be integrated in terms of elementary functions.

    Or maybe you show the steps? Any help will be appreciated?
  5. Nov 18, 2017 #4
    I didn't mean that you can solve it analytically (You must deal with ##\int \frac {dx} {lnx}## if you proceed and try to solve it with integration by parts)

    However, as long as you have a 2nd order DE with y(5)=0, you can solve it (numerically) and get y as a function of x and y(10).

    You can try to solve it numerically with FEM (Finite Element Method).
    Last edited by a moderator: Nov 18, 2017
  6. Nov 18, 2017 #5
    Sorry I don't seem to get it. Can you show me the steps? It does not need to be accurate.
  7. Nov 18, 2017 #6
    If you don't know the finite element method, it is useless. Try to solve it analytically by parts and let the integrals with ##\frac {dx} {lnx}## in the solution or try to find them with wolfram alpha/with the help of a calculator.

    I can show you how to start:

    ##\frac {dy} {dx} = \int ln(lnx) \, dx=\int (x)'ln(lnx)\, dx \Rightarrow \frac {dy} {dx} = [xln(lnx)]- \int x (ln(lnx))'\, dx \Rightarrow
    \frac {dy} {dx} = [xln(lnx)]- \int x (\frac {\frac {1} {x}} {lnx})'\,dx=[xln(lnx)]-\int \frac {1} {lnx}\, dx + c_1##

    Proceed to find y(x) this way (integration by parts) and show us your work please.

    Finally, you will need the initial conditions and a calculator to get the values for the integrals ##\int \frac {dx} {lnx}##.
  8. Nov 19, 2017 #7
    I tried FEM method.

    However, if I change ln(ln(x)) to a simple one that can be integrated easily, like x2, then I would get different answer if I use FEM (assuming the function cannot be integrated analytically) when compared to answer obtained by finding the function y(x) directly. What's the problem here?
  9. Nov 19, 2017 #8
    Maybe, you need to use more steps in order to get the exact solution/function.
  10. Nov 19, 2017 #9
    You are still missing a boundary condition for the derivative. Some numerical methods will just assume y' at the starting point to be zero and start anyway.

    By the way, a second order ode of the form y"(x)=f(x) can always be reduced to a first order ode by introducing the variable w=y', w'=y"
    so you would have w'(x) = f(x)=log(log(x)), the solution is some exponential integral in your case.
    You need a boundary condition for it though to completely solve it, or you will end up with an unknown integration constant. And this boundary condition is missing. As was said in post #2, you can still express y(10) in terms of the integration constant (or y'(5) )
  11. Nov 20, 2017 #10
    I propose, as suggested by bigfooted, to convert the equation to a system of to first-order differential equations. You can then use, e.g., Runge-Kutta method to solve the problem. However, for a unique solution you need a value for the derivative at some point. Alternatively, you can use Numerov's method to solve the 2nd order equation directly.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted