Solving a nonhomogeneous 2nd order ode

Iacha
Messages
3
Reaction score
0
Hi, everyone! This is my first post here, I need an hand with this equation!

Homework Statement


Solve the initial value problem:

\begin{equation}
\begin{cases}
u''(x)+4u(x)=\cos(2x)
\\u(0)=u'(0)=1
\end{cases}
\end{equation}

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.
 
Physics news on Phys.org
Iacha said:
Hi, everyone! This is my first post here, I need an hand with this equation!

Homework Statement


Solve the initial value problem:

\begin{equation}
\begin{cases}
u''(x)+4u(x)=\cos(2x)
\\u(0)=u'(0)=1
\end{cases}
\end{equation}

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.

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.

ehild
 
Last edited:
I did again the calculation and this time I think I got it right,
Starting from the test solution:
\begin{equation}u(x)=x(A\cos(2x)+B\sin(2x))\end{equation}
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
\begin{equation}u(x)''=-4A\sin(2x)+4B\cos(2x)+x(-4A\cos(2x)-4B\sin(2x))\end{equation}

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}
Simplifying:
\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:
 
Iacha said:
Appereantly yesterday I substituted back the parameters in the wrong expression. :redface:

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

ehild
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top