1. PF Contest - Win "Conquering the Physics GRE" book! Click Here to Enter
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Solving a nonhomogeneous 2nd order ode

  1. Jun 14, 2013 #1
    Hi, everyone! This is my first post here, I need an hand with this equation!

    1. The problem statement, all variables and given/known data
    Solve the initial value problem:


    3. The attempt at a solution
    I started by solving the associated homogeneous linear equation \begin{equation} u''(x)+4u(x)=0\end{equation} by the usual method of substituting the trial solution \begin{equation} u(x)=e^{\lambda x} \end{equation}.
    One obtains \begin{equation}\begin{aligned} &\lambda^2+4=0 \\ &\lambda = \pm 2i \\ &u(x)=C_1\cos(2x)+C_2\sin(2x)\end{aligned}\end{equation}

    To find the particular solution I use the method of undetermined coefficients with \begin{equation}u(x)_p=x(A\cos(2x)+B\sin(2x)). \end{equation}
    Differentiating and substituting back in the ODE I get \begin{equation} u(x)_p=\frac{1}{4}\cos(2x)\end{equation} which is not good. I don't think I made some mistakes in the differentiation process since I checked my calculations with Maple.
  2. jcsd
  3. Jun 14, 2013 #2


    User Avatar
    Homework Helper

    Welcome to PF!
    Your particular solution is not correct. First, it should contain the factor x. Show please, how you arrived to the result A=1/4 B=0.

    Last edited: Jun 14, 2013
  4. Jun 15, 2013 #3
    I did again the calculation and this time I think I got it right,
    Starting from the test solution:
    by applying the usual rules of differentiation one obtains:
    \begin{equation}u(x)''= 0(A\cos(2x)+B\sin(2x)) + 2(-2Asin(2x)+2B\cos(2x))+x( -4A\cos(2x)-4B\sin(2x))\end{equation}
    which is

    Now, putting this back into the original equation \begin{equation} u(x)''+4u(x)=cos(2x) \end{equation} yelds
    \begin{equation} -4A\sin(2x)+4B\cos(2x)-4x(A\cos(2x)+B\sin(2x))+4x(A\cos(2x)+B\sin(2x))= cos(2x)\end{equation}
    \begin{equation} -4A\sin(2x)+4B\cos(2x)=cos(2x)\end{equation}
    I obtained \begin{equation} A=0 B=1/4 \end{equation}

    So what I get from the calculation is \begin{equation} u(x)=x(\frac{1}{4}\sin(2x))\end{equation} which is a particular solution for the ODE, now one can write the general solution in the form:
    \begin{equation} u(x)=C_1\cos(2x)+C_2\sin(2x)+x(\frac{1}{4}\sin(2x))\end{equation}

    Appereantly yesterday I substituted back the parameters in the wrong expression. :redface:
  5. Jun 15, 2013 #4


    User Avatar
    Homework Helper

    Or you incorrectly substituted back the parameters in the expression :biggrin:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted